Archived

This topic is now archived and is closed to further replies.

SoaringTortoise

View Culling... is it necessary?

Recommended Posts

I am rendering my terrain using a relatively simple culling technique - just render all terrain patches in a radius around the camera. This means that I''m not rendering the entire map, but also does mean that I''m rendering stuff that is behind the camera. Assuming that the terrain in a radius contains +/- 40,000 polygons it would mean that there are at least 20,000 polgyons that are being rendered that are outside the view (probably a bit more). Now, I''m rendering the entire lot with just 10 drawprimitive calls, and I have clipping enabled so... if I implement a proper view-culling algorythm that draws map patches according to visibility, I would draw fewer polygons, but at the same time I would be increasing the number of draw-primitive calls because instead of rendering strips, I would have to switch to rendering squares of terrain, and checking each square to see if it falls within the view frustrum. I did a view-frustrum culling routine a while back with my old Voodoo5 card and the performance gain was less than 4%. I remember it being a very lengthy process to implement and was severly disappointed at the performance gain. However, back then, my terrain was maxing out at 10,000 polygons compared to the current terrain of 40,000 so.... to your best guesstimate, do you reckon it''d be worth the hassle of implementing a view-frustrum culling routine, or does the clipping pretty much offset the need for proper culling? Learning to fly is easy, but as a tortoise, the landings are really rough.

Share this post


Link to post
Share on other sites
Implement proper culling, but don''t do it on a per-polygon basis. Instead, divide the terrain into a quad-tree and use it for culling. This gives you the option of increasing the far clip-plane while still drawing the same nr, or less, of polygons.
Ofcourse, you don''t have to increase the plane, where it would just make it run a lot faster, and make sure it works on cards with 16bit indexbuffers (like my old gf2)


--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Share this post


Link to post
Share on other sites
Hmmm... plus, if I want to get really sneaky, I can do terrain simplification for areas that are mostly the same height, which isn''t really possible for strips but becomes really easy with quad-patches.

Learning to fly is easy, but as a tortoise, the landings are really rough.

Share this post


Link to post
Share on other sites
OK, I''ve just finished converting the original strip-based method to a quad tree, with frustrum culling. It''s a lot easier to work with, but I lost about 3 fps for the same view depth. However, I also worked in a terrain simplification thingy that de-tesselates quads if the heights are not significantly different. With that turned on, I gained an average 15 fps (although it''s a fickle optimisation because it only works if the ground is flatish).

Still, the ease of working with regular quads is probably going to allow me to do some extra stuff that was really hard with strips so, all in all, a worthwhile use of the last few hours.

Learning to fly is easy, but as a tortoise, the landings are really rough.

Share this post


Link to post
Share on other sites
Genagen: I had something like that going. But then your map size becomes limited because of the vertex buffer size limit. This way I can go to practically any size map. If I increase the size of the patches to reduce the drawprims then I run into culling difficulties.

Chaucer: Yup. 40,000. Got some good hardware here and a lot of user-definable video settings. Can get 40 fps on a P 750mHz Geforce2Mx (my low-end test system) with the details all cranked to the lowest settings. Admitedly it looks nasty, but it''s still playable.

Drath: Not too worried about that. The flat-ground simplification only kicks in if all the points are roughly same height.

Learning to fly is easy, but as a tortoise, the landings are really rough.

Share this post


Link to post
Share on other sites