Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tessellation Trouble


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Josh Klint   Crossbones+   -  Reputation: 1349

Like
0Likes
Like

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?

Edited by Josh Klint, 01 June 2013 - 07:15 PM.

Build mobile games with native code

http://www.leadwerks.com


Sponsor:

#2 Josh Klint   Crossbones+   -  Reputation: 1349

Like
1Likes
Like

Posted 01 June 2013 - 08:02 PM

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


Build mobile games with native code

http://www.leadwerks.com





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS