Skip to main content
gamedev.net
🔒 Locked

Rendering entity Management

Started by Unfadable Oct 19, 2005 at 12:20 PM 3 replies 600+ views
Original Post
Unfadable
Unfadable
Sorry for what is probably a noob question: But I have a list of entities and need to render them. I need links and info about managing them for rendering. Like high-level algorithms to cull entities that are not viewable. I'm familiar with AABB-frust tests, distance tests, etc, but it seems wasteful to perform this on every entity. I also know about ways to break up the scene into regions, but my entities move a lot, and could be big enough to span several regions. Thanks
hplus0603
hplus0603
If you have a few hundred entities, running the bounds-vs-view-frustum test per entity isn't that wasteful. It's certainly faster than actually drawing each entity!

When you get into the thousands, you want some spatial subdivision, such as a loose octree (google for that) where your entities go. You then traverse the octree with a frustum culler, which only visits the nodes that are within the frustum. This culls a lot of entities by just culling their parent nodes in the octree.

For the entities that move, they have to update their position in the tree before the render pass.
enum Bool { True, False, FileNotFound };
snk_kid
snk_kid
Another alternative is to arrange bounding volumes into a hierarchy of nested bounding volumes or what is known as a bounding volume hierarchy (BVH), it's a spatial data structure but it's not a spatial partitioning type like octrees etc. For visibility determination it is unnecessary to do exact determination so it's best to keep all geometry at leaves only and bounding volumes in both internal & leaf nodes. Large static geometry can be further subdivided with what ever spatial data structure you want.
_winterdyne_
_winterdyne_
Generally an octree is the best structure, but you can use a containing heirarchy as a fallback, organising your entity list into a cohesive scenegraph.

How this is done is a matter of preference, and will depend to some extent on the types of objects you're using (large terrain chunks / particle systems / standard object meshes):

You can ensure all geometry is only in leaf nodes (as snk_kid suggests).

Or you can allow entities to attach to any hierarchical point, and adjust bounding volumes accordingly.

Winterdyne Solutions Ltd is recruiting - this thread for details!
Unfadable
Unfadable
Cool, thanks guys.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.