[Bf-blender-cvs] [f3e664907c9] temp-cycles-denoising: Cycles Denoising: Move the denoising feature evaluation before the subsurface bounce

Lukas Stockner noreply at git.blender.org
Fri Apr 14 00:57:47 CEST 2017


Commit: f3e664907c9c17ed4fbb0f8868782a3f24d1e9a4
Author: Lukas Stockner
Date:   Fri Apr 14 00:21:42 2017 +0200
Branches: temp-cycles-denoising
https://developer.blender.org/rBf3e664907c9c17ed4fbb0f8868782a3f24d1e9a4

Cycles Denoising: Move the denoising feature evaluation before the subsurface bounce

Previously, SSS bounces would skip the denoising feature evaluation, basically acting like a specular surface.

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

M	intern/cycles/kernel/kernel_path.h
M	intern/cycles/kernel/kernel_path_branched.h

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

diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index b12a4df32c1..8136a6f5998 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -371,6 +371,8 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
 		}
 #endif  /* __AO__ */
 
+		kernel_update_denoising_features(kg, sd, state, L);
+
 #ifdef __SUBSURFACE__
 		/* bssrdf scatter to a different location on the same object, replacing
 		 * the closures with a diffuse BSDF */
@@ -419,8 +421,6 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
 		}
 #endif  /* defined(__EMISSION__) && defined(__BRANCHED_PATH__) */
 
-		kernel_update_denoising_features(kg, sd, state, L);
-
 		if(!kernel_path_surface_bounce(kg, rng, sd, &throughput, state, L, ray))
 			break;
 	}
@@ -723,6 +723,8 @@ ccl_device_inline float kernel_path_integrate(KernelGlobals *kg,
 		}
 #endif  /* __AO__ */
 
+		kernel_update_denoising_features(kg, &sd, &state, L);
+
 #ifdef __SUBSURFACE__
 		/* bssrdf scatter to a different location on the same object, replacing
 		 * the closures with a diffuse BSDF */
@@ -745,8 +747,6 @@ ccl_device_inline float kernel_path_integrate(KernelGlobals *kg,
 		/* direct lighting */
 		kernel_path_surface_connect_light(kg, rng, &sd, &emission_sd, throughput, &state, L);
 
-		kernel_update_denoising_features(kg, &sd, &state, L);
-
 		/* compute direct lighting and next bounce */
 		if(!kernel_path_surface_bounce(kg, rng, &sd, &throughput, &state, L, &ray))
 			break;
diff --git a/intern/cycles/kernel/kernel_path_branched.h b/intern/cycles/kernel/kernel_path_branched.h
index 54bca56d3fe..5f31ad8679d 100644
--- a/intern/cycles/kernel/kernel_path_branched.h
+++ b/intern/cycles/kernel/kernel_path_branched.h
@@ -565,6 +565,8 @@ ccl_device float kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, int
 		}
 #endif  /* __AO__ */
 
+		kernel_update_denoising_features(kg, &sd, &state, L);
+
 #ifdef __SUBSURFACE__
 		/* bssrdf scatter to a different location on the same object */
 		if(sd.flag & SD_BSSRDF) {
@@ -586,8 +588,6 @@ ccl_device float kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, int
 			}
 #endif  /* __EMISSION__ */
 
-			kernel_update_denoising_features(kg, &sd, &state, L);
-
 			/* indirect light */
 			kernel_branched_path_surface_indirect_light(kg, rng,
 				&sd, &indirect_sd, &emission_sd, throughput, 1.0f, &hit_state, L);




More information about the Bf-blender-cvs mailing list