示例#1
0
 public void Render(
     GraphicsContext graphics,
     Camera camera,
     LightModel light,
     Model model,
     BgModel bg
     )
 {
     graphics.Clear();
     drawModel(graphics, camera, light, model);
     light.Render(graphics, camera);
     bg.Render(graphics, camera);
 }
示例#2
0
        private void renderSimpleScene(
            GraphicsContext graphics,
            Camera camera,
            LightModel light,
            Model model,
            BgModel bg
            )
        {
            // rendering
            graphics.Clear();

            Matrix4 world         = model.Posture;
            Matrix4 worldViewProj = camera.Projection * camera.View * world;

            shaderTexture.SetUniformValue(shaderTexture.FindUniform("WorldViewProj"), ref worldViewProj);
            graphics.SetShaderProgram(shaderTexture);
            graphics.SetVertexBuffer(0, vbTeapot);

            graphics.SetTexture(0, texture);
            graphics.DrawArrays(model.Mesh.Prim, 0, model.Mesh.IndexCount);

            light.Render(graphics, camera);
            bg.Render(graphics, camera);
        }