Godot Version
v4.3.stable.official [77dcf97d8]
Question
I’m trying to make my 2D world pitch black except for PointLight2D
sources. I can’t work out how to remove the ambient or default lighting. How can I do this?
What I’ve Done
I’ve made a new Environment
and set ambient_light_source
and reflected_light_source
to disabled
, and background_energy_multiplier
to zero. All other settings in the Environment
are left as default.
I then went to Project Settings > rendering/environment/defaults
and set default_clear_color
to BLACk and default_environment
to my Environment
resource.
This seems to have made absolutely no difference to the scene being displayed in the editor or at run time.
What piece of the puzzle am I missing?
If it matters, I have a Camera2D
and I have just added a WorldEnvironment
node to the scene with the same Environment
resource.
I just edited the Environment
to turn on ambient lighting:
ambient_light_source
: Color
ambient_light_color
: RED
ambient_light_energy
: 10
This made no difference to the visuals. I’m obviously missing a “turn on the lighting effects” setting somewhere, but I don’t know where.
Also, what is the difference, if any, between setting the environment in Project Settings
versus in a WorldEnvironment
in the scene, other than Project Settings
applying to the entire project and WorldEnvironment
applying only to the scene?
Can you share your scene tree and a view of the game?
Scene Tree:
Straight forward. I’m early in prototyping so everything is currently in the one scene.
Screen shot:
The tile map correctly occludes the light source. But everything beyond the circle is still fully visible.
Desired outcome:
(approximately)