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

YimingWu noreply at git.blender.org
Tue Nov 30 06:55:29 CET 2021


Commit: fbe5c57b0ee843b1e193ee16678ab26af9750d20
Author: YimingWu
Date:   Tue Nov 30 13:55:18 2021 +0800
Branches: lineart-shadow
https://developer.blender.org/rBfbe5c57b0ee843b1e193ee16678ab26af9750d20

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

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



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

diff --cc source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index e000c54c9a7,36cc49a1dcd..d25a4089d8f
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@@ -558,11 -494,9 +558,13 @@@ typedef struct LineartBoundingArea 
  #define LRT_ABC(index) (index == 0 ? a : (index == 1 ? b : c))
  #define LRT_PABC(index) (index == 0 ? pa : (index == 1 ? pb : pc))
  
+ #define DBL_LOOSER 1e-5
+ #define LRT_DOUBLE_CLOSE_LOOSER(a, b) (((a) + DBL_LOOSER) >= (b) && ((a)-DBL_LOOSER) <= (b))
  #define LRT_DOUBLE_CLOSE_ENOUGH(a, b) (((a) + DBL_EDGE_LIM) >= (b) && ((a)-DBL_EDGE_LIM) <= (b))
 +
 +#define LRT_SHADOW_CLOSE_ENOUGH(a, b) \
 +  (((a) + DBL_SHADOW_LIM) >= (b) && ((a)-DBL_SHADOW_LIM) <= (b))
 +
  #define LRT_DOUBLE_CLOSE_ENOUGH_TRI(a, b) \
    (((a) + DBL_TRIANGLE_LIM) >= (b) && ((a)-DBL_TRIANGLE_LIM) <= (b))
  
diff --cc source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 1d6eb25ed5a,ecf4c4e3251..216347bd7dc
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@@ -547,10 -540,13 +548,14 @@@ static void lineart_main_occlusion_begi
    rb->edge_mark.last = rb->edge_mark.first;
    rb->floating.last = rb->floating.first;
    rb->light_contour.last = rb->light_contour.first;
 +  rb->shadow.last = rb->shadow.first;
  
-   /* This is needed because the occlusion function needs camera vector to be in the direction of
-    * point to camera. */
+   /* This is needed because the occlusion function expects the camera vector to point towards the
+    * camera. */
+   negate_v3_db(rb->view_vector);
+ 
+   /* This is needed because the occlusion function expects the camera vector to point towards the
+    * camera. */
    negate_v3_db(rb->view_vector);
  
    TaskPool *tp = BLI_task_pool_create(NULL, TASK_PRIORITY_HIGH);
@@@ -4184,23 -4159,23 +4235,19 @@@ static LineartBoundingArea *lineart_edg
      return lineart_get_bounding_area(rb, data[0], data[1]);
    }
  
-   if (lineart_LineIntersectTest2d(fbcoord1, fbcoord2, LU, RU, &sr, &p_unused) && sr < r &&
-       sr > 0) {
 -  if (lineart_intersect_seg_seg(e->v1->fbcoord, e->v2->fbcoord, LU, RU, &sr, &p_unused) &&
 -      sr < r && sr > 0) {
++  if (lineart_intersect_seg_seg(fbcoord1, fbcoord2, LU, RU, &sr, &p_unused) && sr < r && sr > 0) {
      r = sr;
    }
-   if (lineart_LineIntersectTest2d(fbcoord1, fbcoord2, LB, RB, &sr, &p_unused) && sr < r &&
-       sr > 0) {
 -  if (lineart_intersect_seg_seg(e->v1->fbcoord, e->v2->fbcoord, LB, RB, &sr, &p_unused) &&
 -      sr < r && sr > 0) {
++  if (lineart_intersect_seg_seg(fbcoord1, fbcoord2, LB, RB, &sr, &p_unused) && sr < r && sr > 0) {
      r = sr;
    }
-   if (lineart_LineIntersectTest2d(fbcoord1, fbcoord2, LB, LU, &sr, &p_unused) && sr < r &&
-       sr > 0) {
 -  if (lineart_intersect_seg_seg(e->v1->fbcoord, e->v2->fbcoord, LB, LU, &sr, &p_unused) &&
 -      sr < r && sr > 0) {
++  if (lineart_intersect_seg_seg(fbcoord1, fbcoord2, LB, LU, &sr, &p_unused) && sr < r && sr > 0) {
      r = sr;
    }
-   if (lineart_LineIntersectTest2d(fbcoord1, fbcoord2, RB, RU, &sr, &p_unused) && sr < r &&
-       sr > 0) {
 -  if (lineart_intersect_seg_seg(e->v1->fbcoord, e->v2->fbcoord, RB, RU, &sr, &p_unused) &&
 -      sr < r && sr > 0) {
++  if (lineart_intersect_seg_seg(fbcoord1, fbcoord2, RB, RU, &sr, &p_unused) && sr < r && sr > 0) {
      r = sr;
    }
 -  interp_v2_v2v2_db(data, e->v1->fbcoord, e->v2->fbcoord, r);
 +  interp_v2_v2v2_db(data, fbcoord1, fbcoord2, r);
  
    return lineart_get_bounding_area(rb, data[0], data[1]);
  }



More information about the Bf-blender-cvs mailing list