Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
let chunk_size = textureDimensions(tile_data, 0);
let tile_uv = in.uv * vec2<f32>(chunk_size);
var tile_coord = clamp(vec2<u32>(floor(tile_uv)), vec2<u32>(0), chunk_size - 1);
let local_uv = tile_uv - vec2<f32>(tile_coord);
tile_coord.y = chunk_size.y - 1 - tile_coord.y;

let tile = get_tile_data(tile_coord);
Expand All @@ -44,7 +45,6 @@ fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
discard;
}

let local_uv = fract(tile_uv);
let tex_color = textureSample(tileset, tileset_sampler, local_uv, tile.tileset_index);
let final_color = tex_color * tile.color;

Expand All @@ -53,4 +53,4 @@ fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
}

return final_color;
}
}