[Bf-blender-cvs] [a8e32a86e5e] upstream_cycles_texture_cache: Cycles: more accurate differential approximation for glossy bounces

Stefan Werner noreply at git.blender.org
Wed Jun 27 14:05:02 CEST 2018


Commit: a8e32a86e5ec2fd2608b2757916ba6b5c7c2860b
Author: Stefan Werner
Date:   Fri Jul 28 15:09:58 2017 +0200
Branches: upstream_cycles_texture_cache
https://developer.blender.org/rBa8e32a86e5ec2fd2608b2757916ba6b5c7c2860b

Cycles: more accurate differential approximation for glossy bounces

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

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

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

diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 32af606d450..c9729fbc32e 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -725,8 +725,9 @@ ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg, const ShaderClosure
 #ifdef __RAY_DIFFERENTIALS__
 				*domega_in_dx = dTdx;
 				*domega_in_dy = dTdy;
-				*domega_in_dx *= 10.0f;
-				*domega_in_dy *= 10.0f;
+				const float softness = min(alpha_x, alpha_y) * 10.0f;
+				*domega_in_dx *= (1.0f + softness);
+				*domega_in_dy *= (1.0f + softness);
 #endif
 
 				if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) {
@@ -1103,8 +1104,9 @@ ccl_device int bsdf_microfacet_beckmann_sample(KernelGlobals *kg, const ShaderCl
 #ifdef __RAY_DIFFERENTIALS__
 				*domega_in_dx = dTdx;
 				*domega_in_dy = dTdy;
-				*domega_in_dx *= 10;
-				*domega_in_dy *= 10;
+				const float softness = min(alpha_x, alpha_y) * 10.0f;
+				*domega_in_dx *= (1.0f + softness);
+				*domega_in_dy *= (1.0f + softness);
 #endif
 
 				if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) {



More information about the Bf-blender-cvs mailing list