[Bf-blender-cvs] [d687293] cycles_disney_brdf: Better calculation of the Disney diffuse part

Pascal Schoen noreply at git.blender.org
Tue Jul 26 12:33:38 CEST 2016


Commit: d68729300ee557e90a8e7e4be6eb8ef98db80fe2
Author: Pascal Schoen
Date:   Tue Jul 26 12:23:13 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rBd68729300ee557e90a8e7e4be6eb8ef98db80fe2

Better calculation of the Disney diffuse part

Now the values for NdotL und NdotV are clamped to 0.0f for a better look
when using normal maps

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

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

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

diff --git a/intern/cycles/kernel/closure/bsdf_disney_diffuse.h b/intern/cycles/kernel/closure/bsdf_disney_diffuse.h
index 463fcf3..ac5032f 100644
--- a/intern/cycles/kernel/closure/bsdf_disney_diffuse.h
+++ b/intern/cycles/kernel/closure/bsdf_disney_diffuse.h
@@ -40,8 +40,8 @@ CCL_NAMESPACE_BEGIN
 ccl_device float3 calculate_disney_diffuse_brdf(const ShaderClosure *sc,
 	float3 N, float3 V, float3 L, float3 H, float *pdf)
 {
-	float NdotL = dot(N, L);
-	float NdotV = dot(N, V);
+	float NdotL = max(dot(N, L), 0.0f);
+	float NdotV = max(dot(N, V), 0.0f);
 
     if (NdotL < 0 || NdotV < 0) {
         *pdf = 0.0f;




More information about the Bf-blender-cvs mailing list