MaLiang
MaLiang copied to clipboard
Brush size and opacity?
Can you tell me if I am doing something wrong in trying to set opacity, or if it is a bug?
The initialization of opacity on the brushes seems to depend on the brush, even though the color is set by taking the current color and applying the opacity (0 to 1) to it. Setting the opacity on a slider I can't seem to get it to change linearly. For example if I go from 0.3 to 0.00005 there isn't a smooth transparency change.
Additionally, brush size seems to affect the appearance of the opacity. On procreate, for example, a large brush and small brush with the same opacity drawn over white would appear the same. That doesn't appear to be the case here.
Thanks for your help. Amazing library.
@ViaJables Yes, It's a bug. The logic about opacity is a bit messy, I'm trying to resolve this.
I'll buy you two cups of coffee when you do
@ViaJables try the new 2.8.0 release, different brush sizes will have similar opacity now
This is looking much much better. What should the opacity ranges be?
Try drawing a blue, then choose a darker blue. If you set the opacity low enough (less than 0.3ish) and draw over the first blue it will actually change the color of the underlying blue instead of building up the slightly darker blue like you'd expect. Is that from setting the opacity too low or a side effect of the new math?
Current solution is simple and not perfect, your situation is one of the side effect. It seems that the low opacity effects the rbg value passing to Metal, I'm not very sure why. Maybe I will need to change some logic from the bottom.
The solution actually works pretty well until you get brush sizes greater than 50. It degenerates completely around 200.
Which I guess means, the opacity of brushes still depends on brush size . . .
Yes, because the difference of brush size will cause the overlapping of textures change, so the actual opacity set to the texture should be calculated from the user specified alpha, the brush size and the point step. This actual opacity value often will be a very small number, and the accuracy will be effected here.
Is altering the opacity according to those three variables the solution that you are recommending? I can look into implementing that. Unfortunately, the artists I have testing my app are telling me the current solution isn't suitable for digital drawing as opacity is a foundational tool.
Also you can play with blending modes, I'll try that now