Jump to content
  • Advertisement

Archived

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

fettodingo

Quadtrees

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

Im reading on how and what the quadtrees are, and I think I get it now. But I still dont understand some things. If I have a triangle that spans over 2 leaves, should I split the triangle or should I make the triangle a member to both? And how should I render the tree? If I where to render one triangle at the time from leaf to leaf, wouldnt it be very slow, since I have to switch textures and stuff all the time?!

Share this post


Link to post
Share on other sites
Advertisement
"If I have a triangle that spans over 2 leaves, should I split the triangle or should I make the triangle a member to both?"

if you split it, you get more tris to render. include the tri in BOTH leaves. when the tri is rendered, mark it, so there is no need to render it twice. also store an index, instead the triangle itself in the tree.

"And how should I render the tree? If I where to render one triangle at the time from leaf to leaf, wouldnt it be very slow, since I have to switch textures and stuff all the time?!"

you can "walk" the tree, push all visible tris into a buffer, then sort by texture and render the buffer.

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!