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-08-28 23:22:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-08-28 23:22:46 +0400
commit841fe45df95cfbd1c5b21465656aabe4de911ae0 (patch)
tree46ae5ba059f1718c1c2a8bdf7f8653cdb5420c1b
parent7ba41a3c7cd674f2f8814960132c6fe64ded6262 (diff)
Cycles: change Gaussian subsurface scattering falloff to be more similar to
the Cubic falloff, see here for details. http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering
-rw-r--r--intern/cycles/kernel/closure/bssrdf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/closure/bssrdf.h b/intern/cycles/kernel/closure/bssrdf.h
index e5f26f25c41..d6f889f3285 100644
--- a/intern/cycles/kernel/closure/bssrdf.h
+++ b/intern/cycles/kernel/closure/bssrdf.h
@@ -50,7 +50,7 @@ __device float bssrdf_gaussian_eval(ShaderClosure *sc, float r)
{
/* integrate (2*pi*r * exp(-r*r/(2*v)))/(2*pi*v)) from 0 to Rm
* = 1 - exp(-Rm*Rm/(2*v)) */
- const float v = sc->data0;
+ const float v = sc->data0*sc->data0*(0.25f*0.25f);
const float Rm = sqrtf(v*GAUSS_TRUNCATE);
if(r >= Rm)
@@ -72,7 +72,7 @@ __device void bssrdf_gaussian_sample(ShaderClosure *sc, float xi, float *r, floa
/* xi = integrate (2*pi*r * exp(-r*r/(2*v)))/(2*pi*v)) = -exp(-r^2/(2*v))
* r = sqrt(-2*v*logf(xi)) */
- const float v = sc->data0;
+ const float v = sc->data0*sc->data0*(0.25f*0.25f);
const float Rm = sqrtf(v*GAUSS_TRUNCATE);
/* 1.0 - expf(-Rm*Rm/(2*v)) simplified */