Shader Coding - Best Practices: Difference between revisions

m
→‎Vertex Shaders: removing as per i4dnf's expert advice
mNo edit summary
m (→‎Vertex Shaders: removing as per i4dnf's expert advice)
Line 18: Line 18:
}
}
</syntaxhighlight>
</syntaxhighlight>
}}
{{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>
}}
}}