Brush Design Question

Discuss features and report problems with BlackInk
riddlez
 
Posts: 6
Joined: 06 Dec 2017, 23:15

Brush Design Question

Postby riddlez » 06 Dec 2017, 23:34

Hi,

New to the forums and digital art. I have Black Ink on Steam (PC) and a Parblo Island A609 Tablet. Both are working fine. I am PhD Engineering student, so I apologize in advance if my questions are too specific.

Questions:
What do typical brush inputs range from? Are they an absolute number, or is it scaled. Scaled meaning: does pressure range from 0-1 at increments of 1/2048 (2048 the pressure level my tablet is spec'd for)? Is this the same for tilt (i.e. does tilt go from 0 to 1, incremented by 1/60, or w/e my tilt sensitivity is?).

I ask because I'm trying to get a better sense of the relative scales/magnitudes of the functions will relate to the inputs. I.e. if I use the multiply block to multiply 2 by pressure, what numbers am I really multiplying and how does it interpret it for modifying a pressure sensitive color option? Assuming it's scaled, would multiplying by two have the effect that the output would a ramp from 0-1 then for pressures from 0-0.5, and then "ceiling" of 1 for pressures 0.5-1?

Alternatively, if you have documentation math-inclined users, and I just couldn't find it, that'd be cool with me.

Thanks!
Riddlez.

User avatar
u2bleank
 
Posts: 1183
Joined: 11 Jun 2012, 10:41

Re: Brush Design Question

Postby u2bleank » 07 Dec 2017, 09:24

hi riddlez,

Good technical questions ;)

What do typical brush inputs range from? Are they an absolute number, or is it scaled. Scaled meaning: does pressure range from 0-1 at increments of 1/2048 (2048 the pressure level my tablet is spec'd for)? Is this the same for tilt (i.e. does tilt go from 0 to 1, incremented by 1/60, or w/e my tilt sensitivity is?).


Pressure :
This value is normalized [0,1] by the range given by the Tablet ( sometimes it can be 1024, 2048 or any value given by the driver )

Tilt :
The range value is [0,PI/2]. this can also be defined as stylus altitude ( see for more infos )
For this parameter driver sometimes doesn't return the full range possible..
Anyway open the Preference TAb and look at the graphs to see how parameter react in live :

Azimuth :
The range is [0,2PI]

Image


Alternatively, if you have documentation math-inclined users, and I just couldn't find it, that'd be cool with me.


We are currently working in a new Online Documentation with better parameter explanation.
For the moment , don't hesitate to ask any questions ;)

riddlez
 
Posts: 6
Joined: 06 Dec 2017, 23:15

Re: Brush Design Question

Postby riddlez » 07 Dec 2017, 19:56

Thanks for the quick reply! :D

This question is a bit convoluted... so please bare with me :thanx:

When I apply more than 70% pressure on my stylus, I can feel the nib wearing uncomfortably. :alarm:

To test what I can do to adjust the feel of the brush, I was playing with the Tail Default brush, and only modifying the pressure-colour part.

I found that the solution that worked best was use Cubic Ease In/Out (Pressure), and to lower the position of the upper colour from 100% down to 70%. This gave me a rescaled Cubic Ease In/Out() function for pressures from [0,0.7], and max value from for pressures from [0.7,1]

From some quick play with size, I do not think this solution will carry over to other variables. From what I can understand, pressure is scaled from [0,1], so are any functions that dependent on it. This is so that f(Pressure) can be multiplied with the parameter they are modifying, such as colour or size. Meaning, if this is correct, f(Pressure)*pxSize is how the final size is calculated. If that's true, the solution for colour gradient does not carry over to variables like size because you cannot set a threshold value for Size, Opacity, etc. This can be rectified by setting the pxSize values to values that are ~43 % larger (100/70) than I need, but I lose the convenience of having a hard upper bound. :| This would also unsolvable for brush elements that range from 0-100%, because I can't set opacity to 143% so that at 70% pressure I get 100% opacity. :desperate:

I tried multiple function only solutions to avoid this issue. However, I found I would be losing too much sensitivity at the lower end, by improving the sensitivity of the higher end (i.e. Power Ease Out(Pressure), or Cubic Ease In/Out (Power Ease Out(Pressure)); the latter making the effects of the former on lower pressure worse :cry:).

The big question then becomes: is there a way to rescale the cubic function so that it applies something like Cubic Ease In/Out pressure [0,Threshold], and Ceiling from [Threshold, 1]? Or more complex, create an asymmetric Cubic Ease In/Out function? Or even more complex make a compound function of Power Ease In and Power Ease Out such as:

-Power A Ease In [0,0.3)
-Linear Matching Function [0.3,0.7]
-Power B Ease Out (0.7,1]
--Where A and B are arbitrary values for the power functions; in this case B > A such that 70% pressure gives 95-99% output
--Where Matching function is a linear function that is calculated such that Power A Ease In [0,0.3) + Linear Matching Function [0.3,0.7] + Power B Ease Out (0.7,1] is continuous?

Riddlez

User avatar
u2bleank
 
Posts: 1183
Joined: 11 Jun 2012, 10:41

Re: Brush Design Question

Postby u2bleank » 08 Dec 2017, 09:18

What you need is a remap function which say "the interval [a,b] mean [0,1]"
This operator is currently missing from Black Ink but you can create it by hand like this :

$this->bbcode_second_pass_code('', '
float remap( float value, float minr, float maxr )
{
return saturate( (value-minr) / (maxr-minr) );
}
')

by consequence in controller this gives you :
Image

with :
Sub - Input B = minr
Div - input B = (maxr-minr )
Clamp - Min = 0
Clamp - Max = 1

Then you can plug the output to whatever you want ( the ease curve if you like it )

Hope it answer you request ;)

riddlez
 
Posts: 6
Joined: 06 Dec 2017, 23:15

Re: Brush Design Question

Postby riddlez » 08 Dec 2017, 14:12

I appreciate the reply!

Seeing this helped a lot -just gotta use the basic functions like a calculator. :)

I ended up doing:

Pressure --> Div --> Clamp, where the Div value was 0.7. I.e. Output = Pressure/0.7, where I only take values from [0,1] (the clamp function).

I did this just to rescale the input, so I don't omit/dampen an entire a range (by subtracting or adding minr).

Tyvm, now I got a lot to fiddle with for my project. :mocking: :desire:

riddlez
 
Posts: 6
Joined: 06 Dec 2017, 23:15

Re: Brush Design Question

Postby riddlez » 09 Dec 2017, 19:20

Just a side note, thought of when I woke.

Basically used solution provided by u2bleank, with minr = 0, and maxr = 0.7. I was just looking at the problem from a different angle that didn't consider a need/use for minr. It's like the context button for the features where you can select the min and max size for pressure variance, which I didn't see until I watched Tutorial 02.


Return to Technical support

cron