Display lists and Octrees

Started by
5 comments, last by tcs 23 years, 11 months ago
Just an idea. Would it be a good idea to compile every Octree node into a display list ? This would reduce the overhead to build the current frame, and reduce the overhead that occurs when passing all the faces from the Octree structure to the renderer...
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Advertisement
Be careful about your textures. I wouldn''t want to give up being able to render the pieces of geometry in texture order. For example, if you''ve got a room busted up into 8 sections by the octree and each section is using the same 4 textures you could swap textures 4 times or 32...
State change don''t seem to be so expensive...
Do you think I should sort the textures inside a node, o should I quicksort all textures (every frame) before I render them ?

Is a quicksort and all polys passed separate faster than a few state changes, display lists and no quicksort ?
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Actually, to correct you, texture state changes kill. That''s all there is to it. If you could waste 3 ms per frame just figuring out which poly''s to draw with each texture, that would be a heck of a lot better than doing it on the fly. Basically, textures are loaded to the most optimal areas of memory - usually the processor''s on-die cache for smaller textures. Whenever you switch textures, it has to go there and swap the new texture into that memory, causing a pretty bad performance loss. Definitely go for the loss in sorting and you will gain tenfold in rendering. Also, display lists don''t make an incredible performance increase, but mostly make rendering easier on us hardcore coders. Anyway, good luck in your quest.

Pythius
"The object of war is not to die for your country, but to make the other bastard die for his"
AHHHHH....

I have been wondering why a texture change with textures that have already been loaded into video card memory can still be expensive. Never understood.

Thanks =)
You don''t need to quicksort the polys. In each node of the octree, collect all the polys that use a certain texture/material. Also have an array of structures for all the textures in the environment. When you traverse the octree and hit a node, for each collection of polys add it to a linked list hanging off the texture''s structure used by the collection. Once you''ve traversed all the nodes you''ll have a list of poly collections hanging off each texture. Loop through the textures and render each poly collection. This doesn''t require any sorting, the minimal work is done once per poly collection, not per poly, and you only need to loop through your list of textures in the end. It also guarantees using each texture only once.

Each one of the poly collections could be compiled into a display list.

yes, this sounds like it works very easy, and it''s faster than the Octree. I can pass the liked list from node to node... yes, thanks!

I''m trying to get a demo up, but I still need a proper collision detection (better, a proper collision handling) and need to port my renderer to the Octree.

check http://glvelocity.demonews.com/ for the upcoming demo
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity

This topic is closed to new replies.

Advertisement