#version 120 #extension GL_EXT_geometry_shader4: enable uniform float nbsquare; void main(void) { int i, j; float var1=0.0; for(j=0; j< nbsquare; j++) { var1=var1+0.05; for(i=0; i< gl_VerticesIn; i++) { gl_FrontColor = gl_FrontColorIn[i]; gl_TexCoord[0] = gl_TexCoordIn[i][0]; gl_Position = gl_PositionIn[i]; gl_Position.xyz += vec3(var1,0.0,0.0); EmitVertex(); } EndPrimitive(); } }