this post was submitted on 30 Aug 2024
1 points (100.0% liked)

Godot

5855 readers
4 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

[email protected]

Credits

founded 1 year ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 2 months ago

FWIW I was trying to do something like this and ended up with pretty much what you describe - some custom shading to get everything working.