Beispiel #1
0
        public void Render(Camera camera)
        {
            GL.UseProgram(shader.Program);
            GL.BindVertexArray(quadVao);
            GL.EnableVertexAttribArray(0);

            var uniformLocation = shader.GetUniformLocation("m_vTintColorSceneObject");

            if (uniformLocation > -1)
            {
                GL.Uniform4(uniformLocation, Vector4.One);
            }

            uniformLocation = shader.GetUniformLocation("m_vTintColorDrawCall");
            if (uniformLocation > -1)
            {
                GL.Uniform3(uniformLocation, Vector3.One);
            }

            material.Render(shader);

            GL.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);

            material.PostRender();

            GL.BindVertexArray(0);
            GL.UseProgram(0);
        }
        public void Render(Camera camera, RenderPass renderPass)
        {
            GL.UseProgram(shader.Program);
            GL.BindVertexArray(quadVao);
            GL.EnableVertexAttribArray(0);

            var uniformLocation = shader.GetUniformLocation("m_vTintColorSceneObject");

            if (uniformLocation > -1)
            {
                GL.Uniform4(uniformLocation, Vector4.One);
            }

            uniformLocation = shader.GetUniformLocation("m_vTintColorDrawCall");
            if (uniformLocation > -1)
            {
                GL.Uniform3(uniformLocation, Vector3.One);
            }

            var identity = Matrix4.Identity;

            uniformLocation = shader.GetUniformLocation("uProjectionViewMatrix");
            if (uniformLocation > -1)
            {
                GL.UniformMatrix4(uniformLocation, false, ref identity);
            }

            uniformLocation = shader.GetUniformLocation("transform");
            if (uniformLocation > -1)
            {
                GL.UniformMatrix4(uniformLocation, false, ref identity);
            }

            material.Render(shader);

            GL.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);

            material.PostRender();

            GL.BindVertexArray(0);
            GL.UseProgram(0);
        }