-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
move wgsl color operations from bevy_pbr to bevy_render #13209
move wgsl color operations from bevy_pbr to bevy_render #13209
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
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 agree with this reorganization: these aren't PBR specific.
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.
Improved organization. LGTM.
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.
This may help a bit when the rendering crates get reorganized.
Objective
bevy_pbr/utils.wgsl
shader file contains mathematical constants and color conversion functions. Both of those should be accessible without enablingbevy_pbr
feature. For example, tonemapping can be done in non pbr scenario, and it uses color conversion functions.Fixes #13207
Solution
bevy_pbr/src/render/utils.wgsl
intobevy_render/src/maths.wgsl
bevy_pbr/src/render/utils.wgsl
into new filebevy_render/src/color_operations.wgsl
Testing
Ran multiple examples, checked they are working:
Changelog
bevy_pbr/src/render/utils.wgsl
intobevy_render/src/maths.wgsl
bevy_pbr/src/render/utils.wgsl
into new filebevy_render/src/color_operations.wgsl
Migration Guide
In user's shader code replace usage of mathematical constants from
bevy_pbr::utils
to the usage of the same constants frombevy_render::maths
.