datalurkur / Mountainhome

A detailed and intricate worldsim borrowing from the Dungeon Keeper-style dungeon-building mechanic
You're lookin' at it.
6 stars 2 forks source link

Implement a scene management algorithm #25

Closed StLoch closed 14 years ago

StLoch commented 14 years ago

The scene management algorithm is responsible for much of the speed associated with rendering a scene. It is responsible for deciding what will or will not be rendered. Though there are MANY ways to do this, we will be working towards an octree implementation initially.

Step 1: Get the scene keeping track of entities in the scene and have it just push them all off into the render queue without too much though. Step 2: Add a more intelligent system by attaching bounding boxes (axis aligned) to entities, then comparing these boxes to the rendering camera's frustum, only passing them to the render queue if there is an intersection or the box would be totally contained by the frustum. Step 3: Make an even smarter algorithm by attaching bounding boxes to nodes in the scene, which will be the sum of all of their children. Now we can start comparing nodes to the camera frustum and possible allow ourselves to skip over a large number of entities (if a node has 10000 entities, the node's bounding box represents the sum of all of their bounding boxes, and the node's bounding box is not within or intersecting with the rendering camera's frustum, we can safely skip all 10000 entities, saving us a LOT of work). Step 4: Implement an actual octree to do scene culling. This will work VERY similarly to step 3, except it will not rely on the scene's node structure (meaning it will still be effective even if every entity is attached directly to the root scene node).

datalurkur commented 14 years ago

Fairly sure steps 1 and 2 are finished. Brent, can you confirm?

StLoch commented 14 years ago

1, 2, AND 3, in fact :D

datalurkur commented 14 years ago

New ticket for Octree implementation.

datalurkur commented 14 years ago

Closing this in deference to the Octree ticket, since that's the only part left.