Jump to content
  • Advertisement

Archived

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

dxantos

OpenGL Polygon sorting in openGL.

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

What is the fastest way for doing polygon sorting? I need this to sort polygons with alpha values in their textures. (for the solid ones, Zbuffer does fine).

Share this post


Link to post
Share on other sites
Advertisement
You might want to look into BSP trees. That way you can avoid using the Z buffer and get the correct results from your textures with alpha channels. It''s also fast.

That''s the way I do it anyway.

Share this post


Link to post
Share on other sites
If you just want a fast sort, you could use an implementation of the QuickSort algorithm to sort your polygons by Z-Value. There is a premade QuickSort in search.h called qsort(). BSP is also good, as it will correctly render the polygons from any viewpoint and uses next to no runtime computation.

------------------------------
#pragma twice


sharewaregames.20m.com

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!