[Bf-blender-cvs] [428b1134b54] temp-T97352-3d-texturing-seam-bleeding-b2: Use smaller resolution for masks.
Jeroen Bakker
noreply at git.blender.org
Tue Sep 6 09:12:24 CEST 2022
Commit: 428b1134b54f24cc1c43fa1048c0ad804b8b997f
Author: Jeroen Bakker
Date: Mon Sep 5 13:04:48 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB428b1134b54f24cc1c43fa1048c0ad804b8b997f
Use smaller resolution for masks.
===================================================================
M source/blender/blenkernel/intern/pbvh_pixels.cc
M source/blender/blenkernel/intern/uv_islands.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc b/source/blender/blenkernel/intern/pbvh_pixels.cc
index faf56fb7b8d..69af01b21fa 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -364,8 +364,6 @@ static void update_pixels(PBVH *pbvh, Mesh *mesh, Image *image, ImageUser *image
pbvh->looptri, pbvh->totprim, pbvh->totvert, pbvh->mloop, ldata_uv);
uv_islands::UVIslands islands(mesh_data);
- // TODO: mask resolution should be based on the actual resolution of the image buffer (or a
- // factor of it).
uv_islands::UVIslandsMask uv_masks;
ImageUser tile_user = *image_user;
LISTBASE_FOREACH (ImageTile *, tile_data, &image->tiles) {
diff --git a/source/blender/blenkernel/intern/uv_islands.cc b/source/blender/blenkernel/intern/uv_islands.cc
index e32813c6712..3e43b9e646f 100644
--- a/source/blender/blenkernel/intern/uv_islands.cc
+++ b/source/blender/blenkernel/intern/uv_islands.cc
@@ -879,9 +879,13 @@ void UVIslands::extend_borders(const UVIslandsMask &islands_mask)
/* -------------------------------------------------------------------- */
/** \name UVIslandsMask
* \{ */
-constexpr ushort2 mask_resolution_from_tile_resolution(ushort2 tile_resolution)
+
+static ushort2 mask_resolution_from_tile_resolution(ushort2 tile_resolution)
{
- return tile_resolution;
+ return ushort2(
+ max_ii(tile_resolution.x >> 2, 256),
+ max_ii(tile_resolution.y >> 2, 256)
+ );
}
UVIslandsMask::Tile::Tile(float2 udim_offset, ushort2 tile_resolution)
More information about the Bf-blender-cvs
mailing list