0 votes

How can I write a light shader that outputs the exact same color as defined by the scenes directional light?

The following simple script will not result in accurate colors.

shader_type spatial;

void light() {
    DIFFUSE_LIGHT = LIGHT_COLOR;
}

The world environment has no background, ambient light or reflected light.

I am aware that LIGHT_COLOR is the light's color multiplied by the energy. But with the energy set to 1, I would expect it to be the same as the directional light's color.

Converting LIGHT_COLOR from linear to the sRGB color space does not help.

Godot version v4.0.alpha6.official
in Engine by (1,107 points)
edited by

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.