Godot Documentation: Lights and Shadows in 2D

in #utopian-io6 years ago




Many new users to Godot have difficulty utilizing features that may seem straightforward to more experienced users. To address this, Godot has a github repository filled with demos. This is helpful for many people, but there are still lots of people who have trouble learning from code. The obvious solution was to create documentation that would not only explain how the feature works, but also how the demo works. The goal is that new users can use the example as a jumping-off point for personal projects but also have access to the documentation so they can understand anything they are having trouble with.

The Lights and Shadows 2D tutorial explains how the lighting system works in 2D in Godot by going step-by-step through the lights and shadows demo. Lighting in 2D is very different from 3D lighting, which is more intuitive, and it is fairly unique. Essentially the way lights work in 2D in Godot is that you take a sprite that looks like this:

give it a color and overlay it on the scene like this:

The colors add together to add light to the scene. Thats all there is to it. Just some clever sprites and additive blending.

Shadows are a bit more complex to implement; however, Godot makes it very easy. All you have to do is add LightOccluder2Ds to the scene and Godot will cast the shadows for you.


The tutorial covers multiple node types including:

With these basic nodes you can implement light and shadows easily in 2D in Godot!



GitHub Proof of Authorship


Hey @clayjohn,

Its great to see a contribution from you after some time.

I have seen your dedication towards this project and your continuous efforts to make it better through documentation.

And this is also one high-quality contribution from you.

There are not a lot of points of improvements in the post, Except the formatting can be done a bit better but it's still a great contribution as it has the real work done where it should be done.

It may not be a staff pick but its surely a worthy mention on our Top of Utopian this week.

Looking for more awesome contribution from you in future.

Good Luck! Keep contributing.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.

I appreciate the kind words. I have been dedicating a lot of time over the last few months to Godot and I'm glad it shows.

Thank you for your review, @ms10398!

So far this week you've reviewed 2 contributions. Keep up the good work!

Hey @clayjohn
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi @clayjohn! We are @steem-ua, a new Steem dApp, computing UserAuthority for all accounts on Steem. We are currently in test modus upvoting quality Utopian-io contributions! Nice work!

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.033
BTC 62986.12
ETH 3072.14
USDT 1.00
SBD 3.84