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
@lisyarus Sure. I guess I meant that if you add them one by one then they will mostly affect in a small radius. If there are many you can't maybe add them all at once so the faraway things will be correct after a while anyway. It will already have converged with 36 out of the 40 so getting those last 4 ones correct quickly might not be important.
@lisyarus Maybe take all voxels close to a change, reset their history and do more samples there for one or two frames.
@lisyarus But I know about the issue. A mesh far away with small emissive triangles can still influence if there are MANY small emissive triangles. So only caring about large triangles can mess you up, as an example.
@lisyarus tl;dr: If there are many new cubes they can affect faraway, but you can't place many quickly. Spend more time close-by and faraway is ok to be slower, given how little you can edit per frame.