Rastar Posted January 9, 2014 Share Posted January 9, 2014 I would like to tessellate quadrilateral patches. I guess this currently isn't possible because the API doesn't provide for a means to generate quads, and probably the patch parameter is hard-coded to three, as in glPatchParameteri(GL_PATCH_VERTICES, 3) ? Or is there a way? If not, would it be possible to extend the API to add quads (e.g. by adding Surface::AddQuad() ) and set the patch parameter accordingly? Quote Link to comment Share on other sites More sharing options...
Rastar Posted January 9, 2014 Author Share Posted January 9, 2014 Well, it seems I got this working by setting layout (vertices = 4) out; in the control shader and layout (quads) in; in the evaluation shader. Wasn't aware of those functions (still new to tessellation..). On the other hand, I'm only working with a four vertex/two triangle patch right now that I am going to instance so that the patches can be frustum culled. Don't now what would happen if you start with a mesh that has more quads/polygons, since the vertex order is probably determined by the triangle indices? EDIT: Nah, this doesn't work. Of course, it only controls the patch size handed to the evaluation shader (which can be different to the input patch size). Also, the glTessCoord are barycentric with respect to that patch. So back to square zero: Is there a way to submit patches of four to the shaders? Quote Link to comment Share on other sites More sharing options...
Rastar Posted January 9, 2014 Author Share Posted January 9, 2014 This tessellation stuff is really interesting. The screenshot below was done using a simple heightmap+normalmap+colormap from World Machine and a modified version of the tessellation_example material (and of course shadmar's skybox!) applied to a scaled plane of 32x32 tris. It doesn't look spectacular because those are simple textures, and it performs like **** because this is a single mesh with no culling and LODs (every triangle side has a tessellation factor of 256, so that's a lot of vertices!), but it shows that there's a lot of potential in it. As I wrote, I would prefer to start from quads since that's more natural for terrain patches, but with adaptive tessellation guided by viewer distance, terrain features and an optional tessellation map, this could be used to render large terrains at excellent framerates. 2 Quote Link to comment Share on other sites More sharing options...
Rastar Posted January 9, 2014 Author Share Posted January 9, 2014 Sorry guys, even if I risk boring you with my monologue... another screenshot. The heightmap resolution is too low for the foreground (4096 applied to 8000m) and the tessellation probably not optimal, so you see jaggies there, but I really like the crisp details in the background. But enough of this, I'll now have a look into optimizing the tessellation before I bother you again 2 Quote Link to comment Share on other sites More sharing options...
Letschki Posted January 10, 2014 Share Posted January 10, 2014 Not boring at all. Great pictures! I wish i had the time to use the new version. But at least i can read about it Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 10, 2014 Share Posted January 10, 2014 Coool!! Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.