From d19d0596daf004b56d80f78fa1a329b43c2ebf94 Mon Sep 17 00:00:00 2001 From: Zou Nan hai Date: Thu, 21 Jun 2007 10:22:28 +0800 Subject: support branch and loop in pixel shader most of the sample working with some small modification --- progs/glsl/CH11-toyball.frag.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'progs/glsl/CH11-toyball.frag.txt') diff --git a/progs/glsl/CH11-toyball.frag.txt b/progs/glsl/CH11-toyball.frag.txt index 90ec1c27fc..f3cac62fb3 100644 --- a/progs/glsl/CH11-toyball.frag.txt +++ b/progs/glsl/CH11-toyball.frag.txt @@ -49,14 +49,15 @@ void main() inorout += dot(distance, vec4(1.0)); distance.x = dot(p, HalfSpace4); - distance.y = StripeWidth - abs(p.z); +// distance.y = StripeWidth - abs(p.z); + distance.y = StripeWidth - abs(p.y); distance = smoothstep(-FWidth, FWidth, distance); inorout += distance.x; inorout = clamp(inorout, 0.0, 1.0); - surfColor = mix(Yellow, Red, inorout); - surfColor = mix(surfColor, Blue, distance.y); + surfColor = mix(Yellow, Blue, distance.y); + surfColor = mix(surfColor, Red, inorout); // normal = point on surface for sphere at (0,0,0) normal = p; -- cgit v1.2.3