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

z_order_debug renders are cubes black #1411

Closed
mrk-its opened this issue Feb 7, 2021 · 1 comment · Fixed by #1419
Closed

z_order_debug renders are cubes black #1411

mrk-its opened this issue Feb 7, 2021 · 1 comment · Fixed by #1419

Comments

@mrk-its
Copy link
Member

mrk-its commented Feb 7, 2021

Bevy version
current master

Operating system & version

Ubuntu 20.04

What you did
Ran z_order_debug example

What you expected to happen

cubes should have different color depending on distance

What actually happened

All cubes are black

It seems this behavior is introduced by 7d065ee#diff-ee5fac51976cada9d968631feef5cb2bbfdbdb4c2057c08e1a1a2e743fa7f4ae

cc: @jamadazi

@DJMcNab
Copy link
Member

DJMcNab commented Feb 7, 2021

Reintroducing the square root does fix it. That is, converting:

let value = 1.0 - (visible_entity.order.0 - 10.0) / 7.0;
to

let value = 1.0 - (visible_entity.order.0.sqrt() - 10.0) / 7.0;

That being said, it doesn't seem like we should encourage relying on what order actually means

Since there is the possibility we'd want to change it again in the future (e.g. normalise it to a certain power of 2 to speed up comparisons, as a potential example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants