From 24e7acd5e4f1e7e71909f94fd1f075abd268d086 Mon Sep 17 00:00:00 2001 From: Zou Nan hai Date: Tue, 17 Jul 2007 11:25:37 +0800 Subject: [PATCH] bumpmap sample is correct now --- progs/glsl/CH11-bumpmap.frag.txt | 2 +- progs/glsl/CH11-bumpmap.vert.txt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/progs/glsl/CH11-bumpmap.frag.txt b/progs/glsl/CH11-bumpmap.frag.txt index 1467f767ec4..063576f5a3c 100644 --- a/progs/glsl/CH11-bumpmap.frag.txt +++ b/progs/glsl/CH11-bumpmap.frag.txt @@ -33,7 +33,7 @@ void main() litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0); vec3 reflectDir = reflect(LightDir, normDelta); - float spec = max(dot(normalize(EyeDir), reflectDir), 0.0); + float spec = max(dot(EyeDir, reflectDir), 0.0); spec *= SpecularFactor; litColor = min(litColor + spec, vec3(1.0)); diff --git a/progs/glsl/CH11-bumpmap.vert.txt b/progs/glsl/CH11-bumpmap.vert.txt index 55cf43ba7dd..d3d19f62ac3 100644 --- a/progs/glsl/CH11-bumpmap.vert.txt +++ b/progs/glsl/CH11-bumpmap.vert.txt @@ -31,9 +31,8 @@ void main() v.z = dot(LightPosition, n); LightDir = normalize(v); -/* v.x = dot(EyeDir, t); - v.y = dot(EyeDir, b); - v.z = dot(EyeDir, n); - EyeDir = normalize(EyeDir); -*/ + v.x = dot(EyeDir, t); + v.y = dot(EyeDir, b); + v.z = dot(EyeDir, n); + EyeDir = normalize(v); } -- 2.30.2