[Bf-blender-cvs] [c58a54b] cycles_disney_bsdf_transmittance: Better roughness remapping for thin surface specular refractions.

Pascal Schoen noreply at git.blender.org
Wed Dec 14 15:06:52 CET 2016


Commit: c58a54bbf29fcac95e77e078336bed8d0f737865
Author: Pascal Schoen
Date:   Wed Nov 16 08:20:05 2016 +0100
Branches: cycles_disney_bsdf_transmittance
https://developer.blender.org/rBc58a54bbf29fcac95e77e078336bed8d0f737865

Better roughness remapping for thin surface specular refractions.

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

M	intern/cycles/kernel/svm/svm_closure.h

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

diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h
index 6e75aee..4958bfd 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -123,7 +123,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
 
 			// calculate weights of the diffuse and specular part
 			float diffuse_weight = (1.0f - saturate(metallic)) * (1.0f - saturate(spec_trans)); // lerp(1.0f - clamp(metallic, 0.0f, 1.0f), 0.0f, lerp(clamp(spec_trans, 0.0f, 1.0f), 0.0f, clamp(metallic, 0.0f, 1.0f)));
-			
+
 			float spec_transp = saturate(spec_trans) * (1.0f - saturate(metallic)); // lerp(clamp(spec_trans, 0.0f, 1.0f), 0.0f, clamp(metallic, 0.0f, 1.0f));
 			float specular_weight = (1.0f - spec_transp); // + fresnel * spec_transp; // lerp(1.0f, fresnel, spec_transp);
 
@@ -438,9 +438,12 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
 								if(surface_type == THIN_SURFACE) {
 									refraction_roughness *= 0.65f * ior - 0.35f;
 								}
+								else {
+									refraction_roughness *= refraction_roughness;
+								}
 
-								bsdf->alpha_x = refraction_roughness * refraction_roughness;
-								bsdf->alpha_y = refraction_roughness * refraction_roughness;
+								bsdf->alpha_x = refraction_roughness;
+								bsdf->alpha_y = refraction_roughness;
 								bsdf->ior = ior;
 
 								/* setup bsdf */




More information about the Bf-blender-cvs mailing list