Coding Performance Question
Posted 04 February 2009 - 01:52 PM
Right now I have a quad map which says whether that section was drawn or not. So for each drawn quad I go through the vector of trees and have to render/check every one.
I am wondering if someone knows of a better way to handle this situation, I hope that I have explained enough.
Posted 04 February 2009 - 03:03 PM
Look into octrees and associated algos (like c-buffers) for controlling your visibility determinations. Also, take a read through: http://www.devmaster...s/graphics_alg/
Also, look here for a collection of papers:
Posted 04 February 2009 - 03:46 PM
The issue with that is that every draw call has some overhead. So often it's faster to draw 1000 polygons at once than to draw 5 times 100 polyons. There's a famous article by NVIDIA called Batch, Batch, Batch that explains the details.
Posted 04 February 2009 - 05:26 PM
It's C++ and std::vector, one for the quad tree mapping and one list of trees in each smallest quad section. The quads are determined to be visible or not when the terrain is drawn. So I only go through the list of trees for the valid quads. Since my camera is so free form, there are a lot of quads visible. One of the issues is just going through so many trees for each frame. Like I stated, it's a 20k list that I have to traverse each frame.
I was actually looking for some data structure ideas if there are any. This is all in DirectX.
Posted 04 February 2009 - 06:29 PM
You are doing visibility determination recursively, correct? I.e. checking visibility at the root node, then proceeding to its children only if it can't be trivially accepted or rejected, etc. I assume you are, though it's not 100% clear from what you've said. Anyway, when you accept a node at a high level you should be able to render all the trees in the node at once, without needing to traverse the whole list.
Posted 04 February 2009 - 08:16 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users