Author Topic: Quad Tessellation  (Read 7018 times)

0 Members and 1 Guest are viewing this topic.

Bludo

  • Zombie
  • *
  • Posts: 2
    • View Profile
Quad Tessellation
« on: March 15, 2016, 11:43:58 PM »
Hi,

I was hoping someone might be able to help me with an issue I've run into while trying to modify one of the existing tessellation samples.  I was attempting to use quad tessellation rather than triangles.  After making adjustments to the tessellation eval and control shaders, I was still running into an issue where the resulting geometry was skewed.

My suspicion is that I am unable to modify the GL_PATCH_VERTICES parameter inside of initialization to tell GL the proper number of vertices to use.  So before I put up the shader code (which is basic quad tessellation sample shader code), I thought I'd see if this seems like the source of the problem.  If so, is it possible to set the GL_PATCH_VERTICES parameter inside of GeeXLab, and if it is possible, how would it be done?  Thanks in advance for any help that anyone can provide.
« Last Edit: March 16, 2016, 12:10:25 AM by Bludo »


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2004
    • View Profile
    • Geeks3D.com
Re: Quad Tessellation
« Reply #1 on: March 16, 2016, 04:38:53 PM »
Let me look at the problem...

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2004
    • View Profile
    • Geeks3D.com
Re: Quad Tessellation
« Reply #2 on: March 16, 2016, 06:02:34 PM »
I added a new function in the gh_renderer lib to set the number of vertices per patch (GL_PATCH_VERTICES):
Code: [Select]
gh_renderer.set_num_patch_vertices(4)

Every group of 4 vertices of the input mesh is used as patch. All built-in meshes in GeeXLab are triangular meshes, so they won't be rendered properly. You have to build your own meshes using gh_mesh.create_v2() and gh_mesh.alloc_mesh_data(). I added a code sample in the host_api/gl-400-arb-tessellation-shader/ that shows how to build these kind of meshes and how to to quad tess.

Everything will be available in the next (beta) update asap!


Bludo

  • Zombie
  • *
  • Posts: 2
    • View Profile
Re: Quad Tessellation
« Reply #3 on: March 31, 2016, 05:02:46 AM »
That's great!  It sounds like that should resolve the issues perfectly.

I know these kinds of roll-outs take time, but I thought I'd see when you anticipate the next release.  I very much look forward to the opportunity to try it out.

Thank you so much for your help.

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2004
    • View Profile
    • Geeks3D.com
Re: Quad Tessellation
« Reply #4 on: April 01, 2016, 08:33:43 AM »
I should publish the Windows version very shortly...