Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

quadtree optimized theory and question.

This topic is 5582 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First the theory: My old implementation for my quadtree-based terrain CLOD called UpdateQuadtree() and the Render() with UpdateQuadtree() being most expensive and Render() simply traversing thru the tree with a "Draw Tag" set to true. Is this a good method to render a quadtree-based terrain? I have one tree, so I just set a flag to true or false depending if it''s visible (basically a leaf). Second question; wouldn''t it be more efficient if I draw the leaves (visible terrain) WHILE I update the terrain? In other words, if it is a leaf, then draw it.? The next question is part of the theory thing: I''m wondering what is the best/traditional structure used for a quadtree-based CLOD engine? I have two classes, CGround and Quadtree, with Quadtree borrowing elements of CGround (which has all the geometry information). I definitely want a cleaner, easier, and more efficient way for these two crucial objects to interact. Should i be using inheritance here??? If not, then what? (a generalized/basic pseudocode/outline would help tremendously!).

Share this post


Link to post
Share on other sites
Advertisement

What I do is pre-build my whole quadtree (with a max-depth of around 5). And while I traverse my tree and come to a leaf, I render it directly. The rendering process only takes one traversal, but what I do need to do is clear a dirty bit every frame. But this doesn''t take up any time.

I use Geomipmapping for drawing my terrain, so I can render leaves while updating (traversing) the tree. If you use some other CLOD-algoritme this might be difficult (for instance a triangle might have to split after you have rendered it).

Hope this helps a bit.

Edo

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!