[Bf-blender-cvs] [df5e02ec476] temp-texture-painting-gpu: Select the correct shader variation for circle falloff.

Jeroen Bakker noreply at git.blender.org
Tue Oct 4 11:32:09 CEST 2022


Commit: df5e02ec4767d8cc8d13f12544a94923bae1b1ef
Author: Jeroen Bakker
Date:   Tue Oct 4 11:31:46 2022 +0200
Branches: temp-texture-painting-gpu
https://developer.blender.org/rBdf5e02ec4767d8cc8d13f12544a94923bae1b1ef

Select the correct shader variation for circle falloff.

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

M	source/blender/editors/sculpt_paint/sculpt_paint_image.cc

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index 29cd5d1e5cd..7e3ac5ed51e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -647,13 +647,23 @@ static void ensure_gpu_buffers(TexturePaintingUserData &data)
   }
 }
 
+static BrushVariationFlags determine_shader_variation_flags(const Brush &brush)
+{
+  BrushVariationFlags result = static_cast<BrushVariationFlags>(0);
+  if (brush.falloff_shape == PAINT_FALLOFF_SHAPE_TUBE) {
+    result = static_cast<BrushVariationFlags>(result | BRUSH_TEST_CIRCLE);
+  }
+  return result;
+}
+
 static void gpu_painting_paint_step(TexturePaintingUserData &data,
                                     GPUSculptPaintData &batches,
                                     TileNumber tile_number,
                                     ImBuf *image_buffer,
                                     int2 paint_step_range)
 {
-  GPUShader *shader = SCULPT_shader_paint_image_get(BRUSH_TEST_SPHERE);
+  BrushVariationFlags variation_flags = determine_shader_variation_flags(*data.brush);
+  GPUShader *shader = SCULPT_shader_paint_image_get(variation_flags);
 
   batches.ensure_tile_texture(int2(image_buffer->x, image_buffer->y));
   bool texture_needs_clearing = true;



More information about the Bf-blender-cvs mailing list