#Problems with Transparency | Unity Shader Graph

1 messages · Page 1 of 1 (latest)

near summit
#

There are no problems with the normals of the terrain model, and by simply replacing the default lit material with my test material, which is just the default lit unity shader graph with transparency turned on and no other changes made, I can see through the model.

Any ideas?

storm geyser
near summit
near summit
storm geyser
#

Depends
What kind of transparency should it have effectively? Currently it's not using it for anything

near summit
#

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

storm geyser
#

Dithered fading is used in particular to avoid this issue

#

Dithering works for opaque alpha clipped materials, so transparency is not needed

near summit
#

Yeah you're right

#

So what, I just can't use transparency on terrain?

storm geyser
#

Not typically

near summit
#

Alright

storm geyser
#

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

near summit
#

Wow

#

I didn't know transparency was such a big issue

storm geyser
#

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

near summit
#

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

storm geyser
#

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

near summit
#

That's very informative