DepthSorted

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

DepthSorted

Post by Kjell »

:idea:

A DepthSorted checkbox on RenderMesh, so the triangles of a mesh are sorted in order of depth and then rendered back to front. Useful for foliage, hair and other non-flat meshes that use transparency.

K
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

as far as you know, is there anything in openGL that makes this automatically? Otherwise we should go with a fast sorting algorythm (I can code a quicksort... I guess I should code this anyway...)
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hmm,

There's GL_SAMPLE_ALPHA_TO_COVERAGE, but not sure what kind of performance hit that takes.

I believe a BSP Tree is generally used for this kind of sorting ( or depth peeling ) .. guess it depends on what you want to support ( intersecting triangles for example ).

K
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

You are right, those structures are usually way better for handling 3D spaces, but implementing those might take a lot of space and time. On the other side the QuickSort can be used in any generic sorting operation, and I think we already have something that needs a sort. Quicksort is sligthtly bigger in code size but is way faster when a greater number of object is present.
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
Post Reply