diff options
| author | Micha White <botahamec@outlook.com> | 2022-10-17 22:45:31 -0400 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2022-10-17 22:45:31 -0400 |
| commit | e017b675d96c58924071ca6c739bbd7910a2b2b4 (patch) | |
| tree | d33397c25ab1f2ae4b2605324256cac8010c87eb /shaders/sprite.wgsl | |
| parent | 4574ec41259f42dceea4f770290d9975a8943db0 (diff) | |
Depth ordering
Diffstat (limited to 'shaders/sprite.wgsl')
| -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)); |
