-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Importing bevy_pbr::mesh_view_types imples defining MAX_DIRECTIONAL_LIGHTS #6799
Comments
This happens because of the Lights struct in mesh_view_types.wgsl. Almost all importers of this file are not actually using the Lights struct. For now, I think we should hard-code MAX_DIRECTIONAL_LIGHTS to always be added to all shader defines. Eventually, this will be fixed by #5703. |
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes #6799 - Fixes #6996 - Fixes #7375 - Supercedes #6997 - Supercedes #7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes #6799 - Fixes #6996 - Fixes #7375 - Supercedes #6997 - Supercedes #7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes #6799 - Fixes #6996 - Fixes #7375 - Supercedes #6997 - Supercedes #7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes #6799 - Fixes #6996 - Fixes #7375 - Supercedes #6997 - Supercedes #7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes #6799 - Fixes #6996 - Fixes #7375 - Supercedes #6997 - Supercedes #7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
# Objective - Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs - Fixes bevyengine#6799 - Fixes bevyengine#6996 - Fixes bevyengine#7375 - Supercedes bevyengine#6997 - Supercedes bevyengine#7380 ## Solution - The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it. - The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
As far as I can tell this is still not fixed. |
) fixes bevyengine#6799 We should be able to reuse the `Globals` or `View` shader struct definitions from anywhere (including third party plugins) without needing to worry about defining unrelated shader defs. Also we'd like to refactor these structs to not be repeatedly defined. Refactor both `Globals` and `View` into separate importable shaders. Use the imports throughout. Co-Authored-By: Torstein Grindvik <52322338+torsteingrindvik@users.noreply.github.com>
) fixes bevyengine#6799 We should be able to reuse the `Globals` or `View` shader struct definitions from anywhere (including third party plugins) without needing to worry about defining unrelated shader defs. Also we'd like to refactor these structs to not be repeatedly defined. Refactor both `Globals` and `View` into separate importable shaders. Use the imports throughout. Co-Authored-By: Torstein Grindvik <52322338+torsteingrindvik@users.noreply.github.com>
Bevy version
Main @
e954b8573
What you did
I did this in a shader:
Because I wanted the definition of the
Globals
struct to re-use in my own shader.What went wrong
Additional information
theories about what might be going wrong
Importing
bevy_pbr::mesh_view_types
implies that this value is defined.workarounds that you used
Globals
struct, but I would like to not repeat that.to my code and that works. But this feels like something I should not have to do.
The text was updated successfully, but these errors were encountered: