1
$\begingroup$

In the accepted answer for the question What is Importance Sampling?, in the example code there is this line:

// Accumulate the brdf attenuation
throughput = throughput * material->Eval(wi, wo, normal) / pdf;

If the PDF is between 0.0 and 1.0, the division will potentially increase the throughput. I do not think it makes sense. What am I missing?

$\endgroup$
2
  • $\begingroup$ Why do you think it should always decrease? $\endgroup$ Dec 9 '19 at 9:06
  • $\begingroup$ I don't know, it was just intuition. I don't think I really understand what it is suppose to represent $\endgroup$
    – madjack
    Dec 9 '19 at 9:08
2
$\begingroup$

Yes, throughput doesn't have to be in range [0, 1]. That's a reason why you have to use exposure settings, because for differente accumulation time, brightness of an image might differ. Nathan Reed described it in details here - https://computergraphics.stackexchange.com/a/10244/10129

Your final results and number of fireflies and bright surfaces, depends on PDF that you'll be using. By using Normal Distribution Function PDF, you'll get good results, because NDF is the most determining factor of BRDF shape. Relate to this blog post for details - https://schuttejoe.github.io/post/ggximportancesamplingpart1/


Back to throughput range. Assuming that you're sampling based on NDF, you'll get fireflies in case of having values in specific range, when light source is shining from very low angle and you're looking directly at the object. Therefore, your denominator might be much greater than nominator and result in small PDF causing fireflies:

$$ p_i(w_m, w_o) = \frac{D(w_m)(w_g \cdot w_i)}{4|w_g \cdot w_m|} $$

enter image description here

Since 2014, Heitz was working on BSDFs, presenting good results in same year by sampling visible normals [2]. In 2017, he published much simpler, faster and better paper, improving his method [3]. There are also 2015 and 2016 papers in related field, but I haven't read them, but it might be beneficial if you're interested in BSDF. I would recommend checking his first 2014's work (1) where he explains physical assumption on which BRDF is based. It's worth knowing, what NDF and Geometry Shadowing exactly means in BRDF.

Also, there is a lot of good reading in pbrt book, especially:


(1) Eric Heitz - Understanding the Masking-Shadowing Functionin Microfacet-Based BRDFs http://jcgt.org/published/0003/02/03/paper.pdf

(2) Eric Heitz, Eugene d’Eon - Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals https://hal.inria.fr/hal-00996995v1/document

(3) Eric Heitz - A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals https://hal.archives-ouvertes.fr/hal-01509746/document

$\endgroup$
0
$\begingroup$

I have a similar question currently posted, so take the following with a grain of salt.

Throughput does not need to be smaller than 1. BRDF only needs to be non negative and to integrate to less than 1 (conservation of energy / albedo) over the hemisphere. It can be arbitrarily large - e.g. in the case of a mirror.

The pdf should approximate the BRDF to reduce variance. However, unless it is always larger than the BRDF, the throughput will be larger than 1 and should be able to reach infinity.

BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi)

$\endgroup$
17
  • $\begingroup$ BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi) why? $\endgroup$
    – lightxbulb
    May 7 '20 at 9:37
  • $\begingroup$ @lightxbulb, that is more or less the definition of Brdf. E.g. a Diffuse brdf is a constant, non negative, (obviously)reciprocal function. Using the functions of the OPs referenced question, that's what it would look like. People have a tendency to fold terms together to avoid repeated computation, which is confusing to beginners trying to understand path tracing from the underlying physics. $\endgroup$
    – arctiq
    May 8 '20 at 10:59
  • 1
    $\begingroup$ Where did the dot pop out from? $\endgroup$
    – lightxbulb
    May 8 '20 at 11:33
  • $\begingroup$ @lightxbulb, in the definition of BRDF, there is a "normalizing" (normal direction) term $1 / \cos \theta_i$, which is the angle between the normal and the incomming $w_i$. When $n$ and $w_i$ have unit length, the $\cos \theta_i = \ w_i \cdot normal$, because $a \cdot b \equiv |a| \times |b| \times \cos \theta$, where $\theta$ is the angle between $a$ and $b$. Makes sence? $\endgroup$
    – arctiq
    May 8 '20 at 12:59
  • $\begingroup$ Can you link the definition of BRDF that you are citing? $\endgroup$
    – lightxbulb
    May 8 '20 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.