Example #1
0
        public void RenderAmbientColor(BlinnPhongAmbientEventArgs arg)
        {
            ICamera camera     = arg.Camera;
            mat4    projection = camera.GetProjectionMatrix();
            mat4    view       = camera.GetViewMatrix();
            mat4    model      = this.GetModelMatrix();

            RenderMethod  method  = this.RenderUnit.Methods[0];
            ShaderProgram program = method.Program;

            program.SetUniform("mvpMat", projection * view * model);
            program.SetUniform("ambientColor", arg.Ambient);

            method.Render();
        }
Example #2
0
        public void RenderAmbientColor(BlinnPhongAmbientEventArgs arg)
        {
            if (!this.renderBody)
            {
                return;
            }

            ICamera camera     = arg.Camera;
            mat4    projection = camera.GetProjectionMatrix();
            mat4    view       = camera.GetViewMatrix();
            mat4    model      = this.GetModelMatrix();

            var           method  = this.RenderUnit.Methods[(int)MethodName.renderAmbientColor];
            ShaderProgram program = method.Program;

            program.SetUniform("mvpMat", projection * view * model);
            program.SetUniform("ambientColor", arg.Ambient);

            method.Render();
        }