2024-08-14 18:04:06 -04:00
|
|
|
#version 430
|
|
|
|
|
|
|
|
layout(vertices = 4) out; // Define the number of control points per patch (e.g., 4 for a quad)
|
|
|
|
|
2024-08-15 00:56:29 -04:00
|
|
|
in VertexData {
|
|
|
|
vec2 tex_coord;
|
|
|
|
} inData[];
|
|
|
|
|
|
|
|
out VertexData {
|
|
|
|
vec2 tex_coord;
|
|
|
|
} outData[];
|
|
|
|
|
2024-08-14 18:04:06 -04:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
// Pass through control points to the tessellation evaluation shader
|
|
|
|
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
2024-08-15 00:56:29 -04:00
|
|
|
outData[gl_InvocationID].tex_coord = inData[gl_InvocationID].tex_coord;
|
2024-08-14 18:04:06 -04:00
|
|
|
|
|
|
|
// Set the tessellation levels (outer and inner)
|
|
|
|
if (gl_InvocationID == 0) {
|
|
|
|
gl_TessLevelOuter[0] = 5.0; // Level of tessellation along one edge
|
|
|
|
gl_TessLevelOuter[1] = 5.0; // Level of tessellation along another edge
|
|
|
|
gl_TessLevelOuter[2] = 5.0; // Level of tessellation along the other edge
|
|
|
|
gl_TessLevelOuter[3] = 5.0; // Level of tessellation along the other edge
|
|
|
|
gl_TessLevelInner[0] = 5.0; // Level of tessellation for the inner part
|
|
|
|
gl_TessLevelInner[1] = 5.0; // Level of tessellation for the inner part
|
|
|
|
}
|
|
|
|
}
|