2 #extension GL_EXT_geometry_shader4: enable
4 uniform int NumSubdivisions;
8 /* num is the number of subdivisions
9 * can be anything between 1 and infinity
11 int num = NumSubdivisions;
13 float dt = 1. / float(num);
15 for (int i = 0; i <= num; i++) {
17 float omt2 = omt * omt;
18 float omt3 = omt * omt2;
22 omt3 * gl_PositionIn[0].xyzw +
23 3. * t * omt2 * gl_PositionIn[1].xyzw +
24 3. * t2 * omt * gl_PositionIn[2].xyzw +
25 t3 * gl_PositionIn[3].xyzw;
27 gl_FrontColor = vec4(1, 1, 1, 1);