<p>To remain unbiased, <strong>the PDF <span class="math-container">$p(x)$</span> in <span class="math-container">$\sum f(x) / p(x)$</span> should be the PDF of the actual sample distribution</strong>. That is, the only PDF you can use depends on how you get your samples.</p>
<p>So, for example (I didn't read the paper, I am just sharing one of the possible way I think feasible), you use ray marching and subdivide the ray into several bins before calculating the transmittance and local <span class="math-container">$\mu_t$</span>, and within the sampled bin, you resort to uniform sampling for simplicity. Since ray marching just approximates the continuous PDF with a discrete one, you might have the following sampling PDF:
<span class="math-container">$$
p(t_{\text{within-bin}} | k)p(k) = \frac{1}{\text{bin width}}\mu_t(t_k)T(t_k)/Z
$$</span>
Here we use <span class="math-container">$k$</span> to represent the k-th sampled bin. Therefore, if unbiasedness holds:</p>
<ul>
<li>Your sampling method should be sampling a bin first according to normalized <span class="math-container">$\mu_t(t)T(t)$</span>, which is <span class="math-container">$p(k)$</span> and within that bin, uniformly sampling the final distance value. Then your PDF should be <strong>exactly the same form</strong> (in the equation above) since this is defined by the sampling method.</li>
<li>Make sure your PDF is normalized. This is easy for inverse-transform sampling but may be hard for other method (that requires analytical integration to get <span class="math-container">$Z$</span>, the normalization factor).</li>
</ul>
<p>So even if you say this is <em>approximated</em>, it would work in a unbiased way if the rules are followed. The accuracy of approximation will only affect the convergence speed (zero-variance, if <span class="math-container">$f(x) = c\times p(x), c$</span> is a constant).</p>

CC BY-SA 4.0
2024-05-01T11:34:05.680Z
2024-05-01T11:34:05.680Z
Enigmatisms
<p>I'm currently trying some things with transmittance estimators in PBRT and I have implemented the following paper: <a href="https://dl.acm.org/doi/abs/10.1145/3450626.3459937" rel="nofollow noreferrer">Unbiased Ray-Marching Transmittance Estimator</a>. This method assumes that two points <span class="math-container">$x$</span> and <span class="math-container">$y$</span> are given.</p>
<p>In PBRT and tracking methods, a distance can be sampled analytically due to null-collisions and a homogenized medium (i.e. delta tracking). The pdf <span class="math-container">$p(t)$</span> for this distance <span class="math-container">$t$</span>, is known in a homogenized medium thanks to the <a href="https://cs.dartmouth.edu/%7Ewjarosz/publications/miller19null.html" rel="nofollow noreferrer">null-scattering path integral</a> formulated by Miller et al. This enabled the use of MIS in heterogeneous media, since the path pdf is analytically available.</p>
<p>In my integration scheme however, I do not know the pdf for the distance <span class="math-container">$t$</span>. I am aware of the following sampling scheme where the pdf of a distance <span class="math-container">$t$</span> is given by:</p>
<p><span class="math-container">$$ p(t) = \frac{dF(t)}{dt} = \frac{d}{dt}(1 - e^{-\tau(t)}) = \frac{d\tau(t)}{dt}T(t) = \mu_t(t)T(t)$$</span></p>
<p>Here <span class="math-container">$F(t) = 1 - T(t)$</span> is the CDF of sampled distances, <span class="math-container">$\tau(t)$</span> is the optical thickness a distance <span class="math-container">$t$</span> away from <span class="math-container">$x$</span> in the direction of <span class="math-container">$y$</span> and <span class="math-container">$T(t)$</span> is the transmittance. Finally <span class="math-container">$\mu_t(t)$</span> is the medium extinction at a distance <span class="math-container">$t$</span> from <span class="math-container">$x$</span> (see <a href="https://cs.dartmouth.edu/%7Ewjarosz/publications/novak18monte.html" rel="nofollow noreferrer">Monte Carlo methods for Volumetric Light Transport</a>).</p>
<p>Can I simply compute the transmittance for a given distance <span class="math-container">$t$</span> and use this (unbiased) transmittance value in the computation of the path pdf? I'm hesitant to do so since this value for transmittance is not the real value but an approximation.</p>

<sampling><importance-sampling><volumetric><pbrt><volume-rendering>
Distance sampling with unbiased transmittance estimators
Matthias K.
# Distance sampling with unbiased transmittance estimators

(Asked by: username_0 on 2024-04-29)

I'm currently trying some things with transmittance estimators in PBRT and I have implemented the following paper: [Unbiased Ray-Marching Transmittance Estimator](https://dl.acm.org/doi/abs/10.1145/3450626.3459937). This method assumes that two points $x$ and $y$ are given.

In PBRT and tracking methods, a distance can be sampled analytically due to null-collisions and a homogenized medium (i.e. delta tracking). The pdf $p(t)$ for this distance $t$, is known in a homogenized medium thanks to the [null-scattering path integral](https://cs.dartmouth.edu/%7Ewjarosz/publications/miller19null.html) formulated by Miller et al. This enabled the use of MIS in heterogeneous media, since the path pdf is analytically available.

In my integration scheme however, I do not know the pdf for the distance $t$. I am aware of the following sampling scheme where the pdf of a distance $t$ is given by:

$$ p(t) = \frac{dF(t)}{dt} = \frac{d}{dt}(1 - e^{-\tau(t)}) = \frac{d\tau(t)}{dt}T(t) = \mu\_t(t)T(t)$$

Here $F(t) = 1 - T(t)$ is the CDF of sampled distances, $\tau(t)$ is the optical thickness a distance $t$ away from $x$ in the direction of $y$ and $T(t)$ is the transmittance. Finally $\mu\_t(t)$ is the medium extinction at a distance $t$ from $x$ (see [Monte Carlo methods for Volumetric Light Transport](https://cs.dartmouth.edu/%7Ewjarosz/publications/novak18monte.html)).

Can I simply compute the transmittance for a given distance $t$ and use this (unbiased) transmittance value in the computation of the path pdf? I'm hesitant to do so since this value for transmittance is not the real value but an approximation.

**Tags:** sampling, importance-sampling, volumetric, pbrt, volume-rendering


---

## 1 answers

### Answer by username_1 on 2024-05-01. Score: 1

To remain unbiased, **the PDF $p(x)$ in $\sum f(x) / p(x)$ should be the PDF of the actual sample distribution**. That is, the only PDF you can use depends on how you get your samples.

So, for example (I didn't read the paper, I am just sharing one of the possible way I think feasible), you use ray marching and subdivide the ray into several bins before calculating the transmittance and local $\mu\_t$, and within the sampled bin, you resort to uniform sampling for simplicity. Since ray marching just approximates the continuous PDF with a discrete one, you might have the following sampling PDF:
$$
p(t\_{\text{within-bin}} | k)p(k) = \frac{1}{\text{bin width}}\mu\_t(t\_k)T(t\_k)/Z
$$
Here we use $k$ to represent the k-th sampled bin. Therefore, if unbiasedness holds:

* Your sampling method should be sampling a bin first according to normalized $\mu\_t(t)T(t)$, which is $p(k)$ and within that bin, uniformly sampling the final distance value. Then your PDF should be **exactly the same form** (in the equation above) since this is defined by the sampling method.
* Make sure your PDF is normalized. This is easy for inverse-transform sampling but may be hard for other method (that requires analytical integration to get $Z$, the normalization factor).

So even if you say this is *approximated*, it would work in a unbiased way if the rules are followed. The accuracy of approximation will only affect the convergence speed (zero-variance, if $f(x) = c\times p(x), c$ is a constant).


---

