Skip to content

Commit

Permalink
rename dt
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Jul 22, 2022
1 parent a5790ab commit 4a7d7bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/mesh_view_types.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ struct Globals {
// The time since startup in seconds
time: f32,
// The delta time of the previous frame in seconds
dt: f32,
delta_time: f32,
}
6 changes: 4 additions & 2 deletions crates/bevy_render/src/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ fn extract_time(mut commands: Commands, time: Extract<Res<Time>>) {
#[derive(Default, Clone, ExtractResource, Reflect, ShaderType)]
#[reflect(Resource)]
pub struct GlobalsUniform {
/// The time since startup in seconds
time: f32,
dt: f32,
/// The duration of the last frame in seconds
delta_time: f32,
}

/// The buffer containing the [`GlobalsUniform`]
Expand All @@ -50,7 +52,7 @@ fn prepare_globals_buffer(
) {
let buffer = globals_buffer.buffer.get_mut();
buffer.time = time.seconds_since_startup() as f32;
buffer.dt = time.delta_seconds();
buffer.delta_time = time.delta_seconds();

globals_buffer
.buffer
Expand Down

0 comments on commit 4a7d7bb

Please sign in to comment.