[Bf-blender-cvs] [498e26fa0f6] blender-v3.3-release: Fix T100138: Use `double` for LineArt intersection record.

YimingWu noreply at git.blender.org
Fri Aug 12 12:16:11 CEST 2022


Commit: 498e26fa0f6486fa2d3bb0029b11eb1dc48a32be
Author: YimingWu
Date:   Fri Aug 12 15:38:26 2022 +0800
Branches: blender-v3.3-release
https://developer.blender.org/rB498e26fa0f6486fa2d3bb0029b11eb1dc48a32be

Fix T100138: Use `double` for LineArt intersection record.

The use of `float` for intermediate intersection record led to some
inaccuracy which caused flickering in intersection lines. Now fixed.

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

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 011c79025c4..9970e4d5ac1 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -50,7 +50,7 @@
 #include "lineart_intern.h"
 
 typedef struct LineartIsecSingle {
-  float v1[3], v2[3];
+  double v1[3], v2[3];
   LineartTriangle *tri1, *tri2;
 } LineartIsecSingle;
 
@@ -3285,8 +3285,8 @@ static void lineart_add_isec_thread(LineartIsecThread *th,
     th->array = new_array;
   }
   LineartIsecSingle *isec_single = &th->array[th->current];
-  copy_v3fl_v3db(isec_single->v1, v1);
-  copy_v3fl_v3db(isec_single->v2, v2);
+  copy_v3_v3_db(isec_single->v1, v1);
+  copy_v3_v3_db(isec_single->v2, v2);
   isec_single->tri1 = tri1;
   isec_single->tri2 = tri2;
   if (tri1->target_reference > tri2->target_reference) {
@@ -4582,8 +4582,8 @@ static void lineart_create_edges_from_isec_data(LineartIsecData *d)
       LineartIsecSingle *is = &th->array[j];
       LineartVert *v1 = v;
       LineartVert *v2 = v + 1;
-      copy_v3db_v3fl(v1->gloc, is->v1);
-      copy_v3db_v3fl(v2->gloc, is->v2);
+      copy_v3_v3_db(v1->gloc, is->v1);
+      copy_v3_v3_db(v2->gloc, is->v2);
       /* The intersection line has been generated only in geometry space, so we need to transform
        * them as well. */
       mul_v4_m4v3_db(v1->fbcoord, ld->conf.view_projection, v1->gloc);



More information about the Bf-blender-cvs mailing list