forked from bartvdbraak/blender
Fix issue in last subsurface commit with branched path tracing, was rendering too bright.
This commit is contained in:
parent
2c556c2ef7
commit
60ca0558c0
@ -221,18 +221,26 @@ __device int subsurface_scatter_multi_step(KernelGlobals *kg, ShaderData *sd, Sh
|
|||||||
disk_N = sd->Ng;
|
disk_N = sd->Ng;
|
||||||
make_orthonormals(disk_N, &disk_T, &disk_B);
|
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_N = 0.5f;
|
||||||
pick_pdf_T = 0.25f;
|
pick_pdf_T = 0.25f;
|
||||||
pick_pdf_B = 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;
|
float3 tmp = disk_N;
|
||||||
disk_N = disk_T;
|
disk_N = disk_T;
|
||||||
disk_T = tmp;
|
disk_T = tmp;
|
||||||
pick_pdf_N = 0.25f;
|
pick_pdf_N = 0.25f;
|
||||||
pick_pdf_T = 0.5f;
|
pick_pdf_T = 0.5f;
|
||||||
pick_pdf_B = 0.25f;
|
pick_pdf_B = 0.25f;
|
||||||
|
if(all)
|
||||||
|
disk_u = (disk_u - 0.5f)*4.0f;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float3 tmp = disk_N;
|
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_N = 0.25f;
|
||||||
pick_pdf_T = 0.25f;
|
pick_pdf_T = 0.25f;
|
||||||
pick_pdf_B = 0.5f;
|
pick_pdf_B = 0.5f;
|
||||||
|
if(all)
|
||||||
|
disk_u = (disk_u - 0.75f)*4.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sample point on disk */
|
/* sample point on disk */
|
||||||
|
Loading…
Reference in New Issue
Block a user