13 variables ShaderProgramVariables
44 shaderType GL_VERTEX_SHADER
47 float simpleLight(void)
49 // calculate vertex position in eye coordinates
50 vec4 ecPosition = -normalize(gl_ModelViewMatrix * gl_Vertex);
52 // compute the transformed normal
53 vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
55 // Calculate a diffuse light intensity
56 return dot(ecPosition.xyz, tnorm);
63 shaderType GL_VERTEX_SHADER
67 float simpleLight(void);
69 varying float Diffuse;
73 Diffuse = simpleLight();
75 // output final vertex information
76 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
86 shaderType GL_FRAGMENT_SHADER
89 varying float Diffuse;
96 gl_FragColor = vec4(ColR * Diffuse,
115 url "../../SimpleTeapot/object.wrl"