Translucency sorting issue

I have an issue with my translucent crystals. As you can see on screenshots below, slightly to the left or slightly to the right, and weird sorting bugs appear.

I’ve tried to change sort priority type in project settings, see if it will improve anything. It fixes some bugs, but makes another appear under different angles.
Changing sorting priority on meshes does not help in this case. It only makes some crystals pop-out above all other.

One good solution that I found is to use Masked instead of Translucent in Blend Mode of the material. And then applying DitherTemporalAA node to the alpha texture.
But unfortunately, this blend mode does not support refraction. And crystals without refraction are lame :frowning:

Is there anything that could be done here?

Any sorting happens on per component basis, so if your crystals are one mesh, the order in which surfaces will appear solely depends on the order they were created in your content creation package and/or exported from it. Even if each crystal is a separate mesh(which you should not be doing anyway), the sorting will only grantee clean result if the meshes are spread out sufficiently.

What you can do, is render your mesh into custom depth pass and in its material, check if pixel depth roughly equals custom depth. If so, set opacity to 1, otherwise 0.

Hi! Thank you for your reply!

Crystals are separate meshes, combined in a blueprint, to make different formations.

I’ll check out custom depth pass, thanks you for the advice!

Right now I just fixed this by placing a small stone in-between those crystals, just to make a “cosmetic cover up” :smiley: