[Bf-blender-cvs] [f43a9e6c65f] temp-T97352-3d-texturing-seam-bleeding: Use constant for distance.

Jeroen Bakker noreply at git.blender.org
Fri Apr 22 16:01:17 CEST 2022


Commit: f43a9e6c65f6c43451866dc53d21e0e908775b65
Author: Jeroen Bakker
Date:   Fri Apr 22 14:29:31 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBf43a9e6c65f6c43451866dc53d21e0e908775b65

Use constant for distance.

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

M	source/blender/blenkernel/intern/pbvh_pixels_seams.cc

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

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index fbb0c0bf15b..4f9ecef9b78 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -18,6 +18,9 @@
 
 namespace blender::bke::pbvh::pixels {
 
+/* Distance between a pixel and its edge that will be fixed. Value is in pixels space. */
+constexpr float SEAMFIX_EDGE_DISTANCE = 3.5f;
+
 struct EdgeLoop {
   /** Loop indexes that form an edge. */
   int l[2];
@@ -320,7 +323,7 @@ static void build_fixes(PBVH &pbvh,
 
       /* Distance to the edge in pixel space. */
       float distance_to_edge = len_v2v2(closest_coord, uv_coord);
-      if (distance_to_edge > 3.0f) {
+      if (distance_to_edge > SEAMFIX_EDGE_DISTANCE) {
         continue;
       }
 
@@ -444,7 +447,7 @@ static void build_fixes(
       float2 closest_coord(closest_point.x * bitmap.resolution.x,
                            closest_point.y * bitmap.resolution.y);
       float distance_to_edge = len_v2v2(uv_coord, closest_coord);
-      if (distance_to_edge > 3.0f) {
+      if (distance_to_edge > SEAMFIX_EDGE_DISTANCE) {
         continue;
       }



More information about the Bf-blender-cvs mailing list