Fix T42212: Singular reflection pass is incorrect in regular path tracer

Issue seems to be caused by not totally proper pdf and eval values for this
closure. Changed it so they reflect to ggx/beckmann reflection with roughness
set to 0, which is effectively the same as the sharp reflection.
This commit is contained in:
Sergey Sharybin 2015-01-20 03:00:34 +05:00
parent 4a4297ba02
commit a1f4821b94
Notes: blender-bot 2023-02-14 09:57:41 +01:00
Referenced by issue #43335, Node Editor: name doesn't update
Referenced by issue #43337, Group objects disappear after appending
Referenced by issue #43324, Shrinkwrap projection issue in editmode
Referenced by issue #43311, Displacement Method: true Crashing
Referenced by issue #42212, Probable bug in (regular) Path tracing method
2 changed files with 7 additions and 5 deletions

View File

@ -70,8 +70,9 @@ ccl_device int bsdf_reflection_sample(const ShaderClosure *sc, float3 Ng, float3
*domega_in_dx = 2 * dot(N, dIdx) * N - dIdx;
*domega_in_dy = 2 * dot(N, dIdy) * N - dIdy;
#endif
*pdf = 1;
*eval = make_float3(1, 1, 1);
/* Some high number for MIS. */
*pdf = 1e6f;
*eval = make_float3(1e6f, 1e6f, 1e6f);
}
}
return LABEL_REFLECT|LABEL_SINGULAR;

View File

@ -72,10 +72,11 @@ ccl_device int bsdf_refraction_sample(const ShaderClosure *sc, float3 Ng, float3
dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy,
#endif
&inside);
if(!inside) {
*pdf = 1.0f;
*eval = make_float3(1.0f, 1.0f, 1.0f);
/* Some high number for MIS. */
*pdf = 1e6f;
*eval = make_float3(1e6f, 1e6f, 1e6f);
*omega_in = T;
#ifdef __RAY_DIFFERENTIALS__
*domega_in_dx = dTdx;