-
-
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
Regression - Unable to get globals.time in prepass shaders #10652
Comments
This PR will fix the issue #10667 In the mean time, you should be able to add this to your shader: #import bevy_render::globals::Globals
@group(0) @binding(1) var<uniform> globals: Globals; |
I encountered this recently in a vertex shader and got
Looking into it it seems that globals is only visible for the fragment shader? let mut entries = DynamicBindGroupLayoutEntries::new_with_indices(
ShaderStages::FRAGMENT, |
I'm having similar issues with my vertex shader, which uses globals.time to generation ocean waves. |
That's probably not the same issue but the resulting error message is similar. But the fix is already merged on main #12032 |
Bevy version
0.12.0
What you did
In a wgsl shader:
This worked in bevy 0.11.3 but since updating to 0.12 I cannot find a way to get the
globals.time
field.From my understanding, the globals field is accessible through the
bevy_pbr::mesh_view_bindings::globals
import for non-prepass shaders, and in thebevy_pbr::prepass_bindings::globals
version for prepass shaders.What went wrong
globals.time
in a prepass shader seems to be unusable in the 0.12 bevy update, and I don't see any place it was moved to.The code above causes this error to be produced when compiling the shader:
Trying to use
bevy_pbr::mesh_view_bindings::globals
instead of the prepass version will crash the game, but this also happened in 0.11.3 so isn't part of the regression.Error for the
bevy_pbr::mesh_view_bindings::globals
crash if you are curious:Additional information
All fields but the
previous_view_proj
seem to have been removed from globals in this commit: a15d152#diff-c5f333aa41ce294f11ba384a74bdde77ec460f9483391f95afee8bc2fbc092b7.The text was updated successfully, but these errors were encountered: