Hello, I am new to GS in GLSL and would like to create a tessellated triangle and have it calculate the normals per vertex…
This is what I have so far…
void main()
{
float centerX, centerY;
for(int x = 0; x < 8; x++)
{
for(int y = 0; y < 8; y++)
{
centerX = -0.9 + 0.2 * x;
centerY = 0.9 - 0.2 * y;
gl_Position = gl_ModelViewProjectionMatrix * vec4(centerX - 0.1, centerY - 0.1, 0.0, 1);
EmitVertex();
gl_Position = gl_ModelViewProjectionMatrix * vec4(centerX, centerY + 0.1, 0.0, 1);
EmitVertex();
gl_Position = gl_ModelViewProjectionMatrix * vec4(centerX + 0.1, centerY - 0.1, 0.0, 1);
EmitVertex();
EndPrimitive();
}
}
}
but it only shows a grid of triangles… I want to take my current quad(2 triangles) and tessellate it to have more polygons to avoid texture tearing on hill sides ect…
Thanks!
BTW any tutorials on GLSL 1.2 version of this would be great as I can’t find any…