From 5b91ee27c0f6e6379a9dc0bb41f4aef2f66b6346 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 4 Dec 2007 18:44:40 -0700 Subject: Undo changes made to the toyball shaders in commit d19d0596daf004b56d80f78fa1a329b43c2ebf94 This demo produces the expected results again. --- progs/glsl/CH11-toyball.frag.txt | 7 +++---- progs/glsl/CH11-toyball.vert.txt | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'progs/glsl') diff --git a/progs/glsl/CH11-toyball.frag.txt b/progs/glsl/CH11-toyball.frag.txt index f3cac62fb3..90ec1c27fc 100644 --- a/progs/glsl/CH11-toyball.frag.txt +++ b/progs/glsl/CH11-toyball.frag.txt @@ -49,15 +49,14 @@ void main() inorout += dot(distance, vec4(1.0)); distance.x = dot(p, HalfSpace4); -// distance.y = StripeWidth - abs(p.z); - distance.y = StripeWidth - abs(p.y); + distance.y = StripeWidth - abs(p.z); distance = smoothstep(-FWidth, FWidth, distance); inorout += distance.x; inorout = clamp(inorout, 0.0, 1.0); - surfColor = mix(Yellow, Blue, distance.y); - surfColor = mix(surfColor, Red, inorout); + surfColor = mix(Yellow, Red, inorout); + surfColor = mix(surfColor, Blue, distance.y); // normal = point on surface for sphere at (0,0,0) normal = p; diff --git a/progs/glsl/CH11-toyball.vert.txt b/progs/glsl/CH11-toyball.vert.txt index a3ee1b0377..b7da3ac839 100644 --- a/progs/glsl/CH11-toyball.vert.txt +++ b/progs/glsl/CH11-toyball.vert.txt @@ -14,11 +14,10 @@ uniform vec4 BallCenter; // ball center in modelling coordinates void main() { - ECposition = gl_ModelViewMatrix * gl_Vertex; +//orig: ECposition = gl_ModelViewMatrix * gl_Vertex; -// ECposition = gl_TextureMatrix[0] * gl_Vertex; -// ECposition = gl_MultiTexCoord0 * gl_Vertex; -// ECposition = gl_ModelViewMatrix * ECposition; + ECposition = gl_TextureMatrix[0] * gl_Vertex; + ECposition = gl_ModelViewMatrix * ECposition; ECballCenter = gl_ModelViewMatrix * BallCenter; gl_Position = ftransform(); -- cgit v1.2.3