Hero Wavelength Sampling in PBRT-v4

268 views
Skip to first unread message

trevorda...@gmail.com

unread,
Sep 8, 2021, 8:12:24 PM9/8/21
to pbrt
I was going along with my toy project in PBRT-v4, which was implementing Hero Wavelength Sampling:

https://cgg.mff.cuni.cz/~wilkie/Website/EGSR_14.html

Which I saw as a good first project to add functionality, but it appears as if pbrt-v4 is already using Hero Wavelength natively:

1. src/pbrt/cpu/integrators.cp
void RayIntegrator::EvaluatePixelSample(Point2i pPixel, int sampleIndex, Sampler sampler, ScratchBuffer &scratchBuffer)       {
    // Sample wavelengths for the ray
    Float lu = sampler.Get1D();
    if (Options->disableWavelengthJitter)
        lu = 0.5;


2. src/pbrt/materials.h
PBRT_CPU_GPU BSDF GetBSDF(TextureEvaluator texEval, MaterialEvalContext ctx, SampledWavelengths &lambda, DielectricBxDF *bxdf) const {
    // Compute index of refraction for dielectric material
    Float sampledEta = eta(lambda[0]);
    if (!eta.template Is<ConstantSpectrum>())
        lambda.TerminateSecondary();

Does anyone know if this is the case?

trevorda...@gmail.com

unread,
Sep 10, 2021, 1:11:20 AM9/10/21
to pbrt
I realized that I had misremembered HWSS from my reading of it a few years ago, specifically:

"If the sampling is highly wave-

length dependent, such as in the extreme case of dispersion
via a Dirac interface, our method degenerates to using only
the hero wavelength. If, on the other hand, the shape of the
integrand only varies slightly with wavelength, as is the case
for most materials, the shifted techniques are still efficient
techniques, so that we obtain an almost equal weighting for
all bands and fully benefit from sampling multiple wave-
lengths."

So, terminating all secondary wavelengths on a dielectric is not, in fact, hero wavelength. There is a slight loss of information in deleting the secondary wavelengths. And it's probably a decent take-home exercise.

Matt Pharr

unread,
Sep 13, 2021, 1:52:47 PM9/13/21
to pb...@googlegroups.com
Yep! Here is what I think is an accurate summary:

- pbrt-v4 uses stratified wavelength clusters to represent point-sampled spectra (https://graphicsinterface.org/wp-content/uploads/gi1999-7.pdf).
- so e.g. at a perfectly specular interface with dispersion, all but the first wavelength are terminated
- it does use MIS over wavelengths in the subsurface scattering code (note that this sort of wavelength MIS was introduced by Radziszewski et al, "An improved technique for full spectral rendering.”, 2009.)
- and it also does MIS over wavelengths for chromatic volumetric media (Miller et al, “A null scattering path integral formulation of light transport, https://cs.dartmouth.edu/wjarosz/publications/miller19null.html.)

So I think the only thing missing is MIS over wavelengths for scattering at a rough dielectric boundary that is also dispersive…

Thanks,
Matt

-- 
You received this message because you are subscribed to the Google Groups "pbrt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pbrt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pbrt/66ec1fc5-d9ac-4f0d-b4df-c19daa78210cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages