From b48459fceb92618ff0913ed8e20917267c4eb9d4 Mon Sep 17 00:00:00 2001 From: popertots Date: Fri, 20 Mar 2026 14:37:48 +0000 Subject: [PATCH] fix: distinguish air vs solid non-visible tiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Air (id=0) not in line of sight participates in depth fade (open space). Solid terrain not visible is genuinely occluded — render black. --- src/world/tiles/tilemap_chunk.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/world/tiles/tilemap_chunk.rs b/src/world/tiles/tilemap_chunk.rs index 3bfffb8..6074dc5 100644 --- a/src/world/tiles/tilemap_chunk.rs +++ b/src/world/tiles/tilemap_chunk.rs @@ -66,7 +66,7 @@ impl TilemapChunkSpawner { } 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 { if tile_id == 0 { @@ -157,14 +157,12 @@ fn populate_chunk_tiles( let is_visible = is_tile_visible_at_z(t, z_index); let tile_data = if is_visible { tile_for_depth(tileset_idx, z_diff) + } else if t.id == 0 { + tile_for_depth(0, z_diff) } else { TileData { tileset_index: 0, - color: Color::srgb( - 133_f32 / 255_f32, - 167_f32 / 255_f32, - 178_f32 / 255_f32, - ), + color: Color::BLACK, visible: true, } };