Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualJosh Klint

Posted 01 June 2013 - 07:15 PM

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?

#1Josh Klint

Posted 01 June 2013 - 07:14 PM

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?

PARTNERS