-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Sprites - keep color as 4 f32 #4361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a better solution than rounding. Color consistency and accuracy is better than the very small performance win.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this is the move. I'll hold off on merging just to give some space for dissenting opinions.
Ping @bevyengine/rendering-team for quick opinions on this :) |
This is the way to go IMO. |
Should If so, are |
This would probably be a good place to use FP16 in the future: gpuweb/gpuweb#658 |
This examples needs to use a bevy/crates/bevy_render/src/mesh/mesh/mod.rs Lines 74 to 76 in 63fee25
It could change there too, but I don't know if there was another reason there for it to be |
I prefer this fix over #4357 👍 An alternative would be passing the color using Regarding the vertex color, it makes sense to me to keep them compressed as |
I was originally one of the proponents of this idea to "compress" the color into a The current sprites renderer was designed with WebGL2 limitations in mind. If we really want performance gains for sprites rendering, we should look into having a fast path (using storage buffers and vertex pulling, or other such render techniqes) for platforms that aren't so limited, and leave the current implementation as a fallback for platforms that don't support it. That would be much more beneficial, than trying to "micro-optimize" the individual struct fields. |
Sounds like we have consensus! |
bors r+ |
# Objective - Fix #4356 ## Solution - Do not reduce the color of sprites to 4 u8
# Objective - Fixes inaccurate UI colors similar to this [Sprite color fix](#4361). ## Solution - Do not reduce the color of UI quads to 4 u8. Left is the displayed color. Right is the input color(#202225). | Before Fix | After Fix | |--------|--------| |![before](https://user-images.githubusercontent.com/2303421/163661335-7f970a43-1f8b-45af-ae0a-cd74424aa9fb.png)|![after](https://user-images.githubusercontent.com/2303421/163661342-d8d56c08-924b-4bce-8bc8-a8de85aadc97.png)|
# Objective - Fixes inaccurate UI colors similar to this [Sprite color fix](bevyengine#4361). ## Solution - Do not reduce the color of UI quads to 4 u8. Left is the displayed color. Right is the input color(#202225). | Before Fix | After Fix | |--------|--------| |![before](https://user-images.githubusercontent.com/2303421/163661335-7f970a43-1f8b-45af-ae0a-cd74424aa9fb.png)|![after](https://user-images.githubusercontent.com/2303421/163661342-d8d56c08-924b-4bce-8bc8-a8de85aadc97.png)|
# Objective - Fix bevyengine#4356 ## Solution - Do not reduce the color of sprites to 4 u8
# Objective - Fix bevyengine#4356 ## Solution - Do not reduce the color of sprites to 4 u8
# Objective - Fixes inaccurate UI colors similar to this [Sprite color fix](bevyengine#4361). ## Solution - Do not reduce the color of UI quads to 4 u8. Left is the displayed color. Right is the input color(#202225). | Before Fix | After Fix | |--------|--------| |![before](https://user-images.githubusercontent.com/2303421/163661335-7f970a43-1f8b-45af-ae0a-cd74424aa9fb.png)|![after](https://user-images.githubusercontent.com/2303421/163661342-d8d56c08-924b-4bce-8bc8-a8de85aadc97.png)|
Objective
Solution