Jump to content
  • Advertisement

Archived

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

ruellm

When to render in a quadtree ?

This topic is 5222 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

Guyz, How do u render quadtree? Do u only render it when u reach the leaf of the tree or u render it from the root down to the leaf?

Share this post


Link to post
Share on other sites
Advertisement
I personally do neither, although geometry is stored in the leafs.
What I do is recursively visit tree nodes until I hit a leaf, add the geometry in the leaf to a render list, continue tree traversal accumulating along the way.
I then render all visible geometry at once.
This method is also great for frame to frame coherence, you wont need to traverse the tree every single frame.

*edit* spelling.

[edited by - X-0ut on June 6, 2004 8:42:27 AM]

Share this post


Link to post
Share on other sites
the quadtree is just for performance optimization in all processes, which are operating in a fixed point of the 3 dimensions of your objectspace, such as frustum-culling, or collisiondetection. in frustum-culling you have for example the advantage, that you dont have to check every polygon, if it is in the viewingfrustum, bot check the leaves from top to bottom. that means, check the topmost four leaves. if one is completely in the frustum, you can render all polygons of the bottommost leaves under this leave. if the leave is particially between the planes, you go one, and check the 4 leaves under it. if the leave is not inbetween em, you dont have to check.

Share this post


Link to post
Share on other sites
I recurse through each node, adding the vertices into a dynamic buffer until it reaches a certain size (usually whatever the video card''s maximum primitive count is), then "flush" the buffer by rendering and resetting the offset.

An alternative method I''ve been working on, but that would only really work for static data, is to store a seperate vb for each node, recurse through them to get the nodes that are visibile, sort based on distance from the camera, apply some occlusion queries to elminate data that won''t be drawn (not really necessary unless you''re drawing a huge number of triangles), and then render front to back to optimize z-buffer usage.

Share this post


Link to post
Share on other sites
And, fooman, you''re simply describing one optimization to use when rendering quadtree / octree based data. It doesn''t necessarily dictate the best rendering order.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!