Efficient methods to deal with dynamic object culling?

Started by
5 comments, last by eq 18 years, 6 months ago
So I'm a little new to 3D graphics and techniques, but have been assigned the task of writing the 3D engine for a school game. I have all year, and am still in the research phase at this point. Okay, here's my problem. I've learned a little about culling techniques at this point... simple BSP and octtree stuff. But, it seems like this is a lot more helpful with large amounts with static objects. The problem with my game is that every object in the world, moving or static, is constructed of blocks. These blocks begin their lives as parts of larger objects (block trees, block animals), but can all be broken down and moved around. I can't count on any objects in my game to remain static for the entire game. Now, I certainly don't want to refill the an oct tree every frame (right?)... it seems like it would be way to slow. To my advantage, blocks are easy to cull correctly... but just the fact that every object in my world is dynamic seems really daunting. Are there any good dynamic culling methods I should look into? Anyone have any ideas? Thanks :)
Advertisement
Generally dynamic objects are culled away using hierarchical tests. You set up a bounding volume around these objects, such as a bounding sphere or AABB or what-have-you. If the sphere is entirely out, you reject all sub components, if its entirely in, you accept all components. Only when the volume spans a culling plane (on the frustum) do you have to cull by each sub component. These again, can be tested initially with a bounding volume the same way. When you reach the most fine-grained level you will say that objects which are entirely outside the culling plane are culled and objects entirely inside or stradling the culling plane are to be drawn. This will result in some polygons that are not wholey visible, and indeed some that may not be visible at all (although you can take it down to individual triangles if you choose.) It then becomes the job of the Clipper to form these triangles to the frustum.

There are some very good articles at www.cbloom.com I suggest you read his articles if you have not already found them.

Good luck.

throw table_exception("(? ???)? ? ???");

Wow! This cbloom site is amazing. Thanks a bunch :D
As far as the culling goes however, my problem is a little more general than that... I'm just confused as to how to cull entire objects, not how to partition straddling objects. All objects in my game are dynamic. Nothing at all can be counted on to stay where it is. In other words, I have no static objects to pre-compute a tree of any kind with... I'll keep looking into this cbloon site though.
But you are ensured that 99% of the time, 99% of your objects don't move more than some distance in a given span of time, right?

Then you could probably get away with a static object culling thingamabob as long as you can effectively remove and insert the occasional fast moving dynamic object.

Given that very few objects are likely to be moving at any given time, the most efficient structure is probably a dynamic AABB tree.

Unfortunately I've got 2 midterms tomorrow morning, so I hope you won't mind waiting 24 hours before I actually explain the tree structure, if you can't find anything out there.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
You don't neccessarily need a dynamic spatial partitioning of the scene.

If you the static partition route, you would pre-generate a spatial partition of your world based on the static world data (ie. terrain, temples whatever). In this way you can optimize your partitions to co-incide with occluders in the world and store precomputed neighbour visibility per partition.

You can then use the static partitions to insert your dynamic objects into.

A good technique to avoid re-insertion for every single object is for you to keep a cache of the last octree (or whatever spatial partition system you're using) leaf that an object was in. When the object moves, do a quick test against it's previously known leaf. If the object is not still in it's last leaf then perform a re-insert into the octree.
do unto others... and then run like hell.
Given that very few objects are likely to be moving at any given time, the most efficient structure is probably a dynamic AABB tree.[/qoute]
In this thread I supplied some executables and a brief explanation of my dynamic aabb tree implementation.

My 2c.

This topic is closed to new replies.

Advertisement