PDA

View Full Version : Dynamic No of Out Vertices Tessellation Control



GingerBread
03-22-2012, 12:10 PM
Hi all,
Is there anyway I can setup the out vertices with uniforms(dynamically) in Tessellation Control Shader?


layout(vertices = 16) out;

Thanks and Regards,

Alfonse Reinheart
03-22-2012, 01:21 PM
That number represents the number of vertices you provide to the tessellator. It is fixed and inflexible. The amount of tessellation is not; it's controlled with a different value.

What are you doing that you need a varying patch size?

GingerBread
03-23-2012, 02:36 AM
Hey Alfonse,
I want to make my shaders in a way so that they can take a bezier patch of any order as I don't know beforehand the order of patch.

Thanks and Regards,

Alfonse Reinheart
03-23-2012, 04:06 AM
Well, you can either use a fixed order for your patches or stop using tessellation shaders and do something else to tessellate your patches.

GingerBread
03-23-2012, 04:24 AM
One more problem is there that the GL_MAX_PATCH_VERTICES has value 36477. But glPatchParameteri doesn't accept more than 30 vertices. It says "invalid value".

Alfonse Reinheart
03-23-2012, 12:53 PM
One more problem is there that the GL_MAX_PATCH_VERTICES has value 36477.

That's the value of the enumerator `GL_MAX_PATH_VERTICES`. You have to call `glGetIntegerv` with the enumerator to get the actual limit.

GingerBread
03-26-2012, 03:47 AM
Thanks Alfonse, my bad I was printing GL_MAX.. directly. Yes the limit is 32 when I print it with glGetIntegerv.

Thanks a lot. :)