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

Lukas Stockner noreply at git.blender.org
Wed Jul 6 04:28:45 CEST 2016


Commit: e1f266d079341c33e2db2f21b1bfe820aa4d0e18
Author: Lukas Stockner
Date:   Mon Jul 4 00:15:35 2016 +0200
Branches: soc-2016-cycles_denoising
https://developer.blender.org/rBe1f266d079341c33e2db2f21b1bfe820aa4d0e18

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

Conflicts:
	intern/cycles/kernel/kernel_path.h
	intern/cycles/kernel/kernel_path_branched.h
	intern/cycles/kernel/kernel_types.h
	intern/cycles/render/buffers.cpp
	intern/cycles/render/buffers.h
	intern/cycles/render/film.cpp
	intern/cycles/render/film.h
	intern/cycles/render/integrator.cpp
	source/blender/render/intern/source/render_result.c

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



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

diff --cc intern/cycles/kernel/kernel_path.h
index 3e8f9e8,3c3503e..504cf55
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@@ -602,10 -606,16 +607,15 @@@ ccl_device_inline float kernel_path_int
  	float3 throughput = make_float3(1.0f, 1.0f, 1.0f);
  	float L_transparent = 0.0f;
  
 -	path_radiance_init(&L, kernel_data.film.use_light_pass);
 +	path_radiance_init(L, kernel_data.film.use_light_pass);
  
+ 	/* shader data memory used for both volumes and surfaces, saves stack space */
+ 	ShaderData sd;
+ 	/* shader data used by emission, shadows, volume stacks */
+ 	ShaderData emission_sd;
+ 
  	PathState state;
- 	path_state_init(kg, &state, rng, sample, &ray);
+ 	path_state_init(kg, &emission_sd, &state, rng, sample, &ray);
  
  #ifdef __KERNEL_DEBUG__
  	DebugData debug_data;
@@@ -669,8 -679,8 +679,8 @@@
  			/* intersect with lamp */
  			float3 emission;
  
- 			if(indirect_lamp_emission(kg, &state, &light_ray, &emission))
+ 			if(indirect_lamp_emission(kg, &emission_sd, &state, &light_ray, &emission))
 -				path_radiance_accum_emission(&L, throughput, emission, state.bounce);
 +				path_radiance_accum_emission(L, throughput, emission, state.bounce);
  		}
  #endif
  
@@@ -708,8 -717,9 +717,9 @@@
  					int all = false;
  
  					/* direct light sampling */
- 					kernel_branched_path_volume_connect_light(kg, rng, &volume_sd,
- 						throughput, &state, L, all, &volume_ray, &volume_segment);
+ 					kernel_branched_path_volume_connect_light(kg, rng, &sd,
 -						&emission_sd, throughput, &state, &L, all,
++						&emission_sd, throughput, &state, L, all,
+ 						&volume_ray, &volume_segment);
  
  					/* indirect sample. if we use distance sampling and take just
  					 * one sample for direct and indirect light, we could share
@@@ -726,7 -736,7 +736,7 @@@
  				kernel_volume_decoupled_free(kg, &volume_segment);
  
  				if(result == VOLUME_PATH_SCATTERED) {
- 					if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, L, &ray))
 -					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, &L, &ray))
++					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, L, &ray))
  						continue;
  					else
  						break;
@@@ -739,17 -749,16 +749,16 @@@
  #  endif
  			{
  				/* integrate along volume segment with distance sampling */
- 				ShaderData volume_sd;
  				VolumeIntegrateResult result = kernel_volume_integrate(
- 					kg, &state, &volume_sd, &volume_ray, L, &throughput, rng, heterogeneous);
 -					kg, &state, &sd, &volume_ray, &L, &throughput, rng, heterogeneous);
++					kg, &state, &sd, &volume_ray, L, &throughput, rng, heterogeneous);
  
  #  ifdef __VOLUME_SCATTER__
  				if(result == VOLUME_PATH_SCATTERED) {
  					/* direct lighting */
- 					kernel_path_volume_connect_light(kg, rng, &volume_sd, throughput, &state, L);
 -					kernel_path_volume_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, &L);
++					kernel_path_volume_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, L);
  
  					/* indirect light bounce */
