KDE-Rounded-Corners
KDE-Rounded-Corners copied to clipboard
Better shadows
Related to #153
Dear @matinlotfali, thank you for this amazing effect! Here is the explained idea for getting more natural shadows. I tried it partially by modifying the shaders and my experiments looks promising, but I'm not so good at shaders (I got good beautiful shadows, but broke corners geometry) so it would be cool if you could make the changes.
Basically, we want to draw the shadow like it's dropped by rectangle which is smaller by X (red arrow) units on all its sides and shifted down by Y (blue arrow) units. It would be cool to get these (X, Y) parameters adjustable in UI.
P.S. I know, it's still far from ideal natural shadow, but at least it's a good approximation.
@zezic From your image, if the outline radius is r
, can you tell me how long are the red and green arrows? Are they both r
?
@matinlotfali
Here's my implementation of this issue, the length of u
,v
is 1
, radius of OutlineRadius
is sqrt(pi)
, so I think it's r*r/pi
. However it should be customizable
Here's some other thing I want to add
@zezic @0xarch Is #244 what you had in mind?