- Home /
Disable sorting on a transparent queue?
I've actually got a couple possible solutions to my problem, but can't find a way to make any of them work. Basically, here's the situation:
I'm making a game with a simple scene primarily composed of several layers of blended objects. I need to build a complex overlayed shape to go overtop these layers -- it's fairly unadorned and needs to look seamless. The way I intended to do this, and have almost working, is via a collection of simpler shapes that get placed overtop one another as the player drags their finger.
These shapes are outlined in geometry as what I wanted to do, was draw them using alpha blending, write to the depth buffer, then use depth testing to make the next shape cut out neatly against the previous one. This avoids a lot of asset complexity.
The problem is, I can't appear to do this. Since these objects end up in a transparent layer (and they need be after all the other transparent stuff) they get sorted back to front, so I can't use a ZTest of LEqual or Less. The ends of the objects blend overtop each other and it looks mess. If they just stayed in spawn order this would work fine, is there a way to tell it not to sort a particular queue?
Alternatively, I could just let them sort by distance and adjust their depths a bit to compensate, but in order to do that I'd need to use a ZTtest of Greater. That means I'd need to clear the depth buffer to a near value (rather than a far value) before rendering this queue. Is there a way to do that?
Your answer
Follow this Question
Related Questions
How to have sorting order/layers used when Z depth is the same? 1 Answer
Shader that renders fragment behind 0 Answers
RandFuncs.Shuffle question 0 Answers
How to sort get components? 3 Answers