Hello, I'm wondering if anyone can explain this Directional Light behavior.

Godot Version: 3.2.1

I'm using the shader below on a sphere. The shader uses the vertex and fragment shader simply to override the built-in Godot shaders, and disables ambient lighting. Also, there is a blank WorldEnvironment node in the SceneTree, so in theory there's no light affecting the sphere from the environment.

The light shader assigns a constant color to DIFFUSE_LIGHT making the sphere dark red. Notice I'm not using +=, so the color should be constant no matter how many lights are in the scene.

However, when I add multiple directional lights, each seems to increase the brightness of the sphere. This effect only occurs with directional lights, not omni or spot lights.

I would like to know why and how to stop it.

If I can figure this out, the next version of my Cel Shader might be able to use multiple directional lights.

shader_type spatial;
render_mode ambient_light_disabled;

void vertex() {VERTEX = VERTEX;}

void fragment() {ALBEDO = vec3(0.0, 0.0, 0.0);}

void light()
{
	DIFFUSE_LIGHT = vec3(0.1, 0.0, 0.0);
}

Sphere with one directional light...

Sphere with five directional lights...

The way I understand Godot's rendering pipeline, each directional light is processed in consecutive additive passes. No matter what you do in the light shader, they will always add on top of each other.

3 years later