summaryrefslogtreecommitdiff
path: root/ground.frag
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-07-31 13:14:54 -0700
committerEric Anholt <eric@anholt.net>2009-07-31 13:14:54 -0700
commit9edec97711106d69b2030a20d4528c2726741eed (patch)
treef40bc8567498fa4c791e71ca105165bbe6e1d636 /ground.frag
parentbd93aac316f3252f3cfc5b222b6a2f2388307a04 (diff)
Use texture2DProj for correct interpolation of shadow coords.
Diffstat (limited to 'ground.frag')
-rw-r--r--ground.frag4
1 files changed, 2 insertions, 2 deletions
diff --git a/ground.frag b/ground.frag
index dca71f2..8af0fb5 100644
--- a/ground.frag
+++ b/ground.frag
@@ -1,12 +1,12 @@
uniform vec3 light_eye;
-varying vec2 shadow_coords;
+varying vec3 shadow_coords;
varying vec3 vertex_eye;
uniform sampler2D shadow_sampler;
void main()
{
vec3 normal = vec3(0.0, 0.0, 1.0);
- vec4 material_color = texture2D(shadow_sampler, shadow_coords);
+ vec4 material_color = texture2DProj(shadow_sampler, shadow_coords);
vec3 l = normalize(light_eye - vertex_eye);
vec3 v = normalize(-vertex_eye);
vec3 h = normalize(l + v);