[Bf-blender-cvs] [8acff9e7c44] lineart-shadow: Merge branch 'temp-lineart-contained' into lineart-shadow

YimingWu noreply at git.blender.org
Thu Mar 31 08:42:46 CEST 2022


Commit: 8acff9e7c4484b2d2d7f0b1e27c46f178ae16e30
Author: YimingWu
Date:   Mon Mar 14 22:56:33 2022 +0800
Branches: lineart-shadow
https://developer.blender.org/rB8acff9e7c4484b2d2d7f0b1e27c46f178ae16e30

Merge branch 'temp-lineart-contained' into lineart-shadow

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



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

diff --cc source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index bec20f590c7,d44a8e8ba69..4b1b58e7abb
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@@ -2568,24 -2551,10 +2580,25 @@@ static bool lineart_triangle_edge_image
    dot_r = dot_v3v3_db(Rv, tri->gn);
    dot_f = dot_v3v3_db(Cv, tri->gn);
  
 +  if ((e->flags & LRT_EDGE_FLAG_PROJECTED_SHADOW) &&
 +      (e->target_reference == tri->target_reference || !e->target_reference) &&
 +      LRT_SHADOW_CLOSE_ENOUGH(dot_l, 0) && LRT_SHADOW_CLOSE_ENOUGH(dot_r, 0)) {
 +    /* Currently unable to precisely determine if the edge is really from this triangle. */
 +    if (e->target_reference &&
 +        (((dot_f > 0) && (e->flags & LRT_EDGE_FLAG_SHADOW_FACING_LIGHT)) ||
 +         ((dot_f < 0) && (!(e->flags & LRT_EDGE_FLAG_SHADOW_FACING_LIGHT))))) {
 +      *from = 0.0f;
 +      *to = 1.0f;
 +      return true;
 +    }
 +
 +    return false;
 +  }
 +
    /* NOTE(Yiming): When we don't use `dot_f==0` here, it's theoretically possible that _some_
-    * faces in perspective mode would get erroneously caught in this condition where they really are
-    * legit faces that would produce occlusion, but haven't encountered those yet in my test files.
+    * faces in perspective mode would get erroneously caught in this condition where they really
+    * are legit faces that would produce occlusion, but haven't encountered those yet in my test
+    * files.
     */
    if (fabs(dot_f) < FLT_EPSILON) {
      return false;



More information about the Bf-blender-cvs mailing list