I have a little issue with the transparency sorting in my latest upload and came across this idea of layer-like transparency sorting. I know that transparencies are sorted based on the pivot of the object. That's similar to how a game engine sorts transparencies. But in Unity for example there's an additional system that works like a type of "lyer" based transparency called the render queue.
Basically each transparent object has an internal render queue index of 3000 (by default).
You can change the queue index per material or per shader, depending on what you want to do.
Transparent objects with the same queue index get sorted based on their pivot.
Queue indices work like layers, so queue index 3005 will always be on top of all transparencies with queue index 3000.
This could be really helpful for models where the transparency order is intended to be fix like in this model:
I'd like for example to sort transparencies as following:
- Table always as the lowest element
- animated fire particles above
- static fire fx topmost to hide the spawning of the animated particles
Currently the transparencies are re-sorting and look a bit weird if you view the model from top and from behind. But with this queue based approach it would probably only look weird if you view it from below the table and transparencies would stop clipping if you move the camera.
It's still a workaround to place the pivot very far away to force sorting but it would probably break some animation workflows.
Not sure how complicated it is to implement such a system and make it usable but it might help deal with complicated transparency settings
We're also using a lot of sorted transparencies for our game Shift Happens to prevent unintended clipping and it works great (but it's a 2.5D platformer, to be fair )