tesspot
diff sdr/bezier.te.glsl @ 1:befe01bbd27f
tessellated the teapot
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Dec 2012 17:16:32 +0200 |
parents | 72b7f9f2eead |
children | 178a9e3c3c8c |
line diff
1.1 --- a/sdr/bezier.te.glsl Sun Dec 02 08:23:51 2012 +0200 1.2 +++ b/sdr/bezier.te.glsl Sun Dec 02 17:16:32 2012 +0200 1.3 @@ -1,10 +1,12 @@ 1.4 #version 410 compatibility 1.5 1.6 -layout(quads) in; 1.7 +layout(quads, ccw) in; 1.8 1.9 out vec3 normal; 1.10 out vec3 vpos; 1.11 1.12 +uniform vec3 norm_scale; 1.13 + 1.14 vec3 bezier_patch(float u, float v); 1.15 vec3 bezier_patch_norm(float u, float v); 1.16 float bernstein(int i, float x); 1.17 @@ -39,7 +41,7 @@ 1.18 { 1.19 vec3 tang = bezier_patch(u + DT, v) - bezier_patch(u - DT, v); 1.20 vec3 bitan = bezier_patch(u, v + DT) - bezier_patch(u, v - DT); 1.21 - return cross(tang, bitan); 1.22 + return cross(tang, bitan) * norm_scale; 1.23 } 1.24 1.25 float bernstein(int i, float x)