[Bf-blender-cvs] [a3c13fa] master: Cycles: Remove confusing labels usage in hair BSDF

Sergey Sharybin noreply at git.blender.org
Fri Jan 30 11:13:54 CET 2015


Commit: a3c13fa9e80fdb0334c9fb0fb8ba771c9862ebb9
Author: Sergey Sharybin
Date:   Fri Jan 30 14:00:24 2015 +0500
Branches: master
https://developer.blender.org/rBa3c13fa9e80fdb0334c9fb0fb8ba771c9862ebb9

Cycles: Remove confusing labels usage in hair BSDF

BSDF sampler function shouldn't give labels it's not intended to do.
That said reflection shouldn't give transmission ray and transmission
give reflection ray.

Added an assert in the transmission sampling but reflection still
needs some investigation because even after recent fixes the check
for projection onto the reflected ray could give both positive and
negative values.

It shouldn't have any affect on renders just makes internal logic
consistent and unleashes an issue to be investigate further.

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

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

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

diff --git a/intern/cycles/kernel/closure/bsdf_hair.h b/intern/cycles/kernel/closure/bsdf_hair.h
index 4f4fd5d..3d7bdab 100644
--- a/intern/cycles/kernel/closure/bsdf_hair.h
+++ b/intern/cycles/kernel/closure/bsdf_hair.h
@@ -211,10 +211,6 @@ ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, f
 
 	*eval = make_float3(*pdf, *pdf, *pdf);
 
-	if(dot(locy, *omega_in) < 0.0f) {
-		return LABEL_REFLECT|LABEL_TRANSMIT|LABEL_GLOSSY;
-	}
-	
 	return LABEL_REFLECT|LABEL_GLOSSY;
 }
 
@@ -267,9 +263,8 @@ ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng,
 
 	*eval = make_float3(*pdf, *pdf, *pdf);
 
-	if(dot(locy, *omega_in) < 0.0f)
-		return LABEL_TRANSMIT|LABEL_GLOSSY;
-	
+	kernel_assert(dot(locy, *omega_in) < 0.0f);
+
 	return LABEL_GLOSSY;
 }




More information about the Bf-blender-cvs mailing list