How can I change the tesselation leveln during runtime?
My only idea is to create a bufferobject with only one variable, which I have to pass through... Are there any better solutions?
I have a tesselation control shader file which works fine:
[...]
void main()
{
if(gl_InvocationID==0)
{
gl_TessLevelInner[0]= 5.0;
gl_TessLevelOuter[0]=5.0;
gl_TessLevelOuter[1]=5.0;
gl_TessLevelOuter[2]=5.0;
}
gl_out[gl_InvocationID].gl_Position =gl_in[gl_InvocationID].gl_Position;
}
You can pass the tessellation values as uniforms or (as the values are constant for each draw call) bypass the tessellation control shader altogether. If no TCS is linked to your shader program, the values supplied with -
will be used instead. In this case the tessellation evaluation shader uses the values output from the vertex shader.