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:
authorMikhail Matrosov <ktdfly>2021-08-23 16:13:35 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-08-23 16:47:34 +0300
commitcd118c5581f482afc8554ff88b5b6f3b552b1682 (patch)
treebe8ff8d444c9cea2836d472d865d019a06241b6d
parent27f138f4c819d6416adb5fafc24d3e447969c467 (diff)
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
-rw-r--r--intern/cycles/kernel/closure/bsdf_principled_diffuse.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/kernel/closure/bsdf_principled_diffuse.h b/intern/cycles/kernel/closure/bsdf_principled_diffuse.h
index 43646aaeb5b..d5d012068ff 100644
--- a/intern/cycles/kernel/closure/bsdf_principled_diffuse.h
+++ b/intern/cycles/kernel/closure/bsdf_principled_diffuse.h
@@ -36,10 +36,10 @@ static_assert(sizeof(ShaderClosure) >= sizeof(PrincipledDiffuseBsdf),
ccl_device float3 calculate_principled_diffuse_brdf(
const PrincipledDiffuseBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf)
{
- float NdotL = max(dot(N, L), 0.0f);
- float NdotV = max(dot(N, V), 0.0f);
+ float NdotL = dot(N, L);
+ float NdotV = dot(N, V);
- if (NdotL < 0 || NdotV < 0) {
+ if (NdotL <= 0 || NdotV <= 0) {
*pdf = 0.0f;
return make_float3(0.0f, 0.0f, 0.0f);
}