Translucency sorting within one material

Hello! When using multiple static meshes that are transparent to a degree you can change the static meshes “sort order” in order to decide which mesh is in front and which mesh is not.
Here lies my problem:
In the game I’m making there are going to be hundreds of different item actors present at once, all of them using different meshes and different material instances.
In order to cut down on draw calls im using a secondary UV channel on the meshes of these objects in combination with a switch node (in the shader editor) to be able to use different colors and whatnot on different parts of one mesh, turning what would normally be - for example - two different static mesh components with 3 material instances each, into one static mesh with one material instance.
This works stunningly with standard opaque objects, but with transparent objects I haven’t managed to find a way to prioritize what part of the mesh is considered in front and what is considered behind. I’ve experimented with UV size and location, distance from object origin and similar small tweaks, but the results have been really mixed and I find it difficult to understand what the engine uses to determine what layer should be prioritized.
If anyone could help me understand how UE5 decides what to render then i might be able to work with that as I am making the static meshes myself.
Thanks in advance.

Not saying this will necessarily solve your problem, but I wanted to check if you’ve tried the various Lighting Modes for the material?

rendering order is determined by the vertex and raster order of the polygons. so you would have to reorder your vertices from back to front. or inside to outside depending on what blending you expect.

the other way is using OIT (order independant translucency), which is currently an experimental feature in 5.5.latest.

@Stephen.Phillips

Not saying this will necessarily solve your problem, but I wanted to check if you’ve tried the various Lighting Modes for the material?

I’ve tried them, they do not solve the problem. Thank you for the suggestion.

@glitchered

rendering order is determined by the vertex and raster order of the polygons. so you would have to reorder your vertices from back to front. or inside to outside depending on what blending you expect. The other way is using OIT (order independant translucency), which is currently an experimental feature in 5.5.latest.

From what I’ve gathered OIT is quite expensive, which would unfortunately defeat the purpose of using a UV-atlas as it’s for the sake of performance. But I can’t say if the performance drawback is greater/lesser/equal to the gain from the reduction in draw calls, so I can’t really say if it’s worth using.
Could you elaborate on what you meant with reordering the vertices from back to front/inside to outside?
Thank you for taking the time to answer.

you may have to test that. i can’t predict how much it impacts your performance.

i’ll spare you with the lenghty technical explanation. translucency sorting issues been ther for 2 decades. pretty sure you can google a tech paper on that.

In case anybody finds this while researching the same issue, here is the solution:

you would have to reorder your vertices from back to front. or inside to outside depending on what blending you expect.

@glitchered was indeed correct regarding reordering the vertices.
Every vertex created in your modelling software is given an index when created and it is this index that UE5 uses to prioritize rendering. As I’ve used blender that is the only software I know how to sort them manually in;

-------------------------- Edit mode → Mesh → Sort Elements --------------------------


Sorting them was a little finicky but not difficult once you get the hang of it.

Further reading on the different sorting modes: Sort Elements - Blender 4.4 Manual