Skip to content

Instantly share code, notes, and snippets.

View JuanDiegoMontoya's full-sized avatar
🫖

Jake Ryan JuanDiegoMontoya

🫖
View GitHub Profile
@JuanDiegoMontoya
JuanDiegoMontoya / VoxelLit.cpp
Last active October 11, 2020 10:20
Flood fill (addition) in a voxel world. The code is ugly but should be somewhat self-explanatory.
// ref https://www.seedofandromeda.com/blogs/29-fast-flood-fill-lighting-in-a-blocky-voxel-game-pt-1
// wpos: world position
// nLight: new lighting value
// skipself: chunk updating thing
void ChunkManager::lightPropagateAdd(glm::ivec3 wpos, Light nLight, bool skipself)
{
// get existing light at the position
LightPtr L = GetLightPtr(wpos);
if (L)
{