+1 vote

Hi, I have a question about Lighting. (Translated from Japanese by DeepL. The grammar may be wrong.)
I would like to apply lighting to a billboard. I'm trying to make the lighting look natural, not just lit.

An example of the ideal lighting I'm aiming for is Paper Mario 64.
This billboard only gets brighter in one area where the lights are, while the rest of the billboard remains dark. This means that we need a shader that uses lights.
However, the shadow on the feet is not the shadow of the billboard, but the shadow of the circle.

In realizing this, we faced two problems.

When I set the mesh for the cast shadow to shadows only at the same location as the billboard, the billboard also receives the shadow.

So if I turn off the lighting on the billboard, I can't handle the light information in the shader and can't do my own lighting.

In other words, what I want to do is
I want to make it so that only certain shadows are not affected, like the physics layer.
Or
I want to use a fragment shader or vertex shader with "render_mode unshaded;" to get the light information.
Or if there is another solution.

Godot version 3.4
in Engine by (25 points)

1 Answer

0 votes

Hey! If I understand correctly, you need to keep part of the billboard unlit. For this, you can use a normal map. Add a normal map to the billboard texture, then add light. In this case, only the part of the billboard that the map allows will be illuminated.

enter image description here

If you have difficulties with creating normal maps, you can use the SpriteIlluminator application (it is paid, but there is a trial period).

Also, if you want to soften the lighting of the elements, you can use the light levels shading. A detailed tutorial on how to write and use it here: https://godotshaders.com/shader/cel-toon-shading-for-2d-sprites/

There is also another way. You can split your billboard into two sprites and use light masks to add or exclude elements in light groups.

enter image description here

I hope that I saw the problem correctly and could help you :-) Good luck!

by (97 points)
edited by

Thank you for your reply and support! I may have misspoken a bit.
It's not "the way the light hits" but "the way the shadow hits.

Please look at this image. Do you get the idea?
enter image description here
I don't want the billboard to receive physical light and dark, but I want to add light and dark using shaders.
I know how to write shaders to a certain extent, but I'm looking for a way to handle the light information while still disabling receive shadows.

Also, Node2d has it, but Spatial, Sprite3D, etc. don't have a Canvas item and can't handle light masks.
If 3D nodes also had light masks, it would solve everything...

Sorry, I didn't understand that we talking about 3D from the description :(

I'm not sure how to make "honest" shadows in this case because I don't know much about 3D in Godot...

I would add one light above your character's head and move it with him. In this case, you can turn off the shadows from other light sources to get the picture you want. But this is a bad solution. I'm sorry I couldn't help you :'(

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.