From 416b9990c8bc8554b1018e67c12d3599b676ff11 Mon Sep 17 00:00:00 2001 From: T0MIS0N Date: Tue, 16 Sep 2025 10:05:24 +0200 Subject: [PATCH] Fix: Artifacting in experimental texture paint on non-manifold meshes When texture painting a non-manifold mesh, various artifacts are created on the image texture. To add seams to the edges of non-manifold UV islands, the texture painting system reads and writes pixels near the edge of the UV islands. The offset calculations used to find pixel positions for reading and writing were not accounting for color channels (RGBA) in the pixel data. Because of this, the reading function corrupted the color data for the seams, and the writing function caused the seams to be scaled down and repeated. Pull Request: https://projects.blender.org/blender/blender/pulls/146110 --- source/blender/blenkernel/BKE_image_wrappers.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/BKE_image_wrappers.hh b/source/blender/blenkernel/BKE_image_wrappers.hh index 877db96d786..56ecc98e7f4 100644 --- a/source/blender/blenkernel/BKE_image_wrappers.hh +++ b/source/blender/blenkernel/BKE_image_wrappers.hh @@ -63,7 +63,7 @@ template struct ImageBufferAccessor { return float4(&image_buffer.float_buffer.data[offset]); } if constexpr ((std::is_same_v)) { - int offset = (coordinate.y * image_buffer.x + coordinate.x); + int offset = (coordinate.y * image_buffer.x + coordinate.x) * Channels; float4 result; rgba_uchar_to_float( result, @@ -80,7 +80,7 @@ template struct ImageBufferAccessor { copy_v4_v4(&image_buffer.float_buffer.data[offset], new_value); } if constexpr ((std::is_same_v)) { - int offset = (coordinate.y * image_buffer.x + coordinate.x); + int offset = (coordinate.y * image_buffer.x + coordinate.x) * Channels; rgba_float_to_uchar( static_cast(static_cast(&image_buffer.byte_buffer.data[offset])), new_value);