
Simple 2D single-line shadow system for polygons
A few months ago I made a shadow system for circles, but I didn't figure out a way to do it with polygons.
Turns out I was overthinking it and it's actually way easier than the circles one.
This system works perfectly for convex polygons of any size, but because it basically simulates translucent shapes (drawing a seperate shadow for each side), it doesn't look quite as good with concave polygons.
The shadows shrink when the light source "sun" is close to the points they are cast from. I haven't worked on fixing this yet.
[Link]