#Problems with Transparency | Unity Shader Graph
1 messages · Page 1 of 1 (latest)
That's just how transparency tends to be
Same in Blender if you set a material to alpha blend transparent
Isn't there a way to get around this? I don't like it, it's confusing
Depends
What kind of transparency should it have effectively? Currently it's not using it for anything
Well yeah because I wanted to show off the bug
I have a shader that uses alpha to make the parts of the terrain that are far from the camera dissapear with a dither effect
Dithered fading is used in particular to avoid this issue
Dithering works for opaque alpha clipped materials, so transparency is not needed
Not typically
Alright
Any mesh which is concave so that its geometry can overlap with itself from the camera's point of view would be at risk of issues, because the polygons are not depth sorted individually
Additionally transparent meshes are not sorted against each other per-pixel but per-object so it'll be problematic to have other transparent objects near big transparent meshes
Not to mention expensive for overdraw, so you'd prefer to avoid such cases even without these sorting issues
There are some alternatives, like writing to depth and clearing any other transparent materials behind it per-fragment, which fixes the sorting but prevents anythiing transparent from being seen through it
So no big transparent meshes and no transparent meshes that can overlap from the camera's point of view
And no small transparent objects near other big ones that could overlap
Basically avoid overlap at all costs
Transparent meshes can overlap from the camera's PoV, but they are only sorted by their origin's distance to camera so the bigger they are the more likely they'll "jump" in front of each other
Polygons within a mesh that overlap from the camera's PoV are problematic as we saw in the screenshot, so avoid non-convex transparent geometry
Another alternative is Order Independet Transparency, such as this implementation:
https://github.com/happy-turtle/oit-unity
But it is even more expensive than transparency alone, and this particular implementation may be a bit buggy too
There's more reasons than this why most modern games avoid transparency like the plague
They tend to use dithering and smudge it out with TAA
That's very informative