- 					if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, L, &ray))
 -					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, &L, &ray))
++					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, L, &ray))
  						continue;
  					else
  						break;
@@@ -772,24 -781,18 +781,23 @@@
  
  #ifdef __BACKGROUND__
  			/* sample background shader */
- 			float3 L_background = indirect_background(kg, &state, &ray);
+ 			float3 L_background = indirect_background(kg, &emission_sd, &state, &ray);
 -			path_radiance_accum_background(&L, throughput, L_background, state.bounce);
 +			path_radiance_accum_background(L, throughput, L_background, state.bounce);
 +			kernel_write_denoising_passes(kg, buffer, &state, NULL, sample, L_background);
 +#else
 +			kernel_write_denoising_passes(kg, buffer, &state, NULL, sample, make_float3(0.0f, 0.0f, 0.0f));
  #endif
  
  			break;
  		}
  
  		/* setup shading */
- 		ShaderData sd;
  		shader_setup_from_ray(kg, &sd, &isect, &ray);
  		float rbsdf = path_state_rng_1D_for_decision(kg, rng, &state, PRNG_BSDF);
- 		shader_eval_surface(kg, &sd, &state, rbsdf, state.flag, SHADER_CONTEXT_MAIN);
+ 		shader_eval_surface(kg, &sd, rng, &state, rbsdf, state.flag, SHADER_CONTEXT_MAIN);
  
 +		kernel_write_denoising_passes(kg, buffer, &state, &sd, sample, make_float3(0.0f, 0.0f, 0.0f));
 +
  		/* holdout */
  #ifdef __HOLDOUT__
  		if((sd.flag & (SD_HOLDOUT|SD_HOLDOUT_MASK)) && (state.flag & PATH_RAY_CAMERA)) {
@@@ -853,7 -856,7 +861,7 @@@
  #ifdef __AO__
  		/* ambient occlusion */
  		if(kernel_data.integrator.use_ambient_occlusion || (sd.flag & SD_AO)) {
- 			kernel_path_ao(kg, &sd, L, &state, rng, throughput);
 -			kernel_path_ao(kg, &sd, &emission_sd, &L, &state, rng, throughput);
++			kernel_path_ao(kg, &sd, &emission_sd, L, &state, rng, throughput);
  		}
  #endif
  
@@@ -863,7 -866,8 +871,8 @@@
  		if(sd.flag & SD_BSSRDF) {
  			if(kernel_path_subsurface_scatter(kg,
  			                                  &sd,
+ 			                                  &emission_sd,
 -			                                  &L,
 +			                                  L,
  			                                  &state,
  			                                  rng,
  			                                  &ray,
@@@ -876,10 -880,10 +885,10 @@@
  #endif  /* __SUBSURFACE__ */
  
  		/* direct lighting */
- 		kernel_path_surface_connect_light(kg, rng, &sd, throughput, &state, L);
 -		kernel_path_surface_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, &L);
++		kernel_path_surface_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, L);
  
  		/* compute direct lighting and next bounce */
 -		if(!kernel_path_surface_bounce(kg, rng, &sd, &throughput, &state, &L, &ray))
 +		if(!kernel_path_surface_bounce(kg, rng, &sd, &throughput, &state, L, &ray))
  			break;
  	}
  
diff --cc intern/cycles/kernel/kernel_path.h.orig
index 3e8f9e8,3c3503e..9ff999a
--- a/intern/cycles/kernel/kernel_path.h.orig
+++ b/intern/cycles/kernel/kernel_path.h.orig
@@@ -602,10 -606,16 +607,15 @@@ ccl_device_inline float kernel_path_int
  	float3 throughput = make_float3(1.0f, 1.0f, 1.0f);
  	float L_transparent = 0.0f;
  
 -	path_radiance_init(&L, kernel_data.film.use_light_pass);
 +	path_radiance_init(L, kernel_data.film.use_light_pass);
  
+ 	/* shader data memory used for both volumes and surfaces, saves stack space */
+ 	ShaderData sd;
+ 	/* shader data used by emission, shadows, volume stacks */
+ 	ShaderData emission_sd;
+ 
  	PathState state;
- 	path_state_init(kg, &state, rng, sample, &ray);
+ 	path_state_init(kg, &emission_sd, &state, rng, sample, &ray);
  
  #ifdef __KERNEL_DEBUG__
  	DebugData debug_data;
@@@ -669,8 -679,8 +679,13 @@@
  			/* intersect with lamp */
  			float3 emission;
  
++<<<<<<< HEAD
 +			if(indirect_lamp_emission(kg, &state, &light_ray, &emission))
 +				path_radiance_accum_emission(L, throughput, emission, state.bounce);
++=======
+ 			if(indirect_lamp_emission(kg, &emission_sd, &state, &light_ray, &emission))
+ 				path_radiance_accum_emission(&L, throughput, emission, state.bounce);
++>>>>>>> origin/master
  		}
  #endif
  
