Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Alpha rendering bug #4501

Closed
Niedzwiedzw opened this issue Apr 16, 2022 · 3 comments
Closed

3D Alpha rendering bug #4501

Niedzwiedzw opened this issue Apr 16, 2022 · 3 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@Niedzwiedzw
Copy link

Niedzwiedzw commented Apr 16, 2022

Bevy version

0.7

Operating system & version

Linux niedzwiedz-pc 5.15.28-1-MANJARO #1 SMP PREEMPT Fri Mar 11 14:12:57 UTC 2022 x86_64 GNU/Linux

What you did

https://github.com/Niedzwiedzw/bevy-alpha-rendering-bug-showcase

What you expected to happen

boxes shouldn't change the way they're overlapping based on camera position

What actually happened

https://github.com/Niedzwiedzw/bevy-alpha-rendering-bug-showcase

Additional information

Peek 2022-04-16 23-31

@Niedzwiedzw Niedzwiedzw added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 16, 2022
@superdump
Copy link
Contributor

You’re setting something that is using an opaque colour as transparent by setting AlphaMode::Blend. Transparent objects are rendered back to front ordered based on the model’s origin in view space. What you show in the clip is expected behaviour. Don’t mark opaque objects as transparent. Or actually use a transparent material on a transparent object and then there are known limitations to the current approach to transparency and an order-independent transparency method may help with that but there is not one implemented yet in bevy.

@superdump
Copy link
Contributor

See here for more details of the limitations of transparent rendering as it is: #2223

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Apr 17, 2022
@Niedzwiedzw
Copy link
Author

Niedzwiedzw commented Apr 17, 2022

ok that makes sense - I have managed to fix it in my - more complex case - where I noticed the problem by setting AlphaMode::Mask(0.5).

https://user-images.githubusercontent.com/22037927/163709426-cf449d30-cbb8-486c-b553-da52ba4ac1ec.mp4
as you can see textures CAN be transparent but they not always are. I think we can close this, but what we could do is add a partially-transparent texture example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants