Energy redistribution sample re-integration I'm implementing ERPT-style energy redistribution of primary samples within a pathtracer. Specifically, to improve the sampling of defocused areas.
The core algorithm does two things:

If sample luminance is higher than threshold, I redistribute the sample energy over many backwards fired rays. This is stored in a framebuffer. The result of this is super clean!

I also store all non-redistributed samples in a separate framebuffer.


My question is about how I should recombine these two framebuffers. Which probabilities should I be using? I've tried a variety of approaches but none of them have worked perfectly. I cannot just remove the samples-to-be-redistributed and sum the redistributed samples on top. This results in discontinuities. I think I need to be using a certain weighting.
An example scenario is as follows:
Pathtraced result I start with:

Take a selection of the samples to redistribute:

Redistributing these high intensity samples in separate framebuffer:

How can I re-combine the redistributed &amp; unredistributed results?
Any help would be appreciated!
It sounds like you yet have to adjust the importance function of the Markov Chain according to the way you assign paths to each of the two estimators, path tracing and ERPT.
If you think about it in the framework of MIS, you have two estimators with binary weights (according to your threshold). Now, the simplest (but inefficient) option to combine them would be to always run ERPT and path tracing for all paths, applying the weight to the splats only (this weighting is what I understand you do by separating them into different framebuffers).
In your case, however, you only enter the ERPT chain for the paths that you want to further explore, therefore you do not actually enter the chain in a stationary distribution proportional to the measurement contribution. This breaks ERPT, as the startup bias removal no longer works correctly. To fix it, you need to additionally account for your path selection strategy in the importance function such that it matches the initial distribution of paths entering ERPT: The MIS weight of the ERPT estimator needs to become a part of its targeted distribution, preventing energy from running off into paths that would never actually trigger an ERPT run. Thus, you should be able to make the startup bias removal work with your path selection strategy.