@@@ -708,8 -717,9 +722,14 @@@
  					int all = false;
  
  					/* direct light sampling */
++<<<<<<< HEAD
 +					kernel_branched_path_volume_connect_light(kg, rng, &volume_sd,
 +						throughput, &state, L, all, &volume_ray, &volume_segment);
++=======
+ 					kernel_branched_path_volume_connect_light(kg, rng, &sd,
+ 						&emission_sd, throughput, &state, &L, all,
+ 						&volume_ray, &volume_segment);
++>>>>>>> origin/master
  
  					/* indirect sample. if we use distance sampling and take just
  					 * one sample for direct and indirect light, we could share
@@@ -726,7 -736,7 +746,11 @@@
  				kernel_volume_decoupled_free(kg, &volume_segment);
  
  				if(result == VOLUME_PATH_SCATTERED) {
++<<<<<<< HEAD
 +					if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, L, &ray))
++=======
+ 					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, &L, &ray))
++>>>>>>> origin/master
  						continue;
  					else
  						break;
@@@ -739,17 -749,16 +763,27 @@@
  #  endif
  			{
  				/* integrate along volume segment with distance sampling */
- 				ShaderData volume_sd;
  				VolumeIntegrateResult result = kernel_volume_integrate(
++<<<<<<< HEAD
 +					kg, &state, &volume_sd, &volume_ray, L, &throughput, rng, heterogeneous);
++=======
+ 					kg, &state, &sd, &volume_ray, &L, &throughput, rng, heterogeneous);
++>>>>>>> origin/master
  
  #  ifdef __VOLUME_SCATTER__
  				if(result == VOLUME_PATH_SCATTERED) {
  					/* direct lighting */
++<<<<<<< HEAD
 +					kernel_path_volume_connect_light(kg, rng, &volume_sd, throughput, &state, L);
 +
 +					/* indirect light bounce */
 +					if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, L, &ray))
++=======
+ 					kernel_path_volume_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, &L);
+ 
+ 					/* indirect light bounce */
+ 					if(kernel_path_volume_bounce(kg, rng, &sd, &throughput, &state, &L, &ray))
++>>>>>>> origin/master
  						continue;
  					else
  						break;
@@@ -772,24 -781,18 +806,28 @@@
  
  #ifdef __BACKGROUND__
  			/* sample background shader */
++<<<<<<< HEAD
 +			float3 L_background = indirect_background(kg, &state, &ray);
 +			path_radiance_accum_background(L, throughput, L_background, state.bounce);
 +			kernel_write_denoising_passes(kg, buffer, &state, NULL, sample, L_background);
 +#else
 +			kernel_write_denoising_passes(kg, buffer, &state, NULL, sample, make_float3(0.0f, 0.0f, 0.0f));
++=======
+ 			float3 L_background = indirect_background(kg, &emission_sd, &state, &ray);
+ 			path_radiance_accum_background(&L, throughput, L_background, state.bounce);
++>>>>>>> origin/master
  #endif
  
  			break;
  		}
  
  		/* setup shading */
- 		ShaderData sd;
  		shader_setup_from_ray(kg, &sd, &isect, &ray);
  		float rbsdf = path_state_rng_1D_for_decision(kg, rng, &state, PRNG_BSDF);
- 		shader_eval_surface(kg, &sd, &state, rbsdf, state.flag, SHADER_CONTEXT_MAIN);
+ 		shader_eval_surface(kg, &sd, rng, &state, rbsdf, state.flag, SHADER_CONTEXT

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list