Exemplo n.º 1
0
        public static void InitializeMatrices(Camera camera)
        {
            var viewMatrix = camera.GetViewMatrix();
            var projection = camera.GetProjectionMatrix();

            WireframeShader.Use();
            WireframeShader.ViewMatrix.Set(viewMatrix);
            WireframeShader.Projection.Set(projection);

            WireframeShader2.Use();
            WireframeShader2.ViewMatrix.Set(viewMatrix);
            WireframeShader2.Projection.Set(projection);

            ColorShader.Use();
            ColorShader.ViewMatrix.Set(viewMatrix);
            ColorShader.Projection.Set(projection);

            ModelShader.Use();
            ModelShader.ViewMatrix.Set(viewMatrix);
            ModelShader.Projection.Set(projection);
            ModelShader.ViewPosition.Set(camera.Position);

            StudConnectionShader.Use();
            StudConnectionShader.ViewMatrix.Set(viewMatrix);
            StudConnectionShader.Projection.Set(projection);

            SimpleTextureShader.Use();
            SimpleTextureShader.ViewMatrix.Set(viewMatrix);
            SimpleTextureShader.Projection.Set(projection);

            UIRenderHelper.TextRenderer.ProjectionMatrix = projection;
            UIRenderHelper.TextRenderer.DrawingPrimitives.Clear();
            TextViewMatrix = viewMatrix;

            GL.UseProgram(0);
        }