public override void display()
        {
            reshape();
            GL.ClearColor(0.75f, 0.75f, 1.0f, 1.0f);
            GL.ClearDepth(1.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit |ClearBufferMask.DepthBufferBit);

            if(g_pPlane != null && g_pCorridor != null )
            {
                g_camTimer.Update();

                float cyclicAngle = g_camTimer.GetAlpha() * 6.28f;
                float hOffset = (float)Math.Cos(cyclicAngle) * 0.25f;
                float vOffset = (float)Math.Sin(cyclicAngle) * 0.25f;

                MatrixStack modelMatrix = new MatrixStack();

                Matrix4 worldToCamMat = Matrix4.LookAt(
                    new Vector3(hOffset, 1.0f, -64.0f),
                    new Vector3(hOffset, -5.0f + vOffset, -44.0f),
                    new Vector3(0.0f, 1.0f, 0.0f));

                modelMatrix.ApplyMatrix(worldToCamMat);

                using ( PushStack pushstack = new PushStack(modelMatrix))
                {
                    GL.UseProgram(Programs.GetProgram(manyImageProgram));
                    Matrix4 mm = modelMatrix.Top();
                    GL.UniformMatrix4(Programs.GetModelToCameraMatrixUnif(manyImageProgram), false, ref mm);

                    GL.ActiveTexture(TextureUnit.Texture0 + g_colorTexUnit);
                    GL.BindTexture(TextureTarget.Texture2D,
                        g_useMipmapTexture ? g_mipmapTestTexture : g_checkerTexture);
                    GL.BindSampler(g_colorTexUnit, g_samplers[g_currSampler]);

                    if(g_drawCorridor)
                        g_pCorridor.Render("tex");
                    else
                        g_pPlane.Render("tex");

                    if (drawTextureSphere) ts.Draw();
                    ts.RotateShapeAboutAxis(1f);
                    te.Draw();

                    GL.BindSampler(g_colorTexUnit, 0);
                    GL.BindTexture(TextureTarget.Texture2D, 0);

                    GL.UseProgram(0);
                }
            }
        }
        public override void display()
        {
            ClearDisplay();
            GL.FrontFace(FrontFaceDirection.Cw);
            quaternionText.Draw();
            axisAngleText.Draw();
            GL.FrontFace(FrontFaceDirection.Ccw);
            if (meshes[currentMesh] != null)
            {
                MatrixStack modelMatrix = new MatrixStack();
                modelMatrix.Scale(0.8f);
                modelMatrix.Translate(0.0f, 0.0f, 0f);

                // Apply object transforms first
                modelMatrix.ApplyMatrix(g_objtPole.CalcMatrix());

                // End  Object Pole Code

                using (PushStack pushstack = new PushStack(modelMatrix))
                {
                    modelMatrix.Scale(cubeScaleFactor);
                    GL.UseProgram(programs[currentProgram].theProgram);

                    Matrix4 mm = modelMatrix.Top();

                    GL.UniformMatrix4(programs[currentProgram].modelToWorldMatrixUnif, false, ref mm);
                    if (programs[currentProgram].baseColorUnif != -1)
                    {
                        GL.Uniform4(programs[currentProgram].baseColorUnif, 0.5f, 0.5f, 0f, 1.0f);
                    }
                    meshes[cube].Render();
                }

                using (PushStack pushstack = new PushStack(modelMatrix))
                {
                    modelMatrix.Translate(new Vector3(0f, 0.4f, 0.0f));
                    modelMatrix.Scale(cylinderScaleFactor);
                    GL.UseProgram(programs[currentProgram].theProgram);

                    Matrix4 mm = modelMatrix.Top();

                    GL.UniformMatrix4(programs[currentProgram].modelToWorldMatrixUnif, false, ref mm);
                    if (programs[currentProgram].baseColorUnif != -1)
                    {
                        GL.Uniform4(programs[currentProgram].baseColorUnif, 0.0f, 0.5f, 0.5f, 1.0f);
                    }
                    meshes[cylinder].Render();
                }

                GL.UseProgram(0);
                if (perspectiveAngle != newPerspectiveAngle)
                {
                    perspectiveAngle = newPerspectiveAngle;
                    reshape();
                }
            }
            if (updateText)
            {
                quaternionText.UpdateText(QuaternionString());
                axisAngleText.UpdateText(AxisAngeString());
                updateText = false;
            }
        }
        public override void display()
        {
            ClearDisplay();

            if((g_pPlaneMesh != null) && (g_pCylinderMesh != null))
            {
                MatrixStack modelMatrix = new MatrixStack();
                modelMatrix.SetMatrix(g_viewPole.CalcMatrix());

                Vector4 lightDirCameraSpace = Vector4.Transform(g_lightDirection, modelMatrix.Top());
                ProgramData whiteDiffuse = g_bShowAmbient ? g_WhiteAmbDiffuseColor : g_WhiteDiffuseColor;
                ProgramData vertexDiffuse = g_bShowAmbient ? g_VertexAmbDiffuseColor : g_VertexDiffuseColor;

                if(g_bShowAmbient)
                {
                    GL.UseProgram(whiteDiffuse.theProgram);
                    GL.Uniform4(whiteDiffuse.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f);
                    GL.Uniform4(whiteDiffuse.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f);
                    GL.UseProgram(0);
                    GL.UseProgram(vertexDiffuse.theProgram);
                    GL.Uniform4(vertexDiffuse.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f);
                    GL.Uniform4(vertexDiffuse.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f);
                    GL.UseProgram(0);
                }
                else
                {
                    GL.UseProgram(whiteDiffuse.theProgram);
                    GL.Uniform4(whiteDiffuse.lightIntensityUnif, 0.5f, 0.5f, 0.5f, 0.5f);
                    GL.UseProgram(0);
                    GL.UseProgram(vertexDiffuse.theProgram);
                    GL.Uniform4(vertexDiffuse.lightIntensityUnif, 0.5f, 0.5f, 0.5f, 0.5f);
                    GL.UseProgram(0);
                }

                GL.UseProgram(whiteDiffuse.theProgram);
                Vector3 dirToLight = new Vector3(lightDirCameraSpace.X, lightDirCameraSpace.Y, lightDirCameraSpace.Z);

                GL.Uniform3(whiteDiffuse.dirToLightUnif, dirToLight);
                GL.UseProgram(0);
                GL.UseProgram(vertexDiffuse.theProgram);
                GL.Uniform3(vertexDiffuse.dirToLightUnif, dirToLight);
                GL.UseProgram(0);

                //Render the ground plane.
                using ( PushStack pushstack = new PushStack(modelMatrix))
                {
                    GL.UseProgram(whiteDiffuse.theProgram);
                    //modelMatrix.Scale(new Vector3(10f, 10f, 1f));
                    //modelMatrix.ApplyMatrix(g_objtPole.CalcMatrix());

                    //modelMatrix.Translate(new Vector3(0f, 0f, -10f));

                    Matrix4 mm =  modelMatrix.Top();
                    planeModelmatrix = mm;
                    //mm = Matrix4.Identity; // TEST
                    GL.UniformMatrix4(whiteDiffuse.modelToCameraMatrixUnif, false, ref mm);
                    //projData.cameraToClipMatrix = Matrix4.Identity; // Test
                    GL.UniformMatrix4(whiteDiffuse.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                    Matrix3 normMatrix = new Matrix3(modelMatrix.Top());
                    //normMatrix.Normalize();
                    //normMatrix = Matrix3.Identity; // TEST
                    GL.UniformMatrix3(whiteDiffuse.normalModelToCameraMatrixUnif, false, ref normMatrix);
                    g_pPlaneMesh.Render();
                    GL.UseProgram(0);
                }

                //Render the Cylinder
                using (PushStack pushstack = new PushStack(modelMatrix))
                {
                    modelMatrix.ApplyMatrix(g_objtPole.CalcMatrix());
                    //modelMatrix.Scale(0.05f);
                    modelMatrix.Translate(new Vector3(0f, 0.0f, -10f));
                    coloredCylinderModelmatrix = modelMatrix.Top ();
                    if(g_bDrawColoredCyl)
                    {
                        GL.UseProgram(vertexDiffuse.theProgram);
                        Matrix4 mm = modelMatrix.Top();
                        //mm = Matrix4.Identity; // TEST
                        GL.UniformMatrix4(vertexDiffuse.modelToCameraMatrixUnif, false, ref mm);
                        //projData.cameraToClipMatrix = Matrix4.Identity; // TEST
                        GL.UniformMatrix4(vertexDiffuse.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                        Matrix3 normMatrix = new Matrix3(modelMatrix.Top());
                        //normMatrix = Matrix3.Identity; // TEST
                        GL.UniformMatrix3(vertexDiffuse.normalModelToCameraMatrixUnif, false, ref normMatrix);
                        g_pCylinderMesh.Render("lit-color");
                    }
                    else
                    {
                        GL.UseProgram(whiteDiffuse.theProgram);
                        Matrix4 mm = modelMatrix.Top();
                        //mm = Matrix4.Identity; // TEST
                        GL.UniformMatrix4(whiteDiffuse.modelToCameraMatrixUnif, false, ref mm);
                        //projData.cameraToClipMatrix = Matrix4.Identity; // TEST
                        GL.UniformMatrix4(whiteDiffuse.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                        Matrix3  normMatrix = new Matrix3(modelMatrix.Top());
                        //normMatrix = Matrix3.Identity; // TEST
                        GL.UniformMatrix3(whiteDiffuse.normalModelToCameraMatrixUnif, false, ref normMatrix);
                        g_pCylinderMesh.Render("lit");
                    }

                    GL.UseProgram(0);
                }

            }
        }
        public override void display()
        {
            if(g_pScene == null)
                return;

            g_timer.Update();

            GL.ClearColor(0.8f, 0.8f, 0.8f, 1.0f);
            GL.ClearDepth(1.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit |ClearBufferMask.DepthBufferBit);

            MatrixStack modelMatrix = new MatrixStack();
            modelMatrix.ApplyMatrix(g_viewPole.CalcMatrix());

            BuildLights(modelMatrix.Top());

            if (rightMultiply)
            {
                g_nodes[0].NodeSetOrient(Quaternion.FromAxisAngle(new Vector3(0.0f, 1.0f, 0.0f),
                    360.0f *  g_timer.GetAlpha()/reduceSpeed));
                g_nodes[3].NodeSetOrient(Quaternion.Multiply(g_spinBarOrient,
                    Quaternion.FromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), 360.0f * g_timer.GetAlpha()/reduceSpeed)));
            }
            else
            {
                g_nodes[0].NodeSetOrient(Quaternion.FromAxisAngle(new Vector3(0.0f, 1.0f, 0.0f),
                    360.0f *  g_timer.GetAlpha()/reduceSpeed));
                g_nodes[3].NodeSetOrient(Quaternion.Multiply(
                    Quaternion.FromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), 360.0f * g_timer.GetAlpha()/reduceSpeed),
                    g_spinBarOrient));
            }

            {
                MatrixStack persMatrix = new MatrixStack();
                persMatrix.Perspective(60.0f, (width/2f / height), g_fzNear, g_fzFar);

                // added
                //persMatrix.Translate(translateVector);
                //persMatrix.Scale(scaleFactor);
                // end added

                ProjectionBlock projData = new ProjectionBlock();
                projData.cameraToClipMatrix = persMatrix.Top();

                GL.UseProgram(g_unlitProg);
                GL.UniformMatrix4(g_unlitCameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                GL.UseProgram(0);

                GL.UseProgram(g_pScene.FindProgram("p_lit"));
                GL.UniformMatrix4(g_litCameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                GL.UseProgram(0);
            }

            GL.Viewport(0, 0, width/2, height);
            g_pScene.Render(modelMatrix.Top());

            if(g_bDrawCameraPos)
            {
                using (PushStack pushstack = new PushStack(modelMatrix))//Draw lookat point.
                {
                    modelMatrix.SetIdentity();
                    modelMatrix.Translate(new Vector3(0.0f, 0.0f, -g_viewPole.GetView().radius));
                    modelMatrix.Scale(0.5f);

                    GL.Disable(EnableCap.DepthTest);
                    GL.DepthMask(false);
                    GL.UseProgram(g_unlitProg);
                    Matrix4 mm = modelMatrix.Top();
                    GL.UniformMatrix4(g_unlitModelToCameraMatrixUnif, false, ref mm);
                    GL.Uniform4(g_unlitObjectColorUnif, 0.25f, 0.25f, 0.25f, 1.0f);
                    g_pSphereMesh.Render("flat");
                    GL.DepthMask(true);
                    GL.Enable(EnableCap.DepthTest);
                    GL.Uniform4(g_unlitObjectColorUnif, 1.0f, 1.0f, 1.0f, 1.0f);
                    g_pSphereMesh.Render("flat");
                }
            }

            {
                MatrixStack persMatrix = new MatrixStack();
                Matrix4 applyMatrix = g_persViewPole.CalcMatrix();
                applyMatrix.Row3 = Vector4.Zero;
                applyMatrix.Column3 = Vector4.Zero;
                applyMatrix.M44 = 1f;
                persMatrix.ApplyMatrix(applyMatrix);
                persMatrix.Perspective(60.0f, (width/2f / height), g_fzNear, g_fzFar);

                // added
                persMatrix.Translate(translateVector);
                persMatrix.Scale(scaleFactor);
                // end added

                ProjectionBlock projData = new ProjectionBlock();
                projData.cameraToClipMatrix = persMatrix.Top();

                GL.UseProgram(g_unlitProg);
                GL.UniformMatrix4(g_unlitCameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                GL.UseProgram(0);

                GL.UseProgram(g_pScene.FindProgram("p_lit"));
                GL.UniformMatrix4(g_litCameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                GL.UseProgram(0);

            }

            if(!g_bDepthClampProj)
                GL.Disable(EnableCap.DepthClamp);
            GL.Viewport(width/2, 0, width/2, height);
            g_pScene.Render(modelMatrix.Top());
            GL.Enable(EnableCap.DepthClamp);
        }
        public override void display()
        {
            g_lightTimer.Update();

            GL.ClearColor(0.75f, 0.75f, 1.0f, 1.0f);
            GL.ClearDepth(1.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            if((g_pObjectMesh != null) && (g_pCubeMesh != null))
            {
                MatrixStack modelMatrix = new MatrixStack();
                modelMatrix.SetMatrix(g_viewPole.CalcMatrix());
                Matrix4 worldToCamMat = modelMatrix.Top();

                LightBlock lightData = new LightBlock(NUMBER_OF_LIGHTS);

                lightData.ambientIntensity = new Vector4(0.2f, 0.2f, 0.2f, 1.0f);
                lightData.lightAttenuation = g_fLightAttenuation;

                Vector3 globalLightDirection = new Vector3(0.707f, 0.707f, 0.0f);

                lightData.lights[0].cameraSpaceLightPos =
                    Vector4.Transform(new Vector4(globalLightDirection, 0.0f), worldToCamMat);
                lightData.lights[0].lightIntensity = new Vector4(0.6f, 0.6f, 0.6f, 1.0f);

                lightData.lights[1].cameraSpaceLightPos = Vector4.Transform(CalcLightPosition(), worldToCamMat);
                lightData.lights[1].lightIntensity = new Vector4(0.4f, 0.4f, 0.4f, 1.0f);

                g_litShaderProg.lightBlock.Update(lightData);
                g_litTextureProg.lightBlock.Update(lightData);

                using ( PushStack pushstack = new PushStack(modelMatrix))
                {
                    modelMatrix.ApplyMatrix(g_objtPole.CalcMatrix());
                    modelMatrix.Scale(2.0f);

                    Matrix3 normMatrix = new Matrix3(modelMatrix.Top());
                    normMatrix.Transpose();
                    //TEST
                    normMatrix = Matrix3.Identity;
                    //normMatrix = glm::transpose(glm::inverse(normMatrix));

                    ProgramData prog = g_bUseTexture ? g_litTextureProg : g_litShaderProg;

                    GL.UseProgram(prog.theProgram);
                    Matrix4 mm = modelMatrix.Top();
                    GL.UniformMatrix4(prog.modelToCameraMatrixUnif, false, ref mm);
                    GL.UniformMatrix3(prog.normalModelToCameraMatrixUnif, false, ref normMatrix);

                    GL.ActiveTexture(TextureUnit.Texture0 + g_gaussTexUnit);
                    GL.BindTexture(TextureTarget.Texture1D, g_gaussTextures[g_currTexture]);
                    GL.BindSampler(g_gaussTexUnit, g_gaussSampler);

                    g_pObjectMesh.Render("lit");

                    GL.BindSampler(g_gaussTexUnit, 0);
                    GL.BindTexture(TextureTarget.Texture1D, 0);

                    GL.UseProgram(0);
                }

                if(g_bDrawLights)
                {
                    using (PushStack pushstack = new PushStack(modelMatrix))
                    {
                        modelMatrix.Translate(new Vector3(CalcLightPosition()));
                        modelMatrix.Scale(0.25f);

                        GL.UseProgram(g_Unlit.theProgram);
                        Matrix4 mm = modelMatrix.Top();
                        GL.UniformMatrix4(g_Unlit.modelToCameraMatrixUnif, false, ref mm);

                        Vector4 lightColor = new Vector4(1f, 1f, 1f, 1f);
                        GL.Uniform4(g_Unlit.objectColorUnif, ref lightColor);
                        g_pCubeMesh.Render("flat");
                    }

                    modelMatrix.Translate(globalLightDirection * 100.0f);
                    modelMatrix.Scale(5.0f);

                    Matrix4 mm2 = modelMatrix.Top();
                    GL.UniformMatrix4(g_Unlit.modelToCameraMatrixUnif, false, ref mm2);
                    g_pCubeMesh.Render("flat");

                    GL.UseProgram(0);
                }

                if(g_bDrawCameraPos)
                {
                    using (PushStack pushstack = new PushStack(modelMatrix))
                    {
                        modelMatrix.SetIdentity();
                        modelMatrix.Translate(new Vector3(0.0f, 0.0f, -g_viewPole.GetView().radius));
                        modelMatrix.Scale(0.25f);

                        GL.Disable(EnableCap.DepthTest);
                        GL.DepthMask(false);
                        GL.UseProgram(g_Unlit.theProgram);
                        Matrix4 mm = modelMatrix.Top();
                        GL.UniformMatrix4(g_Unlit.modelToCameraMatrixUnif, false, ref mm);
                        GL.Uniform4(g_Unlit.objectColorUnif, 0.25f, 0.25f, 0.25f, 1.0f);
                        g_pCubeMesh.Render("flat");
                        GL.DepthMask(true);
                        GL.Enable(EnableCap.DepthTest);
                        GL.Uniform4(g_Unlit.objectColorUnif, 1.0f, 1.0f, 1.0f, 1.0f);
                        g_pCubeMesh.Render("flat");
                    }
                }
            }
        }
        public override void display()
        {
            g_LightTimer.Update();
            ClearDisplay();
            if((g_pPlaneMesh != null) && (g_pCylinderMesh != null) && ( g_pCubeMesh != null))
            {
                MatrixStack modelMatrix = new MatrixStack();
                modelMatrix.SetMatrix(g_viewPole.CalcMatrix());

                Vector4 worldLightPos = CalcLightPosition();

                Vector4 lightPosCameraSpace = Vector4.Transform(worldLightPos, modelMatrix.Top());

                ProgramData pWhiteProgram;
                ProgramData pVertColorProgram;

                if(g_bUseFragmentLighting)
                {
                    pWhiteProgram = g_FragWhiteDiffuseColor;
                    pVertColorProgram = g_FragVertexDiffuseColor;
                }
                else
                {
                    pWhiteProgram = g_WhiteDiffuseColor;
                    pVertColorProgram = g_VertexDiffuseColor;
                }

                GL.UseProgram(pWhiteProgram.theProgram);
                GL.Uniform4(pWhiteProgram.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f);
                GL.Uniform4(pWhiteProgram.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f);
             	GL.UniformMatrix4(pWhiteProgram.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);
                GL.UseProgram(pVertColorProgram.theProgram);
                GL.Uniform4(pVertColorProgram.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f);
                GL.Uniform4(pVertColorProgram.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f);
                GL.UniformMatrix4(pVertColorProgram.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);

                GL.UseProgram(0);

                //Render the ground plane.
                using (PushStack pushstack = new PushStack(modelMatrix))
                {
                    GL.UseProgram(pWhiteProgram.theProgram);
                    Matrix4 mm = modelMatrix.Top();
                    GL.UniformMatrix4(pWhiteProgram.modelToCameraMatrixUnif, false, ref mm);

                    Matrix4 invTransform = modelMatrix.Top().Inverted();
                    Vector4 lightPosModelSpace = Vector4.Transform(lightPosCameraSpace, invTransform);
                    Vector3 lightPos = new Vector3(lightPosModelSpace.X, lightPosModelSpace.Y, lightPosModelSpace.Z);
                    GL.Uniform3(pWhiteProgram.modelSpaceLightPosUnif, ref lightPos);

                    g_pPlaneMesh.Render();
                    GL.UseProgram(0);
                }

                //Render the Cylinder
                using (PushStack pushstack = new PushStack(modelMatrix))
                {
                    modelMatrix.ApplyMatrix(g_objtPole.CalcMatrix());
                    //modelMatrix.Translate(new Vector3(0f, 0f, 10f));
                    coloredCylinderModelmatrix = modelMatrix.Top();
                    if(g_bScaleCyl)
                        modelMatrix.Scale(1.0f, 1.0f, 0.2f);
                    Matrix4 mm = modelMatrix.Top();
                    Matrix4 invTransform = modelMatrix.Top().Inverted();
                    Vector4 lightPosModelSpace = Vector4.Transform(lightPosCameraSpace,  invTransform);

                    if(g_bDrawColoredCyl)
                    {
                        GL.UseProgram(pVertColorProgram.theProgram);

                        GL.UniformMatrix4(pVertColorProgram.modelToCameraMatrixUnif, false, ref mm);
                        Vector3 lightPos = new Vector3(lightPosModelSpace.X, lightPosModelSpace.Y, lightPosModelSpace.Z);
                        GL.Uniform3(pVertColorProgram.modelSpaceLightPosUnif, ref lightPos);

                        GL.UniformMatrix4(pVertColorProgram.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);

                        g_pCylinderMesh.Render("lit-color");
                    }
                    else
                    {
                        GL.UseProgram(pWhiteProgram.theProgram);
                        GL.UniformMatrix4(pWhiteProgram.modelToCameraMatrixUnif, false, ref mm);
                        Vector3 lightPos = new Vector3(lightPosModelSpace.X, lightPosModelSpace.Y, lightPosModelSpace.Z);
                        GL.Uniform3(pWhiteProgram.modelSpaceLightPosUnif, ref lightPos);

                        GL.UniformMatrix4(pWhiteProgram.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);

                        g_pCylinderMesh.Render("lit");
                    }
                    GL.UseProgram(0);
                }

                //Render the light
                if(g_bDrawLight)
                {
                    using (PushStack pushstack = new PushStack(modelMatrix))
                    {
                        modelMatrix.Translate(new Vector3(worldLightPos));
                        modelMatrix.Scale(0.1f, 0.1f, 0.1f);

                        GL.UseProgram(g_Unlit.theProgram);
                        Matrix4 mm = modelMatrix.Top();
                        GL.UniformMatrix4(g_Unlit.modelToCameraMatrixUnif, false, ref mm);
                        GL.Uniform4(g_Unlit.baseColorUnif, 0.8078f, 0.8706f, 0.9922f, 1.0f);

                        GL.UniformMatrix4(g_Unlit.cameraToClipMatrixUnif, false, ref projData.cameraToClipMatrix);

                        g_pCubeMesh.Render("flat");
                    }
                }
            }
        }