diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-05-10 16:52:28 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-05-10 16:52:28 +0300 |
commit | d9d81cb1ffa964439630963cd4cd504137c91d20 (patch) | |
tree | dd91b2234beb366f7e5101600623e365bd7ea46e /source/blender/blenkernel/intern/pbvh_pixels.cc | |
parent | b4b85c5ce2752ea9241cbcfa1ddc3f639ad64262 (diff) |
3d texture painting: Use center uv pixel as anchor.
Previously the bottom left of a pixel was used during pixel extraction what resulted in
that the pixels were moved a bit to the bottom left. By using the center uv pixel the
extracted pixels are more balanced and would improve future features like seam bleeding.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_pixels.cc')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_pixels.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc b/source/blender/blenkernel/intern/pbvh_pixels.cc index 5623cac44ac..9ea7f991677 100644 --- a/source/blender/blenkernel/intern/pbvh_pixels.cc +++ b/source/blender/blenkernel/intern/pbvh_pixels.cc @@ -26,7 +26,7 @@ namespace blender::bke::pbvh::pixels { * During debugging this check could be enabled. * It will write to each image pixel that is covered by the PBVH. */ -constexpr bool USE_WATERTIGHT_CHECK = false; +constexpr bool USE_WATERTIGHT_CHECK = true; /** * Calculate the delta of two neighbor UV coordinates in the given image buffer. @@ -71,7 +71,7 @@ static void extract_barycentric_pixels(UDIMTilePixels &tile_data, int x; for (x = minx; x < maxx; x++) { - float2 uv(float(x) / image_buffer->x, float(y) / image_buffer->y); + float2 uv((float(x) + 0.5f) / image_buffer->x, (float(y) + 0.5f) / image_buffer->y); float3 barycentric_weights; barycentric_weights_v2(uvs[0], uvs[1], uvs[2], uv, barycentric_weights); |