[Bf-blender-cvs] [a1f4821] master: Fix T42212: Singular reflection pass is incorrect in regular path tracer

Sergey Sharybin noreply at git.blender.org
Mon Jan 19 23:03:52 CET 2015


Commit: a1f4821b94b09572d1606e4268b88e62bd5dd1e7
Author: Sergey Sharybin
Date:   Tue Jan 20 03:00:34 2015 +0500
Branches: master
https://developer.blender.org/rBa1f4821b94b09572d1606e4268b88e62bd5dd1e7

Fix T42212: Singular reflection pass is incorrect in regular path tracer

Issue seems to be caused by not totally proper pdf and eval values for this
closure. Changed it so they reflect to ggx/beckmann reflection with roughness
set to 0, which is effectively the same as the sharp reflection.

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

M	intern/cycles/kernel/closure/bsdf_reflection.h
M	intern/cycles/kernel/closure/bsdf_refraction.h

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

diff --git a/intern/cycles/kernel/closure/bsdf_reflection.h b/intern/cycles/kernel/closure/bsdf_reflection.h
index 0baccdf..6b90236 100644
--- a/intern/cycles/kernel/closure/bsdf_reflection.h
+++ b/intern/cycles/kernel/closure/bsdf_reflection.h
@@ -70,8 +70,9 @@ ccl_device int bsdf_reflection_sample(const ShaderClosure *sc, float3 Ng, float3
 			*domega_in_dx = 2 * dot(N, dIdx) * N - dIdx;
 			*domega_in_dy = 2 * dot(N, dIdy) * N - dIdy;
 #endif
-			*pdf = 1;
-			*eval = make_float3(1, 1, 1);
+			/* Some high number for MIS. */
+			*pdf = 1e6f;
+			*eval = make_float3(1e6f, 1e6f, 1e6f);
 		}
 	}
 	return LABEL_REFLECT|LABEL_SINGULAR;
diff --git a/intern/cycles/kernel/closure/bsdf_refraction.h b/intern/cycles/kernel/closure/bsdf_refraction.h
index c4698b4..c96ac62 100644
--- a/intern/cycles/kernel/closure/bsdf_refraction.h
+++ b/intern/cycles/kernel/closure/bsdf_refraction.h
@@ -72,10 +72,11 @@ ccl_device int bsdf_refraction_sample(const ShaderClosure *sc, float3 Ng, float3
 		dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy,
 #endif
 		&inside);
-	
+
 	if(!inside) {
-		*pdf = 1.0f;
-		*eval = make_float3(1.0f, 1.0f, 1.0f);
+		/* Some high number for MIS. */
+		*pdf = 1e6f;
+		*eval = make_float3(1e6f, 1e6f, 1e6f);
 		*omega_in = T;
 #ifdef __RAY_DIFFERENTIALS__
 		*domega_in_dx = dTdx;




More information about the Bf-blender-cvs mailing list