示例#1
0
        public void Initialize()
        {
            loaded = true;
            glControl.CreateControl();
            HeadPoints.Initialize(HeadPointsCount);
            HeadPoints.RenderCamera = camera;
            HeadPoints.GenerateSphere(0.3f, 5, 5);

            idleShader = new ShaderController("idle.vs", "idle.fs");
            idleShader.SetUniformLocation("u_UseTexture");
            idleShader.SetUniformLocation("u_Color");
            idleShader.SetUniformLocation("u_Texture");
            idleShader.SetUniformLocation("u_BrushMap");
            idleShader.SetUniformLocation("u_TransparentMap");
            idleShader.SetUniformLocation("u_World");
            idleShader.SetUniformLocation("u_WorldView");
            idleShader.SetUniformLocation("u_ViewProjection");
            idleShader.SetUniformLocation("u_LightDirection");

            blendShader = new ShaderController("blending.vs", "blending.fs");
            blendShader.SetUniformLocation("u_Texture");
            blendShader.SetUniformLocation("u_BaseTexture");
            blendShader.SetUniformLocation("u_BlendDirectionX");

            LoadModel(ProgramCore.DefaultIsSmile);

            SetupViewport(glControl);

            windowInfo          = Utilities.CreateWindowsWindowInfo(renderPanel.Handle);
            graphicsContext     = new GraphicsContext(GraphicsMode.Default, windowInfo);
            renderPanel.Resize += (sender, args) => graphicsContext.Update(windowInfo);
            glControl.Context.MakeCurrent(glControl.WindowInfo);

            RenderTimer.Start();
        }