by Julio Jerez » Thu Apr 21, 2011 5:10 pm
for rendering it all depend what you are doing.
for example terraing rendering if you devide into lots small peice you nay end up rending lots of meshes
and the will be slow on many newer GPU, usally batches of 10,000 or more triangles is better for terrain rendering.
I dot not whant to keep pushing or promoting teh Scene collision, but to my knowlege there are not alrogthen the is superior to the Scene collision.
The Scene collision is and AABB tree with tree rotation, Tree rotation make it otpimal in the same as a Red Black Tree balance a binary tree.
I use that in teh pass for tracing tracing light map for scene with several million faces, and nothing beat it.
a BSP perhaps but then BSPs are static and take too long to build.
you can do two thing to quick test this.
-the the algorthim from Newton amd copi you and impement for yorself for graphics.
or Use ast It by by deriving you own class from dgCollisionScene
and add you own proxy to contaion pointer to you graphics objects.
somethonk like
calss MyGraphicsmagaber: public dgCollisionScene
{
// and and entity
AddEntity (myEnt)
Removentity (myEnt)
Update();
FrusttrumCulling (* frutom Planes)
Update ()
}
andEnt and RemoveEnt are self explanatory
Update is the update function that you can call once in a while or at the veginong of each frame to improve the fitness, of the tree.
sometho liek this
void dgCollisionScene::Update()
{
for (dgList<dgNode*>::dgListNode* node = m_fitnessList.GetFirst(); node; node = node->GetNext()) {
ImproveNodeFitness (node->GetInfo());
}
SetCollisionBBox (m_rootNode->m_minBox, m_rootNode->m_maxBox);
}
in the function thet will get the obje to render, basically it is is a recursive traversal from the top testion if each box interse the AABB of the frustom
if it does and teh node had chider you tes teh chidrem, if it is a leve node they you can render it.
It should be very simple to implement, and it is way more effcweint than KDTree, BSP, Octrees, quadTree,
because it gove you the Dynamics behavieo meaning that you cna use for all type of Games, In door, out door, Open worlds, and all kind of objects.
I use this in newton 3, and I sue in teh pass for games like Battle zone,
in Netwon 3 test scene wit 40 and 50,000 objecty an dteh runtme impact is negleggible, only teh Braphase, teh collisoin and physic sie too slow.
See if you can use it, is is free for the taking.