Hi
I?m messing around with the best strategy to render using DX. Currently my thoughts go in direction of checking if at least one of the edges of the bounding box of mesh is contained in the Frustum volume. If that is the case, the complete mesh is rendered. It is not sophisticated procedure, but I think it is good enough for simple scenes.
Now, the question for those that has gone the same path? what other ?simple? render strategies have you implemented?

Regards,

Biterider
Posted on 2007-02-13 08:25:13 by Biterider
My strategy usually depends apon the size of the Mesh, since I use the concept of Mesh to encapsulate the World geometry as well as the objects which inhabit it.

I typically have 'major and minor' meshes.
The minor meshes usually support 'instancing', and as such, I just load them into a custom container that in turn owns a DX container... These meshes are things like 'Furniture' and 'Doors'.. stuff which you can interact with if it's in the same region as you.
The major meshes are typically 'chunks of World'.
I don't apply culling to the entire World - I apply it to Chunks of World.
I break the World mesh into smaller meshes in custom containers (preferably hierarchically), and then apply culling to each Chunk (again, preferably hierarchically).
Furthermore, I associate a list of minor meshes (or their instances) with each major mesh, and apply the culling in Major, Minor order..
If a chunk of World is not partially or fully visible, then neither are ANY of its contents.
For 'dynamic' (moveable) objects, these can be owned by more than one Chunk of World (in order to handle overlaps).. it's just a matter of inserting a reference into more than one List.
This begs the question - should objects track which sector they are in, or should sectors track which objects they contain? :P

Disregarding my current penchant for spatial subdivision algos, I suggest testing of a boundingsphere versus the frustum's planes as the first test.
It's not accurate, but its fast, and it errs on the side of caution.
Anything that fails this test is CERTAINLY not visible... and anything that passes it is POTENTIALLY visible, and may need further tests.
The reason I suggest Spheres is twofold : firstly, sphere tests == point tests, so its fast.. secondly, boundingspheres are accurate at any orientation of the mesh they contain, and so can quickly be transformed from one coordinate system to another if that becomes important.. boxes become very expensive when orientation matters.. we have to begin doing 8 point tests AND 6 plane tests per box AND transform all those between coord systems as required.. not that we can't perform 'OBB testing' as a SECONDARY test if we want to.. but we should be avoiding the intensive processing if/when/wherever we can.
Even if you were happy to merely implement Axially Aligned BoundingBoxes (AABB test), I would STILL suggest adding a BoundingSphere for primary cull testing.
Posted on 2007-02-13 23:06:46 by Homer
Biterider, Homer has already covered much stuff about rendering, so I suggest you reading his topics ^^
Posted on 2007-02-14 03:53:22 by ti_mo_n
I think 'Proximity Test' sounds nicer than 'Primary Test'.
I wish I'd thought of that before :P
Posted on 2007-02-14 04:26:06 by Homer