Shader Coding - Best Practices: Difference between revisions

mNo edit summary
Line 12: Line 12:
}}
}}


{{Note| ftransform() is no longer available since GLSL 1.40 and GLSL ES 1.0. Instead, the programmer has to manage the projection and modelview matrices explicitly in order to comply with the new OpenGL 3.1 standard.
<syntaxhighlight lang="glsl">
#version 140
uniform Transformation {
mat4 projection_matrix;
mat4 modelview_matrix;
};
in vec3 vertex;
void main(void) {
gl_Position = projection_matrix * modelview_matrix * vec4(vertex, 1.0);
}</syntaxhighlight>
}}


== Fragment Shaders ==
== Fragment Shaders ==