[Bf-blender-cvs] [e1fa862] cycles_disney_brdf: Merge branch 'master' into cycles_disney_brdf

Pascal Schoen noreply at git.blender.org
Tue Sep 27 11:22:38 CEST 2016


Commit: e1fa8623915407cea942a07fd0a106b04e113c09
Author: Pascal Schoen
Date:   Tue Sep 27 08:59:32 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rBe1fa8623915407cea942a07fd0a106b04e113c09

Merge branch 'master' into cycles_disney_brdf

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



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

diff --cc intern/cycles/kernel/closure/bsdf_microfacet_multi.h
index 25c635c,0a6dd4d..d271162
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
@@@ -433,7 -436,7 +447,7 @@@ ccl_device int bsdf_microfacet_multi_gg
  
  /* Multiscattering GGX Glass closure */
  
- ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf, bool use_fresnel = false, bool initial_outside = true, bool only_refractions = false, bool only_reflections = false)
 -ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf)
++ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf, bool use_fresnel = false, bool initial_outside = true)
  {
  	bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
  	bsdf->alpha_y = bsdf->alpha_x;
@@@ -441,13 -444,6 +455,11 @@@
  	bsdf->extra->color.x = saturate(bsdf->extra->color.x);
  	bsdf->extra->color.y = saturate(bsdf->extra->color.y);
  	bsdf->extra->color.z = saturate(bsdf->extra->color.z);
 +	bsdf->extra->use_fresnel = use_fresnel;
 +	bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
 +	bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
 +	bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 +	bsdf->extra->initial_outside = initial_outside;
- 	bsdf->extra->only_refractions = only_refractions;
- 	bsdf->extra->only_reflections = only_reflections;
  
  	bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID;
  
@@@ -498,7 -530,7 +546,7 @@@ ccl_device int bsdf_microfacet_multi_gg
  	float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z));
  	float3 localO;
  
- 	*eval = mf_sample_glass(localI, &localO, bsdf->extra->color, bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, bsdf->extra->use_fresnel, bsdf->extra->initial_outside, bsdf->extra->only_refractions, bsdf->extra->only_reflections);
 -	*eval = mf_sample_glass(localI, &localO, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior);
++	*eval = mf_sample_glass(localI, &localO, bsdf->extra->color, bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, bsdf->extra->use_fresnel, bsdf->extra->initial_outside);
  	*pdf = mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior);
  	*eval *= *pdf;
  
diff --cc intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
index ecccc0c,6ebe2f6..97af724
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
@@@ -246,17 -168,11 +246,15 @@@ ccl_device_inline float3 MF_FUNCTION_FU
   * escaped the surface in wo. The function returns the throughput between wi and wo.
   * Without reflection losses due to coloring or fresnel absorption in conductors, the sampling is optimal.
   */
 -ccl_device float3 MF_FUNCTION_FULL_NAME(mf_sample)(float3 wi, float3 *wo, const float3 color, const float alpha_x, const float alpha_y, ccl_addr_space uint *lcg_state
 +ccl_device float3 MF_FUNCTION_FULL_NAME(mf_sample)(float3 wi, float3 *wo, const float3 color, const float3 cspec0, const float alpha_x, const float alpha_y, ccl_addr_space uint *lcg_state
  #ifdef MF_MULTI_GLASS
  	, const float eta
 +	, bool use_fresnel = false
 +	, bool initial_outside = true
- 	, bool only_refractions = false
- 	, bool only_reflections = false
  #elif defined(MF_MULTI_GLOSSY)
  	, float3 *n, float3 *k
 +	, const float eta = 1.0f
 +	, bool use_fresnel = false
  #endif
  )
  {
@@@ -294,17 -191,7 +292,11 @@@
  		/* Sample microfacet height. */
  		if(!mf_sample_height(wr, &hr, &C1_r, &G1_r, &lambda_r, lcg_step_float_addrspace(lcg_state))) {
  			/* The random walk has left the surface. */
- #ifdef MF_MULTI_GLASS
- 			if ((only_refractions && outside/* && initial_outside*/) || (only_reflections && !outside)) {
- 				*wo = make_float3(0.0f, 0.0f, 1.0f);
- 				return make_float3(0.0f, 0.0f, 0.0f);
- 			}
- #endif
  			*wo = outside? wr: -wr;
 +#if defined(MF_MULTI_GLASS) || defined(MF_MULTI_GLOSSY)
 +			if (use_fresnel)
 +				return throughput2;
 +#endif
  			return throughput;
  		}
  		/* Sample microfacet normal. */




More information about the Bf-blender-cvs mailing list