summaryrefslogtreecommitdiffstats
path: root/progs/glsl/cubemap.frag
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-16 09:36:46 -0600
committerBrian Paul <[email protected]>2008-08-16 09:36:46 -0600
commitc0dd9122fdedd4bcab5bc0b3bbb490e6b62fac83 (patch)
treeac114b79c5790b10c0a8904ca79dfea5480c5617 /progs/glsl/cubemap.frag
parentce00d232f3c01c71fb659568e9b58da1f24b2519 (diff)
remove .txt suffix from shader source files
Diffstat (limited to 'progs/glsl/cubemap.frag')
-rw-r--r--progs/glsl/cubemap.frag18
1 files changed, 18 insertions, 0 deletions
diff --git a/progs/glsl/cubemap.frag b/progs/glsl/cubemap.frag
new file mode 100644
index 00000000000..9c27648aaf9
--- /dev/null
+++ b/progs/glsl/cubemap.frag
@@ -0,0 +1,18 @@
+// Fragment shader for cube-texture reflection mapping
+// Brian Paul
+
+
+uniform samplerCube cubeTex;
+varying vec3 normal;
+uniform vec3 lightPos;
+
+void main()
+{
+ // simple diffuse, specular lighting:
+ vec3 lp = normalize(lightPos);
+ float dp = dot(lp, normalize(normal));
+ float spec = pow(dp, 5.0);
+
+ // final color:
+ gl_FragColor = dp * textureCube(cubeTex, gl_TexCoord[0].xyz, 0.0) + spec;
+}