Archived

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

dxantos

OpenGL Polygon sorting in openGL.

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
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