[Bf-blender-cvs] [11633e89b6e] soc-2018-hair-shader: Take out two of Lukas's optimizations in the Bessel function

L. E. Segovia noreply at git.blender.org
Mon Jun 4 22:51:02 CEST 2018


Commit: 11633e89b6ead2fd497630f50c93863134fff74f
Author: L. E. Segovia
Date:   Mon Jun 4 20:11:35 2018 +0000
Branches: soc-2018-hair-shader
https://developer.blender.org/rB11633e89b6ead2fd497630f50c93863134fff74f

Take out two of Lukas's optimizations in the Bessel function

In case they're bringing in additional bugs

Ref T54796

===================================================================

M	intern/cycles/kernel/closure/bsdf_hair_principled.h

===================================================================

diff --git a/intern/cycles/kernel/closure/bsdf_hair_principled.h b/intern/cycles/kernel/closure/bsdf_hair_principled.h
index b63e7353772..b3802bd33f1 100644
--- a/intern/cycles/kernel/closure/bsdf_hair_principled.h
+++ b/intern/cycles/kernel/closure/bsdf_hair_principled.h
@@ -69,7 +69,7 @@ ccl_device_inline float logistic(float x, float s)
 ccl_device_inline float logistic_cdf(float x, float s)
 {
 	float arg = -x/s;
-	if(arg > 100.0f) return 0.0f;
+//	if(arg > 100.0f) return 0.0f;
 	return 1.0f / (1.0f + expf(arg));
 }
 
@@ -94,7 +94,7 @@ ccl_device_inline float bessel_I0(float x)
 ccl_device_inline float log_bessel_I0(float x)
 {
 	if (x > 12.0f) {
-		return x + 0.5f * (1.f / (8.0f * x) - M_LN_2PI_F - logf(x));
+		return x + 0.5f * (1.f / (8.0f * x) - M_LN_2PI_F - logf(1.f / x));
 	}
 	else {
 		return logf(bessel_I0(x));



More information about the Bf-blender-cvs mailing list