Sketchfab Forum

Feature Request: Layer-style transparency sorting

transparency
feature-request
3d

(Simon Kratz) #1

Hi there! :slight_smile:

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 :slight_smile:
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 :smiley: )


#2

A small aside: have you tried our new Additive blend mode yet?


(Simon Kratz) #3

Yes, the particles are set to additive but sadly the clipping on different angles still occurs.


(Stephomi) #4

@essimoon If both particles and head are in additive, you won't have any popping (no need to sort one depending of the another).

For the table, no current real solution except splitting the table in its own geometry for better pivot.

There used to be a bug to exploit by using double/single sided (single sided transparent material were always drawn after the double sided ones), but it has been fixed now.

A layering system can makes sense, the tricky part being the UI/UX (@mauricesvay).
It's kind of an advanced feature though, so probably won't be on top of our roadmap :slight_smile:.


(Simon Kratz) #5

Oh I see, then I'll try both additive! Thx @stephomi!
And yeah, definitely advanced , maybe some time in the future if it becomes a more prominent request :slight_smile: