Translucency sorting issue.
Hello! 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 :(
Is there anything that could be done here?
asked Oct 06 '18 at 03:02 AM in Rendering
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here