Fix T90423: black pixels after shadow terminator geometry offset

Solves an error in the principled diffuse BSDF, where it was not correctly
rejecting directions outside the hemisphere.

Differential Revision: https://developer.blender.org/D12283
This commit is contained in:
Mikhail Matrosov
2021-08-23 15:13:35 +02:00
committed by Brecht Van Lommel
parent 27f138f4c8
commit cd118c5581

View File

@@ -36,10 +36,10 @@ static_assert(sizeof(ShaderClosure) >= sizeof(PrincipledDiffuseBsdf),
ccl_device float3 calculate_principled_diffuse_brdf( ccl_device float3 calculate_principled_diffuse_brdf(
const PrincipledDiffuseBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf) const PrincipledDiffuseBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf)
{ {
float NdotL = max(dot(N, L), 0.0f); float NdotL = dot(N, L);
float NdotV = max(dot(N, V), 0.0f); float NdotV = dot(N, V);
if (NdotL < 0 || NdotV < 0) { if (NdotL <= 0 || NdotV <= 0) {
*pdf = 0.0f; *pdf = 0.0f;
return make_float3(0.0f, 0.0f, 0.0f); return make_float3(0.0f, 0.0f, 0.0f);
} }