Archived

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

jtmerchant

Culling Out Unneeded Terrain Tutorial??

Recommended Posts

jtmerchant    126
I basically know nothing about frustrum culling or any of that, but I'm looking for a good tutorial on how to not render unneeded(sp?) triangles on my terrain. Thank you, Joshua Merchant PS:: I already have a terrain running that is loaded by a grayscale - heightmap. [edited by - jtmerchant on January 5, 2004 2:11:52 PM]

Share this post


Link to post
Share on other sites
Rule    122
What technique do you use to store and display your terrain. A triangle soup, vertex arrays, quadtree, maybe a LOD approach? Culling depends heavily on the way you handle your terrain data.

Share this post


Link to post
Share on other sites
jtmerchant    126
Well right now I just have a static vertex buffer that stores all of the vertices and a static index buffer that stores the order, and a simple one-dimentional array that stores the heights. This is quite simple and very much of a brute force method, so I can change it to the way a tutorial shows how to do it. One thing I don't want a link to is one of these articles here on GameDev as I have already looked at them, but I don't think they're very simple to understand.

EDIT:: I followed this tutorial. I changed most of the code, but the base idea is still there.

[edited by - jtmerchant on January 5, 2004 8:11:28 PM]

Share this post


Link to post
Share on other sites
Rule    122
Ok, first a link to a frustum culling tutorial (not specific to terrains): click
The tutorial also mentions a quadtree. This is a datastructure I recommend for a flat terrain. By flat I don''t mean no bumps or mountains but flat as in a heightmap, not a sphere or something. A quadtree is relatively easy to understand. You just start with one quad. That quad has four children. Each of those 4 children have 4 hildren and so on till you reach some limit. The most leaf nodes of the quadtree (the quads without children) contain triangles.
Well, that''s a very basic description but you get the idea. The advantage this gives you when it comes to frustum culling is that you don''t have to check for each triangle if it is visible or not. You start with the root quad. Is it visible? yes or no? If a certain quad is not visible then you don''t have to test any of it''s children because they will also be invisible. This can give quite a perfomance boost in most situations where you can''t see the entire terrain (that is most situations).
I''ll edit this post when I find some more tutorials. (And finish some school work ;-) )

Share this post


Link to post
Share on other sites