KDE-Rounded-Corners icon indicating copy to clipboard operation
KDE-Rounded-Corners copied to clipboard

Better shadows

Open zezic opened this issue 10 months ago • 1 comments

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 avatar Mar 27 '24 19:03 zezic

@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 avatar Mar 27 '24 20:03 matinlotfali

@matinlotfali Image

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

0xarch avatar Jun 17 '24 07:06 0xarch

图片 Here's some other thing I want to add

0xarch avatar Jun 21 '24 10:06 0xarch

@zezic @0xarch Is #244 what you had in mind?

matinlotfali avatar Jun 24 '24 05:06 matinlotfali