Page MenuHome

Adjust integration weights for random walk BSSRDF Path kernel.
ClosedPublic

Authored by Chris Eveleigh (whyohme) on Apr 10 2021, 7:03 PM.

Details

Summary

The disk BSSRDF kernels have a correction method to "adjust the pdf" when branched-path isn't being used, because in path tracing not all shader closures are evaluated on each sample - just one is selected.

The random walk kernel doesn't have such a correction, which results in dark renders when multiple BSSRDFs are included (mixed) in the shader.

This code change makes the "dark renders" problem .. go away. But I really don't know if this is the right way to achieve that - and if it is, whether this is the right way to code it. I have attempted to follow the pattern of the existing code and I've had a little go at understanding https://sites.fas.harvard.edu/~cs278/papers/veach.pdf. I think all my code does is reverse the weight applied to throughput in shader_bssrdf_pick in kernel_shader.h.

The attached blend

uses a checker texture to compare a single sss shader vs a mix shader with two sss shaders duplicated from the first.


The renders show that the problem goes away when branched path is used. It also goes away if both shaders are changed to one of the disk sss methods.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 13983
Build 13983: arc lint + arc unit

Event Timeline

Chris Eveleigh (whyohme) requested review of this revision.Apr 10 2021, 7:03 PM
Chris Eveleigh (whyohme) created this revision.
Chris Eveleigh (whyohme) edited the summary of this revision. (Show Details)
Chris Eveleigh (whyohme) edited the summary of this revision. (Show Details)
Chris Eveleigh (whyohme) edited the summary of this revision. (Show Details)

FYI, this behaviour is not seen in cycles-x. I've not finished reading the code so I'm not yet certain how it's been fixed.

This looks correct.

I rewrote the logic for this BSDF/BSSRDF weighting in Cycles X, that indeed seems to have fixed it there already.

This revision is now accepted and ready to land.May 11 2021, 10:24 PM