Yaay, it works! Smth like radiosity GI, but on voxels. In essence I spawn 4 surfels in corners of each visible face, and run real-time MC irradiance integration on them assuming diffuse materials.

A lot can be done to improve convergence, but it's already fun to play with 🤩

Typically in path tracing the N-th sample gets blended to the total sum with a factor of 1/N. I can't do this here because the scene can change, so I use a fixed factor. Larger factor means too much noise, smaller factor means slower convergence. Are there any alternatives?
@lisyarus I guess most error is introduced where you edit, so can't you tag cells nearby where you edit as being recently edited and have that somehow forget history so to speak? They do affect faraway stuff too but not as noticeable. Just a guess!
@lisyarus Basically milk the fact that you have a structured representation where you can know what is close-by.

@breakin The problem is that it's really not that simple. E.g. when I add a bunch of light sources one by one, each of them only affects a few cells around, but together they form a strong light source that affects many more cells. But when adding one light block to an already existing large clump of lights, barely anything changes.

No idea how to deal with these things using simple "tagging" heuristics :)

@lisyarus @breakin if you had directional light sources, adding to a larger cluster would change things more pronouncedly - only light sources small in spatial or angular extent can form the sharpest shadow boundaries

occlusion is a complex issue, I feel one would have to check whether a change is in line of sight of a voxel and then check whether that influenced voxel is visible from other voxels ... and then you end up with a nested integral again like the rendering equation

@lisyarus @breakin though, once could use that to estimate the effects of a change - e.g. using a newly set block as a source of 'importons' and estimate to which parts of the scene changes could in theory percolate to, then focus on re-estimating lighting there or along parts touched by lights those importons also touch