[Bf-blender-cvs] [27c8f7eeb39] lineart-shadow: LineArt: Separate cast shadow and light contour in shadow edge loading.

YimingWu noreply at git.blender.org
Thu Apr 7 15:00:40 CEST 2022


Commit: 27c8f7eeb3936193c69a968d4beed2e5c58599aa
Author: YimingWu
Date:   Thu Apr 7 21:00:06 2022 +0800
Branches: lineart-shadow
https://developer.blender.org/rB27c8f7eeb3936193c69a968d4beed2e5c58599aa

LineArt: Separate cast shadow and light contour in shadow edge loading.

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

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

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

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 93ba4e238f4..2f24326bbf4 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1835,7 +1835,7 @@ static uint16_t lineart_identify_feature_line(LineartRenderBuffer *rb,
     dot_2 = dot_v3v3_db(view_vector, tri2->gn);
 
     if ((result = dot_1 * dot_2) <= 0 && (dot_1 + dot_2)) {
-      edge_flag_result |= LRT_EDGE_FLAG_LIGHT_CONTOUR;
+      // edge_flag_result |= LRT_EDGE_FLAG_LIGHT_CONTOUR;
     }
   }
 
@@ -3250,7 +3250,7 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
   dot_r = dot_v3v3_db(Rv, tri->gn);
   dot_f = dot_v3v3_db(Cv, tri->gn);
 
-  if ((e->flags & LRT_EDGE_FLAG_PROJECTED_SHADOW) &&
+  if (((e->flags & LRT_EDGE_FLAG_PROJECTED_SHADOW) || (e->flags & LRT_EDGE_FLAG_LIGHT_CONTOUR)) &&
       (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. */
@@ -5771,7 +5771,7 @@ static bool lineart_shadow_cast_generate_edges(LineartRenderBuffer *rb,
     tot_orig_edges++;
   }
 
-  int edge_alloc = tot_orig_edges + tot_edges;
+  int edge_alloc = tot_edges + tot_orig_edges;
 
   if (G.debug_value == 4000) {
     printf("Line art shadow segments total: %d\n", tot_edges);
@@ -5828,7 +5828,7 @@ static bool lineart_shadow_cast_generate_edges(LineartRenderBuffer *rb,
     //}
     e->v1 = v1;
     e->v2 = v2;
-    e->flags = LRT_EDGE_FLAG_PROJECTED_SHADOW;
+    e->flags = LRT_EDGE_FLAG_LIGHT_CONTOUR;
     i++;
   }
   return true;



More information about the Bf-blender-cvs mailing list