Skip to content

Commit

Permalink
Merge pull request #461 from st0rmbtw/expose_tile_storage_pos
Browse files Browse the repository at this point in the history
Expose the position of a tile in the storage
  • Loading branch information
StarArawn authored Dec 17, 2023
2 parents df4c416 + d12f301 commit e7f5eea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/render/shaders/tilemap_vertex.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,6 @@ fn vertex(vertex_input: VertexInput) -> MeshVertexOutput {
// out.uv = out.uv + 1e-5;
out.position = view.view_proj * mesh_data.world_position;
out.color = vertex_input.color;
out.storage_position = vec2<u32>(vertex_input.position.xy);
return out;
}
1 change: 1 addition & 0 deletions src/render/shaders/tilemap_vertex_output.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ struct MeshVertexOutput {
@location(0) uv: vec4<f32>,
@location(1) color: vec4<f32>,
@location(2) @interpolate(flat) tile_id: i32,
@location(3) storage_position: vec2<u32>,
}

0 comments on commit e7f5eea

Please sign in to comment.