blob: 9c27648aaf93d598c9e4f8ed28f5dee5c24ab3ab [file] [log] [blame]
Brianedf24e62007-02-03 11:36:16 -07001// Fragment shader for cube-texture reflection mapping
2// Brian Paul
3
4
5uniform samplerCube cubeTex;
6varying vec3 normal;
7uniform vec3 lightPos;
8
9void main()
10{
11 // simple diffuse, specular lighting:
12 vec3 lp = normalize(lightPos);
13 float dp = dot(lp, normalize(normal));
14 float spec = pow(dp, 5.0);
15
16 // final color:
17 gl_FragColor = dp * textureCube(cubeTex, gl_TexCoord[0].xyz, 0.0) + spec;
18}