Commit 5dbf9e49 by Kai Westerkamp

typed regular Code, not Tested

parent 429de903
......@@ -13,6 +13,35 @@ uniform mat4x4 MVP;
void main()
{
//v ist Punkt 7, u = 4, v= 8;
float u = gl_TessCoord.x;
float u2 = u*u;
float u3 = u2*u;
float u4= u2*u2;
float v = gl_TessCoord.y;
float v2 = v*v;
float v3 = v2*v;
float v4= v2*v2;
float w = gl_TessCoord.z;
float w2 = w*w;
float w3 = w2*w;
float w4= w2*w2;
float a0 = u4+2*u3*v;
float a1 = u4+2*u3*w;
float a2 = u4+2*u3*w+6*u3*v+6*u2*v*w+12*u2*v2+6*u*v2*w+6*u*v3+2*v3*w+v4;
float a3 = 6*u4+24*u3*w+24*u2*w2+8*u*w3+w4+24*u3*v+60*u2*v*w+36*u*v*w2+6*v*w3+24*u2*v2+36*u*v2*w+12*v2*w2+8*u*v3+6*v3*w+v4;
float a4 = u4+6*u3*w+12*u2*w2+6*u*w3+w4+2*u3*v+6*u2*v*w+6*u*v*w2+2*v*w3;
float a5 = 2*u*v3+v4;
float a6 = u4+6*u3*w+12*u2*w2+6*u*w3+w4+8*u3*v+36*u2*v*w+36*u*v*w2+8*v*w3+24*u2*v2+60*u*v2*w+24*v2*w2+24*u*w3+24*v3*w+6*v4;
float a7 = u4+8*u3*w+24*u2*w2+24*u*w3+6*w4+6*u3*v+36*u2*v*w+60*u*v*w2+24*v*w3+12*u2*v2+36*u*v2*w+24*v2*w2+6*u*v3+8*v3*w+v4;
float a8 = 2*u*w3+w4;
float a9 = 2*v3*w+v4;
float a10 = 2*u*w3+w4+6*u*v*w2+6*v*w3+6*u*v2*w+12*v2*w2+2*u*v3+6*v3*w+v4;
float a11 = w4+2*v*w3;
vec3 p0 = tcPosition[0];
vec3 p1 = tcPosition[1];
vec3 p2 = tcPosition[2];
......@@ -27,15 +56,13 @@ void main()
vec3 p11 = tcPosition[11];
vec3 d0 = gl_TessCoord.x * p3;
vec3 d1 = gl_TessCoord.y * p6;
vec3 d2 = gl_TessCoord.z * p7;
vec4 pos = vec4((d0 + d1 + d2),1);
vec3 newPos= a0*p0+a1*p1+a2*p2+a3*p3+a4*p4+a5*p5+a6*p6+a7*p7+a8*p8+a9*p9+a10*p10+a11*p11;
vec4 pos = vec4((newPos),1);
tePatchDistance = gl_TessCoord.xyz;
teCamPosition = vec4(MV*pos).xyz;
gl_Position = MVP * pos;
teCamPosition = vec4(MV*pos).xyz;
gl_Position = MVP * pos;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment