How do you make untextured Polygon2D cast small shadows? - eviltoast

I’m thinking about making a character entirely out of Polygon2D nodes without textures. One thing I haven’t figured out how to do is make each polygon cast a “permanent” shadow on top of the ones that are Z levels below it.

Below is an image of what I want to do, but using shaders/lights. I’ve only managed to do this by making extra polygons to fill in as the shadows.

How exactly do I have to set up a light source to achieve this effect? Using a DirectionalLight2D or a PointLight2D just brightens the polygons and I can’t figure how to use a LightOccluder2D, or even if this is the correct way to get this result

(The polygons are green due to the DirectionalLight being green) - The occlusion simply applies the shadow on anything that is Z levels below it.

  • I Cast Fist@programming.devOP
    link
    fedilink
    arrow-up
    4
    ·
    3 months ago

    That’s exactly the kind of thing that I need, just a shame I need to have a texture on the polygon and, code as is, it offsets the texture a lot compared to the polygon’s center. While not “ideal”, I can probably work with this, though creating anything other than squares will be quite a pain if I don’t use large textures, due to the zoom level of Godot’s UV editor

    I’ll mess around and see if I can get it to work as I want until a more definitive solution shows up, thanks!