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?
That's what TAA does, with a typical value of making the new frame coming in be like the 10th frame seen so far. (Lerp from old to new 0.1 of the way)
TAA has neighborhood sampling to help know when to reject history and stop ghosting artifacts.
It's a hard problem doing integration on a dynamic source and knowing when your data is bad and needs to be restarted.

@demofox Yeah, I guess typically TAA has way more info about the samples than I do :(

I wonder if there's some research on this time-varying MC integration. All my googling leads to results on some quantum stuff 😅

Or maybe I should just accept the current solution and instead speed up convergence with reservoirs or smth like that

@lisyarus ddgi (rtxgi) had some things for this but I don't remember what. I really do think some fundamental research is waiting to be done here though. But yeah I dunno, maybe other people have better info :P
@lisyarus An improvement is to tweak the fixed factor based on the variance overtime https://youtu.be/MyTOGHqyquU?t=2027
DD2018: Tomasz Stachowiak - Stochastic all the things: raytracing in hybrid real-time rendering

YouTube
@fclem Oh, this is great, thank you!

@lisyarus @fclem There's an MIT released version of the algorithm here: https://github.com/Apress/ray-tracing-gems/blob/master/Ch_25_Hybrid_Rendering_for_Real-Time_Ray_Tracing/MultiscaleMeanEstimator.hlsl

One of the best adaptive hysteresis solutions that I've tried. (I had an experimental one that used moments, but chose to go with the battle hardened one that's in use on variety of EA projects)

ray-tracing-gems/Ch_25_Hybrid_Rendering_for_Real-Time_Ray_Tracing/MultiscaleMeanEstimator.hlsl at master · Apress/ray-tracing-gems

Source Code for "Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs" by Eric Haines and Tomas Akenine-Möller - Apress/ray-tracing-gems

GitHub
@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.
@lisyarus Sounds like a job for a Kalman filter. It’s a weighted average based on changing expectations.