Editor: Fix default preview environment sky's horizon and brightness. #99957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #99701
This addresses two issues with the default preview environment's sky. First is the horizon always appearing grey, even when both the sky and ground colors are set to black. Second is the fact that the "Sky Energy" slider only affects the top hemisphere of the sky, while the lower hemisphere's brightness cannot be modified.
The first issue occurs because the horizon color is generated automatically from the sky and ground colors, rather than being exposed to the user. This is desirably convenient of course, except that the horizon color is generated as first a 50/50 blend between the sky and ground colors, and then a 50/50 blend between the result and pure white. This second blend is why the horizon remains grey even when the user would reasonably expect it to be pitch black.
To fix this, the second blend has been replaced by a 50/50 blend with the first blend result's luminance multiplied by 3.333 (an arbitrary value, chosen to maintain roughly the same horizon brightness that the original method produced with the default sky and ground colors).
The second issue is similarly perplexing from a user's perspective; the "Sky Energy" slider modifies the preview sky's
sky_energy_multiplier
rather than itsenergy_multiplier
, meaning that only the upper half of the sky is affected, while the user has no way of modifying theground_energy_multiplier
for the lower half. For the sake of keeping the preview environment's interface simple and quick to use, I've opted to make the slider alter the sky'senergy_multiplier
property, rather than add a second slider for the ground, as I believe the more convenient use of such a slider is to quickly modify the sky's overall brightness, as well as its associated ambient light. I also frankly wouldn't be surprised if the use ofsky_energy_multiplier
instead ofenergy_multiplier
was a mistake from the start, given that its name doesn't necessarily indicate it's specifically for the top of the sky.With sky and ground colors set to pure black:
With "Sky Energy" slider set to
0.25
:With default sky and ground colors: