Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-04-25 02:07:09 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-05-04 16:41:28 +0300
commit0a1fbfee2ba51e88436fd9c1ab4d349f97c47491 (patch)
tree2a773fa93fb9aa28a0cf52010166154455e226b1 /source/blender
parent31ba1869831dcf580c69b318da1e63a744f71f97 (diff)
Tweak the pressure/size dynamic range of Clay Strips
The current clay strips brush has a huge dynamic range which is nice for certain effects, but in some pen tablets it is quite hard to control on the higher values and it ends up producing unwanted artifacts. This changes the input curves a bit in an attempt to make it more controllable. After adding a brush management system I will expose all these values to be configurable per brush (the round version of clay strips is a little bit better with different curves, but that is something that we can't support now), but for now this default are probably safer. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7524
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 7bd7714b725..ce5433f680e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2100,7 +2100,7 @@ static float brush_strength(const Sculpt *sd,
return alpha * pressure * overlap * feather * 2.0f;
case SCULPT_TOOL_CLAY_STRIPS:
/* Clay Strips needs less strength to compensate the curve. */
- final_pressure = pressure * pressure * pressure;
+ final_pressure = powf(pressure, 1.5f);
return alpha * flip * final_pressure * overlap * feather * 0.3f;
case SCULPT_TOOL_CLAY_THUMB:
final_pressure = pressure * pressure;
@@ -4624,7 +4624,7 @@ static void do_clay_strips_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int t
const bool flip = (ss->cache->bstrength < 0.0f);
const float radius = flip ? -ss->cache->radius : ss->cache->radius;
const float offset = SCULPT_brush_plane_offset_get(sd, ss);
- const float displace = radius * (0.25f + offset);
+ const float displace = radius * (0.18f + offset);
/* The sculpt-plane normal (whatever its set to). */
float area_no_sp[3];
@@ -6189,7 +6189,7 @@ static float sculpt_brush_dynamic_size_get(Brush *brush, StrokeCache *cache, flo
case SCULPT_TOOL_CLAY:
return max_ff(initial_size * 0.20f, initial_size * pow3f(cache->pressure));
case SCULPT_TOOL_CLAY_STRIPS:
- return max_ff(initial_size * 0.30f, initial_size * pow2f(cache->pressure));
+ return max_ff(initial_size * 0.30f, initial_size * powf(cache->pressure, 1.5f));
case SCULPT_TOOL_CLAY_THUMB: {
float clay_stabilized_pressure = sculpt_clay_thumb_get_stabilized_pressure(cache);
return initial_size * clay_stabilized_pressure;