Culling question

Started by
2 comments, last by MARS_999 20 years, 6 months ago
I am using GL_TRIANGLE_STRIP for my polygons and was wondering how can you get that to work with culling techniques? Let say the terrain is rotated left or right you will not be able to draw the strips from top to bottom if they are setup to draw left to right? Not sure I am making sense. Any help would be appreciated. Thanks
Advertisement
does your terrain look like this:
----------
----------
----------

or like this:
----------
.........|
----------
|.........
----------

ie: is it one big strip (fast) or a lot of small strips ("pointless optimization")? one would be painless to start and end the strip in the middle and the other would be a pain. also: objects should be small enough to be culled completely or not, i dont see it as efficient approach if culling requires to cut and reorganize your object.
f@dzhttp://festini.device-zero.de
Hello Trienco,
I am rendering a complete strip at a time.

------------

then next line

------------

So as I was saying I don''t see how this is going to work very well with culling? Strips don''t like to be broken apart from what I have seen.
thats not really a problem, as performance doesnt like to get a whole lot of drawelement calls when one would be enough ,-)

what would you change if it were single triangles? youd still have a lot of work to do, stuffing all the needed indices into a buffer and render them. with strips you would do the very same thing, remove all indices that belong to vertices outside the frustum (ie, remove some indices in the front and end of your index buffer). drawrangeelements (maybe other way round) is useful, but in the end all you would do is start with an offset into your indexarray and draw less primitives.

to speed that up you might want to group indices and will soon end up with a quadtree or at least 2d array of rectangular patches. then you would simply cull those with an easy sphere or box visibility test and send the indices belonging to this group.

not subdividing your terrain and treating it as one big chunk will make all this a little more work and culling single vertices or polygons is not really a good idea anyway.
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement