[Bf-blender-cvs] [b96c86ec371] principled-v2: Remove redundant angle check

Lukas Stockner noreply at git.blender.org
Sun Oct 30 16:35:29 CET 2022


Commit: b96c86ec3710a276b83b9255d4c1a06bcdd1330b
Author: Lukas Stockner
Date:   Sun Oct 30 13:47:42 2022 +0100
Branches: principled-v2
https://developer.blender.org/rBb96c86ec3710a276b83b9255d4c1a06bcdd1330b

Remove redundant angle check

===================================================================

M	intern/cycles/kernel/closure/bsdf_microfacet.h

===================================================================

diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h
index a60f24965d0..13729df2985 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -264,13 +264,8 @@ ccl_device Spectrum bsdf_microfacet_ggx_eval_reflect(ccl_private const Microface
                                                      const float cosNI)
 {
   float alpha2 = alpha_x * alpha_y;
-  if (!(cosNI > 0 && cosNO > 0)) {
-    *pdf = 0.0f;
-    return zero_spectrum();
-  }
-
   /* Ensure that both direction are in the upper hemisphere */
-  if (cosNI <= 0 || cosNO <= 0) {
+  if (!(cosNI > 0 && cosNO > 0)) {
     *pdf = 0.0f;
     return zero_spectrum();
   }



More information about the Bf-blender-cvs mailing list