lightmod.shader

00001 void main() 
00002 {
00003     //Use the first set of texture coordinates in the fragment shader 
00004     gl_TexCoord[0] = gl_MultiTexCoord0;
00005 
00006     // Transform the position to screen space
00007     gl_Position = ftransform(); 
00008 }
00009 
00010 ~~~~~~~
00011 
00012 uniform sampler2D Texture0;
00013 uniform sampler2D Texture1;
00014 
00015 void main() 
00016 {
00017     // Get the diffuse texture
00018     vec4 diffuse = texture2D( Texture0, gl_TexCoord[0].xy );
00019     
00020     // Get the light texture
00021     vec4 lights = texture2D( Texture1, gl_TexCoord[0].xy );
00022 
00023     // Cut off?
00024     gl_FragColor = diffuse * ( lights + gl_LightModel.ambient );
00025 }

Generated on Fri Mar 23 12:55:03 2007 for glsldemo by  doxygen 1.5.1-p1