fix: distinguish air vs solid non-visible tiles

Air (id=0) not in line of sight participates in depth fade (open space).
Solid terrain not visible is genuinely occluded — render black.
This commit is contained in:
2026-03-20 14:37:48 +00:00
parent 5c4725b4a0
commit b48459fceb
+4 -6
View File
@@ -66,7 +66,7 @@ impl TilemapChunkSpawner {
} }
pub const FIXTURE_ROW_OFFSET: u16 = 6; pub const FIXTURE_ROW_OFFSET: u16 = 6;
pub const LAYER_ALPHA: f32 = 50_f32 / 255_f32; pub const LAYER_ALPHA: f32 = 41_f32 / 255_f32;
fn tile_id_to_tileset_index(tile_id: u32) -> Option<u16> { fn tile_id_to_tileset_index(tile_id: u32) -> Option<u16> {
if tile_id == 0 { if tile_id == 0 {
@@ -157,14 +157,12 @@ fn populate_chunk_tiles(
let is_visible = is_tile_visible_at_z(t, z_index); let is_visible = is_tile_visible_at_z(t, z_index);
let tile_data = if is_visible { let tile_data = if is_visible {
tile_for_depth(tileset_idx, z_diff) tile_for_depth(tileset_idx, z_diff)
} else if t.id == 0 {
tile_for_depth(0, z_diff)
} else { } else {
TileData { TileData {
tileset_index: 0, tileset_index: 0,
color: Color::srgb( color: Color::BLACK,
133_f32 / 255_f32,
167_f32 / 255_f32,
178_f32 / 255_f32,
),
visible: true, visible: true,
} }
}; };