#include "Lighting.hpp" namespace MC::World::Generation::Lighting { void light_chunk(Chunk& chunk, ChunkNeighbors& _) { for (UInt x = 0; x < Chunk::Width; x++) { for (UInt z = 0; z < Chunk::Width; z++) { U8 current_light_exposure = LightSun; for (UInt y = Chunk::Height - 1; y != 0; y--) { auto& block = chunk.at(x, y, z); if (!block.type.is_translucent()) break; current_light_exposure = (Real)current_light_exposure * (1 - block.type.opacity()); block.light = current_light_exposure; } } } } }