diff options
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/sprite.wgsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shaders/sprite.wgsl b/shaders/sprite.wgsl index 43f494e..60b5773 100644 --- a/shaders/sprite.wgsl +++ b/shaders/sprite.wgsl @@ -13,7 +13,7 @@ struct InstanceInput { @location(4) texture_size: vec2<f32>, @location(5) texture_atlas_index: u32, @location(6) rotation: f32, - @location(7) z_layer: u32 + @location(7) z_index: f32, } struct VertexOutput { @@ -40,7 +40,7 @@ fn vs_main(model: VertexInput, instance: InstanceInput) -> VertexOutput { let position2d = scaled + instance.position; // camera stuff - let position4d = vec4<f32>(position2d, 0.0, 1.0); + let position4d = vec4<f32>(position2d, instance.z_index, 1.0); let position = camera * position4d; let tex_coords = vec2<f32>(model.position[0] + 0.5, 1.0 - (model.position[1] + 0.5)); |
