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:
@@ -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<u16> {
|
||||
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,
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user