#Rendering bug, inverted depth

15 messages · Page 1 of 1 (latest)

empty crown
#

Does anybody know what can cause this bug? It's almost as if the depth is reversed somehow, and the parts far away render above the parts closer to the camera 🤔

livid ivy
#

Are you using AlphaMode::Blend in the terrain material?

empty crown
#

Yes

livid ivy
#

Use AlphaMode::Mask or AlphaMode::Opaque instead.

#

Blend screws with the depth

empty crown
#

Yep that's it, thanks!
Thankfully I didn't need the transparency anyway, I just imported it from a GLTF

#

Actually I might need it for other stuff. Should I make an issue if I find a reasonably sized reproducible example?

livid ivy
#

You should only use Blend for semitransparent objects (not for opaque objects or objects with textures with 100% opaque and 0% opaque regions)

It's a known issue, there isn't really a proper solution to it, there is an open issue though! https://github.com/bevyengine/bevy/issues/7054

#

TL;DR, this is a limitation of the typcial realtime rendering of tranparency.

empty crown
#

Does that mean that if I use AlphaMode::Blend, all parts of the texture need to have an alpha below 100%? Or can I still have parts of the texture be opaque and other parts transparent?

livid ivy
#

I don't know if that quote is accurate. I think there are plans to improve the situation

#

But yes. Consider using AlphaMode::Mask for textures like leaves or cut-out sprites.

livid ivy
#

Otherwise you might get glitches like the video you posted

empty crown
#

Got it, thanks for the help!