I have a problem when using a custom shader with the opacity chunk in my project. The shader yields different results from different viewing angles, meaning the transparency is calculated correctly when viewed from the “left” and incorrect when viewed from the “right”.
The shader should make the mesh invisible above a certain height, with a falloff area where the shader goes from opaque to transparent. The parameters can be adjusted on the “legs” entity.
From left to right: Front view, correct/expected transparency viewed from “left”, incorrect transparency when viewed from “right”
The shader does not change the behaviour when I rotate the mesh, which makes me think that the error is independent from the coordinate system of the scene.
It’s a render order issue. As it’s one mesh, the engine renders the polygons in an undefined order so therefore the leg closest to the camera is rendered first, then the leg behind.
The best bet here is to have each leg as a separate mesh, that way the engine can work out which mesh is furthest away from the camera and render that one first.
I’m wondering if disabling ‘depth testing’ on the material would help but I can imagine there still would some issues on the areas where there is partial transparency.