Translucency sorting issues on complex objects.

Hello!

I’m trying to make a set of laboratory glassware, and I ran into an issue with translucency on objects more complex than just a “cup”.

Here’s an example. A retort flask:

It’s a mesh with thickness, as you can see, if we enable x-ray:

This way I can apply single-sided glass material to it and have it looking like it’s not flat.

Anyway, after importing it to unreal, I ran into a set of issues. I tried a bunch of work-arounds, but none of them seem to fix it completely.

For the sake of demonstrating the issue, I set opacity of the glass material to 1, so its sorting problems can be seen better.

From left to right.
1 - Single mesh with UV’s and normal map.
2 - Single mesh, no UV’s, no normal map.
3 - Split into 3 meshes (outside, inside, neck on top), UVs and normal map.
4 - Split into 3 meshes and adjusted translucency sort priority (outside 0, inside 1, neck 2), UVs and normal map.

Looking closer at each one of them, there are a bunch of issues.

For number 1, which is a single mesh with UVs and normal map, some parts of the mesh disappear when looking at certain angles, and there is a UV seam at the bottom, that is ONLY visible when translucent material is applied:

For number 2, which is a single mesh with no UVs and no normal map, it also has “disappearing” issues, but slightly differently. But on top of that, it also has this artefact inside:

Number 3, which is 3 separate meshes with UVs and normal map, looks correct at certain angles, but then this happens when looking around it:
ezgif.com-gif-maker

Finally, number 4, which is 3 separate meshes with UVs, normal map, and translucency sort priority set manually. It looks correctly at all angles, doesn’t have seams or any artefacts. But since sort priority is non-default, that means that there is incorrect rendering when looking at it through another translucent object:

So… I exhausted all my ideas. I’m not a technical wizard, so I don’t know what else to do.
If anyone has any advice about how to tackle complex shapes with translucent materials, I’m all ears! Because every single flask or whatnot that has more than 1 hole or some sort of a bend in its shape gets totally screwed by translucency.

If you’re using UE5.1, enable Order Independent Transparency in the project settings. It will add a few instructions to the shader but, as far I saw, solved all sorting issues.
Other versions of unreal you can check the “Sort Triangles” option on a per mesh basis and get pretty good results.
You can fake transparency with environment mapping - an all time favorite of cheap real time VFX (you see it even in AAA next gen titles) but doesn’t look as convincing with crystal clear glass.
You can fake transparency with masked dithering and TAA. I’m not a fan because it’s quite prone to ghosting artifacts, but could work in some cases.

5 Likes

Apologies for late reply, I was busy recently…

Thank you for your advice!
I’m using ue 4.24. And unfortunately, I don’t see the “sort triangles” option anywhere. And even googling it didn’t give much result.
If it’s not too much bother, could you elaborate, please?

This works in 5.1. Thanks!!!

It in your scence actor

1 Like