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 thread.
View all comments View context
2 points

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.

permalink
report
parent
reply

Godot

!godot@programming.dev

Create post

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

  • Posts need to be in english
  • Posts with explicit content must be tagged with nsfw
  • We do not condone harassment inside the community as well as trolling or equivalent behaviour
  • Do not post illegal materials or post things encouraging actions such as pirating games

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

!roguelikedev@programming.dev

Credits

  • The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
  • The banner is from Godot Design

Community stats

  • 1K

    Monthly active users

  • 397

    Posts

  • 1.2K

    Comments