Hi, I am trying to add more detail to a tesselated grid, which has a heightmap applied to it.
Basically, changing the tesselation factor to greater than 80.0f doesn’t result in more visible detail.
Here are my two shaders:
Tesselation Control Shader:
# version 430
layout (vertices = 3) out;
uniform float tessLevel = 1000.0f; //Changing this to 1000.0f looks exactly the same as 80.0f
void main (){
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
gl_TessLevelOuter[0] = tessLevel;
gl_TessLevelOuter[1] = tessLevel;
gl_TessLevelOuter[2] = tessLevel;
gl_TessLevelInner[0] = tessLevel;
}
Tesselation Evaluation Shader:
# version 430
layout (location=0) uniform sampler2D heightMap;
layout (triangles, equal_spacing) in;
uniform mat4 modelWorld;
void main (){
vec3 p0 = gl_in[0].gl_Position.xyz * gl_TessCoord.x;
vec3 p1 = gl_in[1].gl_Position.xyz * gl_TessCoord.y;
vec3 p2 = gl_in[2].gl_Position.xyz * gl_TessCoord.z;
vec3 position = p0 + p1 + p2;
float height = texture(heightMap, vec2(position.x/1024.0f, position.z/1024.0f)).x;
position.y += height * 200;
gl_Position = modelWorld * vec4(position, 1.0f);
}