Tessellation Trouble

I’m trying to get some old tessellation code running, but my objects just disappear when I set the draw mode to GL_PATCHES. Here is my control shader:

#version 410

layout(vertices = 3) out;

in vec4 ctrl_position[];

out vec4 eval_position[];

void main()
    float TessLevelInner = 1.0;
    float TessLevelOuter = 1.0;
    if (gl_InvocationID == 0) {
        gl_TessLevelInner[0] = TessLevelInner;
        gl_TessLevelOuter[0] = TessLevelOuter;
        gl_TessLevelOuter[1] = TessLevelOuter;
        gl_TessLevelOuter[2] = TessLevelOuter;
    eval_position[gl_InvocationID] = ctrl_position[gl_InvocationID];

And my evaluation shader:

#version 400

layout(triangles, equal_spacing, ccw) in;

in vec4 eval_position[];

void main()
    gl_Position = (eval_position[0] * gl_TessCoord.x + eval_position[1] * gl_TessCoord.y + eval_position[2] * gl_TessCoord.z);

Do you see anything wrong?

When all else fails, make sure you are attaching your shader objects to your program. :stuck_out_tongue:

Have you set the patch size?

Yeah, I just wasn’t attaching the object.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.