Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: More Tesselation Detail

  1. #1
    Newbie Newbie
    Join Date
    May 2014
    Posts
    2

    More Tesselation Detail

    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:

    Code :
    # 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:

    Code :
    # 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);
    }

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,141
    You can't add more details that way. Read the value of GL_MAX_TESS_GEN_LEVEL and you'll find out what is the limit of your hardware. For all known hardware it is "only" 64 by now. How have you achieved 80?

  3. #3
    Newbie Newbie
    Join Date
    May 2014
    Posts
    2
    Awesome thanks, I didn't really know what value it stopped tesselation, just took a stab at around 80ish

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •