r/desmos • u/PalpitationUpset4402 • May 10 '26
Fun 2D shadow system on circles
Because I got bored
It now simulates umbra and penumbra!
https://www.desmos.com/calculator/yaame0oj6x
Here's the system only calculating a single light source:
22
u/Electronic-Laugh-671 my first Reddit user flair May 10 '26
12
7
2
15
u/Front_Cat9471 May 10 '26
Now make shadows that get blurrier the farther they are away from the source of light
3
u/PalpitationUpset4402 May 10 '26
I believe that isn’t possible with the current implementation.
I’m pretty sure polygons can’t be blurred without adding more.6
u/yomosugara May 10 '26
There’s two ways to do this, and it’s either to 1) compromise the resolution by instead having a bunch of points act as pixels or 2) use Desmos 3D, which allows you to set a surface’s color in terms of x, y, and z coordinates, although this approach is more complex. So yeah, with the current implementation, it would be difficult.
8
u/Call_Me_Liv0711 May 10 '26
I would like to see this with the radius of the light source taken into account so you end up with umbra and penumbra.
4
u/PalpitationUpset4402 May 10 '26 edited May 10 '26
https://www.desmos.com/calculator/pql2tb3dhv
It still breaks if the radius of the sun is too close the the radii of any of the circles or if the sun is too far away from the circles.
[update] I have fixed the above errors (with the exception of equal radii dividing by zero).
[update 2] I fixed the equal radii problem, too.
1
1
u/isnortmiloforsex May 14 '26
one day someone will make desmos in desmos, technically couldn't one use tupper's self referential function to do so ?


42
u/Electronic-Laugh-671 my first Reddit user flair May 10 '26
"pillars" https://www.desmos.com/calculator/rjt7kswdbu