terravisor/shaders/tessellation_ctrl.glsl

29 lines
1.0 KiB
Plaintext
Raw Normal View History

#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[];
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;
// 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
}
}