Shader Patching

GLSL 1.30 shaders need to be tweaked in order to work with a 1.20-only driver.

Version string

GLSL 1.30:

#version 130

GLSL 1.20 or 1.10:

#version 120
#version 110

Vertex shader input values

GLSL 1.30:

in vec3 in_Vertex;
in vec2 in_MultiTexCoord0;
in vec4 in_Color;

GLSL 1.10 or 1.20:

  • gl_Vertex (implicit)
  • gl_MultiTexCoord0, gl_MultiTexCoord1... (implicit)
  • gl_Color (implicit)

Solution: replace

in vec3 in_Vertex;

with

main() {
    /* ... */
    vec3 in_Vertex = gl_Vertex;
Last modified 6 years ago Last modified on Jun 13, 2011, 7:15:29 PM