Skip to content

Commit

Permalink
Update shader imports + renames
Browse files Browse the repository at this point in the history
  • Loading branch information
Indy2222 committed Jan 26, 2024
1 parent 5e2bba7 commit 334c237
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 4 additions & 2 deletions assets/shaders/bar.wgsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#import bevy_pbr::mesh_bindings mesh
#import bevy_pbr::mesh_functions mesh_position_local_to_clip
#import bevy_pbr::{
mesh_bindings::mesh,
mesh_functions::mesh_position_local_to_clip,
}

const BACKGROUND_COLOR = vec4<f32>(0., 0., 0., 0.75);
const FOREGROUND_COLOR = vec4<f32>(0.6, 1., 0.6, 0.75);
Expand Down
10 changes: 6 additions & 4 deletions assets/shaders/rally_point.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#import bevy_pbr::mesh_view_bindings globals
#import bevy_pbr::mesh_bindings mesh
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::{
forward_io::VertexOutput,
mesh_bindings::mesh,
mesh_view_bindings::globals,
}

struct CustomMaterial {
color: vec4<f32>,
Expand All @@ -23,7 +25,7 @@ const FADE: f32 = 3.;

@fragment
fn fragment(
in: MeshVertexOutput,
in: VertexOutput,
) -> @location(0) vec4<f32> {
let world_space_length: f32 = length(mesh.model[0].xyz);
let scaled_x: f32 = in.uv.x * world_space_length;
Expand Down
8 changes: 5 additions & 3 deletions assets/shaders/trail.wgsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#import bevy_pbr::mesh_view_bindings globals
#import bevy_pbr::mesh_vertex_output MeshVertexOutput
#import bevy_pbr::{
forward_io::VertexOutput,
mesh_view_bindings::globals,
}

const COLOR = vec4<f32>(1., 0.85, 0.1, 0.7);

Expand All @@ -8,7 +10,7 @@ var<uniform> start_time: f32;

@fragment
fn fragment(
in: MeshVertexOutput,
in: VertexOutput,
) -> @location(0) vec4<f32> {
var color = COLOR;
// Use max(0., ...) because the times are wrapping.
Expand Down

0 comments on commit 334c237

Please sign in to comment.