Sign in to follow this  

Clipping multiple VBOs - terrain and LODs

This topic is 2790 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm creating terrain with LODs and I have few VBOs with 129x129 grid. I want to display only part of the VBO (depedned of location of the camera) but I have no idea how to run it good and fast. 1. Clipping by FS - checking distance from camera in VS, using it as input in FS - if too far/close -> discard. Disadvantage of this solution - using GPU per frame to check visibility and problems with holes between different LODs. 2. Clipping by GS - checking distance from camera in VS, using it as input in FS - if all vertices too far/close - not emiting triangle. Disadvatnage - like upper - processing all vertices to display only part of it. Holes much bigger. 3. Using different indexing - "dividing" into square sectors - 5x5 or 9x9 vertices. CPU will check visibility only 1 vertex (from 25 or 81). If visible - drawing only part of VBO (repeated for all sectors). Unfortunately using triangle strips reqieres to add few vertices at the end of the strip (empty but not visible triangle). It adds 129 triangles for 129x129 grid (<1%) but for 5x5 grid it's 5 triangles - 20% - application runs much slower if I draw all sectors (than drawing one big 129x129 sector). Any ideas? Maybe better to use hybrid method or sth totally different? Using vertex textures + special coordinates will be nice but in my situation it will be too complex to implement.

Share this post


Link to post
Share on other sites
I'd say that with today's hardware it would be best to just render the whole 129x129 patch.

You could check the patch's visibility on the CPU using its bounding box (not a single vertex since that might give incorrect results) and if visible choose your LOD.

Your LOD levels could then have an index buffer each, i.e. your coarsest LOD level would have in index buffer with 6 indices (2 triangles), the next one would have 24 indices (8 triangles) etc.

Today, using triangle strips doesn't result in much performance gain than using triangle soups (i.e. GL_TRIANGLES) - if any. Generally, using triangle soups with vertex cache optimization yields better results (and less hassle).

Share this post


Link to post
Share on other sites

This topic is 2790 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this