<p>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.</p>
<p>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).</p>
<p>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.</p>

CC BY-SA 4.0
2020-11-04T11:42:53.337Z
2020-11-04T11:42:53.337Z
Tobias Zirr
<p>I'm implementing ERPT-style energy redistribution of primary samples within a pathtracer. Specifically, to improve the sampling of defocused areas.</p>
<p>The core algorithm does two things:</p>
<ul>
<li><p>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!</p>
</li>
<li><p>I also store all non-redistributed samples in a separate framebuffer.</p>
</li>
</ul>
<p>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.</p>
<p>An example scenario is as follows:</p>
<p>Pathtraced result I start with:
<a href="https://i.sstatic.net/NoPss.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NoPss.jpg" alt="enter image description here" /></a></p>
<p>Take a selection of the samples to redistribute:
<a href="https://i.sstatic.net/odXV8.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/odXV8.jpg" alt="enter image description here" /></a></p>
<p>Redistributing these high intensity samples in separate framebuffer:
<a href="https://i.sstatic.net/BsFVp.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BsFVp.jpg" alt="enter image description here" /></a></p>
<p>How can I re-combine the redistributed &amp; unredistributed results?</p>
<p>Any help would be appreciated!</p>

<rendering><pathtracing><monte-carlo>
Energy redistribution sample re-integration
zeno
# Energy redistribution sample re-integration

(Asked by: username_0 on 2020-11-03)

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:
[![enter image description here](https://i.sstatic.net/NoPss.jpg)](https://i.sstatic.net/NoPss.jpg)

Take a selection of the samples to redistribute:
[![enter image description here](https://i.sstatic.net/odXV8.jpg)](https://i.sstatic.net/odXV8.jpg)

Redistributing these high intensity samples in separate framebuffer:
[![enter image description here](https://i.sstatic.net/BsFVp.jpg)](https://i.sstatic.net/BsFVp.jpg)

How can I re-combine the redistributed & unredistributed results?

Any help would be appreciated!

**Tags:** rendering, pathtracing, monte-carlo


---

## 1 answers

### Answer by username_1 on 2020-11-04. Score: 2

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.


---

