godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Turn Reflection Probe's Ambient Color Energy into Ambient Energy #4844

Open mrjustaguy opened 2 years ago

mrjustaguy commented 2 years ago

Describe the project you are working on

N/A

Describe the problem or limitation you are having in your project

Ambient Color Energy only works when the Ambient Mode is set to Constant Color, however there is no reason (that I see) for this energy to not work on Ambient Mode when set to Environment, for More control.

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

Changing Ambient Color Energy into Ambient Energy and applying it to Both Ambient Modes (Constant Color and Environment) would allow for more control, and would be more in line with the World Environment settings.

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

Rename Ambient Color Energy into Ambient Energy Apply value to Both Constant Color and Environment Reflection Probe Ambient Modes

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

No.

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

This is a Tweak to Core.

Calinou commented 2 years ago

Wouldn't this make the Interior property obsolete, since you could set ambient energy to 0 in this case?

mrjustaguy commented 2 years ago

No, as Interior property turns sky into clear color in reflection probe rendering.

mrjustaguy commented 2 years ago

As far as Behavior goes, seems like https://github.com/godotengine/godot/blob/d26442e709f6361af9ac755ec9291bb43f2cd69b/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl#L921 is where this is to be implemented, however unclear if this is just for Clustered renderer only..

Though, looking at it, I don't see what is Color Energy in there, and the Environment/Constant Color seem to be fairly similar, so it seems that the multiplication is going on elsewhere and passing the result, which makes sense, but it is something which wouldn't be possible to do for Environment, as that would have to multiply the energy in the shader.