Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-04 02:39:17 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-04 02:39:17 +0400
commitb314209356288c3768faa1d7fbd7b1bf9d179a7a (patch)
tree2fafde8bdccff99e294acb34dbca90605e2e5327 /intern/cycles/kernel/shaders/node_subsurface_scattering.osl
parent9467d9940583d6c3a2e1b83f854453da9e64fdd7 (diff)
Cycles: add a sharpness input to the Cubic SSS falloff. When set to 1 this will
give a result more similar to the Compatible falloff option. The scale is x2 though to keep the perceived scatter radius roughly the same while changing the sharpness. Difference with compatible will be mainly on non-flat geometry.
Diffstat (limited to 'intern/cycles/kernel/shaders/node_subsurface_scattering.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_subsurface_scattering.osl9
1 files changed, 5 insertions, 4 deletions
diff --git a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
index 18864118172..5c1d1be0ee7 100644
--- a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
+++ b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
@@ -20,14 +20,15 @@ shader node_subsurface_scattering(
color Color = 0.8,
float Scale = 1.0,
vector Radius = vector(0.1, 0.1, 0.1),
- float TextureBlur = 0.0, // XXX use
+ float TextureBlur = 0.0,
+ float Sharpness = 0.0,
string Falloff = "Cubic",
normal Normal = N,
output closure color BSSRDF = 0)
{
if(Falloff == "Gaussian")
- BSSRDF = Color * bssrdf_gaussian(N, Scale * Radius);
- else /* Cubic, hardcoded to compatible closure for now */
- BSSRDF = Color * bssrdf_cubic(N, Scale * Radius);
+ BSSRDF = Color * bssrdf_gaussian(N, Scale * Radius, TextureBlur);
+ else
+ BSSRDF = Color * bssrdf_cubic(N, Scale * Radius, TextureBlur, Sharpness);
}