Cycles: random walk subsurface scattering.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 21 Jan 2018 13:04:22 +0000 (14:04 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 9 Feb 2018 18:58:33 +0000 (19:58 +0100)
commit0df9b2c71517a98760a5e577f434d9d86e4e1910
treeeee5839a1e6408af8c0e1766f37e68a8aadfbfb2
parent3ab5ef7b4f34f110e4861096428b83b4f9b5efe9
Cycles: random walk subsurface scattering.

It is basically brute force volume scattering within the mesh, but part
of the SSS code for faster performance. The main difference with actual
volume scattering is that we assume the boundaries are diffuse and that
all lighting is coming through this boundary from outside the volume.

This gives much more accurate results for thin features and low density.
Some challenges remain however:

* Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help
  here, but it's unclear still how much it helps in real world cases.
* Due to this being a volumetric method, geometry like eyes or mouth can
  darken the skin on the outside. We may be able to reduce this effect,
  or users can compensate for it by reducing the scattering radius in
  such areas.
* Sharp corners are quite bright. This matches actual volume rendering
  and results in some other renderers, but maybe not so much real world
  objects.

Differential Revision: https://developer.blender.org/D3054
22 files changed:
intern/cycles/blender/blender_shader.cpp
intern/cycles/kernel/closure/bsdf.h
intern/cycles/kernel/closure/bssrdf.h
intern/cycles/kernel/closure/volume.h
intern/cycles/kernel/geom/geom_motion_triangle_intersect.h
intern/cycles/kernel/geom/geom_triangle_intersect.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_branched.h
intern/cycles/kernel/kernel_path_subsurface.h
intern/cycles/kernel/kernel_subsurface.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/kernel_volume.h
intern/cycles/kernel/osl/osl_bssrdf.cpp
intern/cycles/kernel/shaders/node_subsurface_scattering.osl
intern/cycles/kernel/split/kernel_subsurface_scatter.h
intern/cycles/kernel/svm/svm_closure.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/integrator.cpp
intern/cycles/render/nodes.cpp
intern/cycles/util/util_math_float3.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesrna/intern/rna_nodetree.c