[Bf-blender-cvs] [3fc38da] soc-2016-cycles_denoising: Merge remote-tracking branch 'origin/master' into soc-2016-cycles_denoising

Lukas Stockner noreply at git.blender.org
Sun Jul 24 03:45:59 CEST 2016


Commit: 3fc38da38d1e719841909bd0e49ca78d8adde8fd
Author: Lukas Stockner
Date:   Mon Jul 18 20:37:57 2016 +0200
Branches: soc-2016-cycles_denoising
https://developer.blender.org/rB3fc38da38d1e719841909bd0e49ca78d8adde8fd

Merge remote-tracking branch 'origin/master' into soc-2016-cycles_denoising

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



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

diff --cc intern/cycles/kernel/closure/bsdf_microfacet.h
index 8e0cf34,7bf7c28..e7ec183
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@@ -620,9 -613,38 +620,39 @@@ ccl_device void bsdf_microfacet_beckman
  {
  	sc->data0 = fmaxf(roughness, sc->data0); /* alpha_x */
  	sc->data1 = fmaxf(roughness, sc->data1); /* alpha_y */
 +	sc->roughness = sqrtf(sc->data0*sc->data1);
  }
  
+ ccl_device_inline float bsdf_beckmann_G1(float alpha, float cos_n)
+ {
+ 	cos_n *= cos_n;
+ 	float invA = alpha * safe_sqrtf((1.0f - cos_n) / cos_n);
+ 	if(invA < 0.625f) {
+ 		return 1.0f;
+ 	}
+ 
+ 	float a = 1.0f / invA;
+ 	return ((2.181f*a + 3.535f)*a) / ((2.577f*a + 2.276f)*a + 1.0f);
+ }
+ 
+ ccl_device_inline float bsdf_beckmann_aniso_G1(float alpha_x, float alpha_y, float cos_n, float cos_phi, float sin_phi)
+ {
+ 	cos_n *= cos_n;
+ 	sin_phi *= sin_phi;
+ 	cos_phi *= cos_phi;
+ 	alpha_x *= alpha_x;
+ 	alpha_y *= alpha_y;
+ 
+ 	float alphaO2 = (cos_phi*alpha_x + sin_phi*alpha_y) / (cos_phi + sin_phi);
+ 	float invA = safe_sqrtf(alphaO2 * (1 - cos_n) / cos_n);
+ 	if(invA < 0.625f) {
+ 		return 1.0f;
+ 	}
+ 
+ 	float a = 1.0f / invA;
+ 	return ((2.181f*a + 3.535f)*a) / ((2.577f*a + 2.276f)*a + 1.0f);
+ }
+ 
  ccl_device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
  {
  	float alpha_x = sc->data0;
diff --cc source/blender/blenloader/intern/versioning_270.c
index 73c3443,ac2811a..ed28627
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -1212,21 -1212,18 +1212,34 @@@ void blo_do_versions_270(FileData *fd, 
  				}
  			}
  		}
+ 
+ 		if (!DNA_struct_elem_find(fd->filesdna, "BooleanModifierData", "float", "double_threshold")) {
+ 			Object *ob;
+ 			for (ob = main->object.first; ob; ob = ob->id.next) {
+ 				ModifierData *md;
+ 				for (md = ob->modifiers.first; md; md = md->next) {
+ 					if (md->type == eModifierType_Boolean) {
+ 						BooleanModifierData *bmd = (BooleanModifierData *)md;
+ 						bmd->double_threshold = 1e-6f;
+ 					}
+ 				}
+ 			}
+ 		}
  	}
 +
 +	{
 +		if (!DNA_struct_elem_find(fd->filesdna, "SceneRenderLayer", "int", "denoiseflag")) {
 +			Scene *sce;
 +
 +			for (sce = main->scene.first; sce; sce = sce->id.next) {
 +				SceneRenderLayer *rl;
 +				for (rl = sce->r.layers.first; rl; rl = rl->next) {
 +					rl->denoiseflag = SCE_DENOISE_DIFFDIR|SCE_DENOISE_GLOSSDIR|SCE_DENOISE_TRANSDIR|SCE_DENOISE_SUBDIR|
 +					                  SCE_DENOISE_DIFFIND|SCE_DENOISE_GLOSSIND|SCE_DENOISE_TRANSIND|SCE_DENOISE_SUBIND;
 +					rl->denoise_half_window = 8;
 +					rl->denoise_strength = 0.0f;
 +				}
 +			}
 +		}
 +	}
  }




More information about the Bf-blender-cvs mailing list