Cycles: Tweak Principled BSDF Subsurface parameters #110989

Merged
Lukas Stockner merged 9 commits from LukasStockner/blender:subsurface-principled into main 2023-09-13 02:45:40 +02:00

9 Commits

Author SHA1 Message Date
Lukas Stockner fe6b3960b4 Add TODO comment for guiding PDF 2023-09-13 02:29:44 +02:00
Lukas Stockner 96290387fe Merge remote-tracking branch 'origin/main' into subsurface-principled 2023-09-13 02:29:42 +02:00
Lukas Stockner 4c7c4a4281 Address review 2023-09-11 04:19:07 +02:00
Lukas Stockner ee7610be87 Merge branch 'main' into subsurface-principled 2023-09-11 04:17:48 +02:00
Lukas Stockner c9f2dd126b Bring back Subsurface IOR, remove Subsurface Color 2023-08-15 02:58:47 +02:00
Lukas Stockner 1794806b5e Avoid GGX darkening 2023-08-15 02:58:47 +02:00
Lukas Stockner e50bae796d Update logic for falling back to diffuse 2023-08-15 02:58:47 +02:00
Lukas Stockner d4b3d39dd6 Cycles: Implement refractive BSSRDF entry bounce
The existing random walk subsurface scattering code worked like this:
1. Perform lambertian diffuse transmission bounce into volume
2. Trace path until we hit the surface again
3. Perform lambertian diffuse transmission bounce out of volume

This has the advantage that unlike other approaches for handling the interface
(e.g. not doing anything by treating it as transparent), the appearance
of the BSSRDF converges to a classic diffuse BSDF as the radius goes to zero,
so we can easily e.g. swap it out for a diffuse BSDF for secondary bounces.
Also, it's very straightforward to implement, and doesn't need much storage
(which is important for GPU performance).

However, it also has downsides - for example, it's not particularly physically
plausible, and it leads to excessive white edges.

Therefore, this commit replaces the entry bounce with a GGX refraction bounce.

The exit bounce remains lambertian, because
a) This way the BSSRDF still converges to a lambertian BSDF for radius->0
b) This way we avoid having to store a bunch of extra data in the path state
c) In materials that are well-described by subsurface scattering models,
   the path will generally encounter many internal bounces. Therefore, the
   incoming distribution at the exit interface is basically diffuse already
   anyways, so the impact is much lower than for the entry bounce.
d) It looks good, and that's what really matters in the end ;)
2023-08-15 02:58:47 +02:00
Lukas Stockner 778652612e Cycles: Tweak Principled BSDF Subsurface parameters
Previously, the Principled BSDF used the Subsurface input to scale the radius.
When it was zero, it used a diffuse closure, otherwise a subsurface closure.

This sort of scaling input makes sense, but it should be specified in
distance units, rather than a 0..1 factor, so this commit changes the unit.

Additionally, it adds support for mixing diffuse and subsurface components.
This is part of e.g. the OpenPBR spec, and the logic behind it is to support
modeling e.g. dirt or paint on top of skin.

For typical materials, this will be either zero or one (like metallic or
transmission), but supporting fractional inputs makes sense for e.g.
smooth transitions at boundaries.
2023-08-15 02:58:47 +02:00