132001f49Smrg// Fragment shader for cube-texture reflection mapping 232001f49Smrg// Brian Paul 332001f49Smrg 432001f49Smrg 532001f49Smrguniform samplerCube cubeTex; 632001f49Smrgvarying vec3 normal; 732001f49Smrguniform vec3 lightPos; 832001f49Smrg 932001f49Smrgvoid main() 1032001f49Smrg{ 1132001f49Smrg // simple diffuse, specular lighting: 1232001f49Smrg vec3 lp = normalize(lightPos); 1332001f49Smrg float dp = dot(lp, normalize(normal)); 1432001f49Smrg float spec = pow(dp, 5.0); 1532001f49Smrg 1632001f49Smrg // final color: 1732001f49Smrg gl_FragColor = dp * textureCube(cubeTex, gl_TexCoord[0].xyz, 0.0) + spec; 1832001f49Smrg} 19