mirror of
https://github.com/bevyengine/bevy
synced 2025-01-25 03:15:20 +00:00
e44b74fb6a
# Objective `GlobalsUniform` provides the current time to shaders, which is useful for animations. `UiMaterial` is an abstraction that makes it easier to write custom shaders for UI elements. This PR makes it possible to use the `GlobalsUniform` in `UiMaterial` shaders. ## Solution The `GlobalsUniform` is bound to `@group(0) @binding(1)`. It is accessible in shaders with: ```wgsl #import bevy_render::globals::Globals @group(0) @binding(1) var<uniform> globals: Globals; ``` --- ## Changelog Added `GlobalsUniform` in `UiMaterial` shaders ## Discussion Should I modify the existing ui_material example to showcase this? |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |