Archived

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

Solarbeam

How do I cull obscured polygons (with an octree)?

Recommended Posts

I have my octree set up, each node holding a list of polygons for rendering ease. Now, how do i check if a node is obscured by another node? Also, how do I check to see if each node is visible in the view frustrum?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,
You need to work out how to represent your view frustrum as a set of planes. Can''t really help you too much with that, as it depends a lot on how you''re going about things, but if you can boil each plane down to a normal and a point on the plane then it becomes a matter of simply testing each vertex of each octree cube against each plane (using something like:

(vertex-pointOnPlane) dot normal > 0

)
Keep the subtree if you can find any vertex of its volume cube that is on the correct side of all the view frustrum planes.
Otherwise cull it.

Can''t help you with the nodes-obscuring-nodes problem, but you might find it useful to search for "occlusion culling" algorithms.

-TC

Share this post


Link to post
Share on other sites
Check the thread "Building a PVS from OCtree" elswhere on this message board where i have answered and posted some code to test Octree/Quadtree nodes against the Fustrum as well as how to extract the Fustrum planes from a combined D3D Projection/View matrix.

On another note. I would like to jst comment on the reply above this one.You Can NOT simply test the points of the octree against the Fustrum planes.It is quite possible for all the points of a Large Node to OUTSIDE the Fustrum planes but the Node still intersect the Planes in some way.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The paper "LOD Visibility Culling and Occluder Synthesis" also uses octree''s for occlusion culling, check that and some other papers at http://www.lsi.upc.es/~andujar/

Share this post


Link to post
Share on other sites
Gazza,

But if you check to make sure that *all* points are on the same side of a plane, then it will work. If the frutsum is totally inside a node, then some of the node''s points will be on both sides of at least one plane. So run through the points until you get at least 1 on each side (IN or OUT).

Share this post


Link to post
Share on other sites