Revert "Fix: Cycles: inconsistent normal checks when sampling and evaluating BSDF"
While this code is suspect, better to go back to the old state for now,
as there is no simple fix that doesn't introduce other issues.
Fix #115022
Fix #115414
This reverts commit 063a9e8964.
This commit is contained in:
@@ -460,7 +460,6 @@ ccl_device_inline
|
||||
{
|
||||
Spectrum eval = zero_spectrum();
|
||||
*pdf = 0.f;
|
||||
const float3 Ng = (sd->type & PRIMITIVE_CURVE) ? sc->N : sd->Ng;
|
||||
|
||||
switch (sc->type) {
|
||||
case CLOSURE_BSDF_DIFFUSE_ID:
|
||||
@@ -487,15 +486,18 @@ ccl_device_inline
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID:
|
||||
eval = bsdf_microfacet_ggx_eval(sc, Ng, sd->wi, wo, pdf);
|
||||
/* For consistency with eval() this should be using sd->Ng, but that causes
|
||||
* artifacts (see shadow_terminator_metal test). Needs deeper investigation
|
||||
* for how to solve this. */
|
||||
eval = bsdf_microfacet_ggx_eval(sc, sd->N, sd->wi, wo, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID:
|
||||
eval = bsdf_microfacet_beckmann_eval(sc, Ng, sd->wi, wo, pdf);
|
||||
eval = bsdf_microfacet_beckmann_eval(sc, sd->N, sd->wi, wo, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
eval = bsdf_ashikhmin_shirley_eval(sc, Ng, sd->wi, wo, pdf);
|
||||
eval = bsdf_ashikhmin_shirley_eval(sc, sd->N, sd->wi, wo, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
|
||||
eval = bsdf_ashikhmin_velvet_eval(sc, sd->wi, wo, pdf);
|
||||
|
||||
Reference in New Issue
Block a user