From e017b675d96c58924071ca6c739bbd7910a2b2b4 Mon Sep 17 00:00:00 2001 From: Micha White Date: Mon, 17 Oct 2022 22:45:31 -0400 Subject: Depth ordering --- shaders/sprite.wgsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shaders/sprite.wgsl') 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, @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(position2d, 0.0, 1.0); + let position4d = vec4(position2d, instance.z_index, 1.0); let position = camera * position4d; let tex_coords = vec2(model.position[0] + 0.5, 1.0 - (model.position[1] + 0.5)); -- cgit v1.2.3