Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-08-24 19:36:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-08-24 19:36:14 +0400
commit60ca0558c031efcb81e9dcc89f95fc370cf80f96 (patch)
tree985c73c5e19e07c3a5eb9e39f9035ce1f1460300 /intern/cycles/kernel/kernel_subsurface.h
parent2c556c2ef72bf96a8ad178a0855c81d76e0e35de (diff)
Fix issue in last subsurface commit with branched path tracing, was rendering too bright.
Diffstat (limited to 'intern/cycles/kernel/kernel_subsurface.h')
-rw-r--r--intern/cycles/kernel/kernel_subsurface.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index 5eb641f5af4..2c394327f21 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -221,18 +221,26 @@ __device int subsurface_scatter_multi_step(KernelGlobals *kg, ShaderData *sd, Sh
disk_N = sd->Ng;
make_orthonormals(disk_N, &disk_T, &disk_B);
- if(sd->randb_closure < 0.5f) {
+ /* reusing variable for picking the closure gives a bit nicer stratification
+ * for path tracer, for branched we do all closures so it doesn't help */
+ float axisu = (all)? disk_u: sd->randb_closure;
+
+ if(axisu < 0.5f) {
pick_pdf_N = 0.5f;
pick_pdf_T = 0.25f;
pick_pdf_B = 0.25f;
+ if(all)
+ disk_u *= 2.0f;
}
- else if(sd->randb_closure < 0.75f) {
+ else if(axisu < 0.75f) {
float3 tmp = disk_N;
disk_N = disk_T;
disk_T = tmp;
pick_pdf_N = 0.25f;
pick_pdf_T = 0.5f;
pick_pdf_B = 0.25f;
+ if(all)
+ disk_u = (disk_u - 0.5f)*4.0f;
}
else {
float3 tmp = disk_N;
@@ -241,6 +249,8 @@ __device int subsurface_scatter_multi_step(KernelGlobals *kg, ShaderData *sd, Sh
pick_pdf_N = 0.25f;
pick_pdf_T = 0.25f;
pick_pdf_B = 0.5f;
+ if(all)
+ disk_u = (disk_u - 0.75f)*4.0f;
}
/* sample point on disk */