diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-04-15 13:00:02 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-04-15 13:00:02 +0300 |
commit | 9852c6cf631567782d3ea018bfe5097accefb3d0 (patch) | |
tree | 94f1f2e9ca19499d4d7ea49b8d20cde205afe504 /source/blender/editors/sculpt_paint/sculpt_paint_image.cc | |
parent | c627d7ede2543f9ac2c9c32c83c7cf8ddd7f2460 (diff) |
Only store 2 components of barycentric coordinates.temp-T96710-pbvh-pixels
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_paint_image.cc')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_paint_image.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc index da8758b1f20..082ff6260c2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc @@ -247,15 +247,18 @@ template<typename ImageBuffer> class PaintingKernel { } float3 init_pixel_pos(const TrianglePaintInput &triangle, - const float3 &barycentric_weights) const + const float2 &barycentric_weights) const { const int3 &vert_indices = triangle.vert_indices; float3 result; + const float3 barycentric(barycentric_weights.x, + barycentric_weights.y, + 1.0f - barycentric_weights.x - barycentric_weights.y); interp_v3_v3v3v3(result, mvert[vert_indices[0]].co, mvert[vert_indices[1]].co, mvert[vert_indices[2]].co, - barycentric_weights); + barycentric); return result; } }; |