Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Physical Directional Light Color #4347

Closed
mrjustaguy opened this issue Apr 5, 2022 · 3 comments
Closed

Implement Physical Directional Light Color #4347

mrjustaguy opened this issue Apr 5, 2022 · 3 comments

Comments

@mrjustaguy
Copy link

Describe the project you are working on

Day Night Cycle

Describe the problem or limitation you are having in your project

The Physical Sky starts turning orange as the sun approaches the horizon, but the light it gives out is still white

Describe the feature / enhancement and how it helps to overcome the problem or limitation

By using the same logic used to determine the Background Sun's color with Physical Sky, use the result to change the Light Color, for significantly more accurate lighting, for basically free.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Unable to answer this well, as I don't understand how the Physical Sky works and how to link it with Directional Light's output Color.

On the UI side of things, it'd make sense to have an enum that is set to Auto detect by default, and has Physical and Constant light modes that it uses.
If Physical Sky is used Auto detect will switch to Physical, else keep Constant light.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes, by adding a directional light to only be light, and one only for the sky, and changing the light color of the light, but that is not an easy task.

Is there a reason why this should be core and not an add-on in the asset library?

Rendering is Core.

@Calinou
Copy link
Member

Calinou commented Apr 5, 2022

Related to #4257.

I think that in practice, you probably don't want to use the exact same color as the PhysicalSkyMaterial's sun for your DirectionalLight3D. It will probably look wrong in most cases.

@lufog
Copy link

lufog commented Apr 7, 2022

If I understand the problem correctly. A custom gradient could be added, the value of which shifted depending on the position of the sun. In this way, lighting can be adjusted, from realistic to specific / stylized.

@Calinou
Copy link
Member

Calinou commented Sep 1, 2022

As per clayjohn's comment on the Godot Contributors Chat, now that #4257 has been implemented, you can adjust the DirectionalLight3D's color temperature depending on its angle. This should be easy to do in your day-night cycle script – no more Gradient resource is required.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants