Add a correction range to auto exposure - #25799
Merged
alice-i-cecile merged 2 commits intoSep 20, 2026
Merged
alice-i-cecile merged 2 commits into
alice-i-cecile merged 2 commits into
Conversation
stuartparmenter
force-pushed
the
feat/auto-exposure-correction-range
branch
from
September 15, 2026 18:27
c213d03 to
3c36b36
Compare
alice-i-cecile
approved these changes
Sep 15, 2026
Zeophlite
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Add
AutoExposure::correction_rangeso users can limit how much auto exposure brightens or darkens the image.UE has Min/Max EV100 settings for this, separate from the histogram range. Bevy has
AutoExposure::rangefor the histogram, but no separate control for how much auto exposure adjusts the image.This came up while loading NVIDIA's Zorah scene from Unreal assets, where GreenHouse uses a narrow exposure range.
Solution
Bevy's auto exposure adds a correction to the camera's existing exposure during color grading.
correction_rangeclamps that correction in stops instead of using UE's absolute Min/Max EV100 controls. Positive values brighten the image and negative values darken it.The default leaves the correction unlimited. Setting
0.0..=0.0disables the automatic correction. The correction starts inside the range and is clamped after smoothing so it stays within the limits.Compensation works a little differently too. UE adds exposure bias after clamping. Bevy's new range includes the compensation from
compensation_curve, so when converting UE settings, add the bias to both the compensation and the correction limits.For example, with the camera's
Exposure::ev100at 4.5, a correction range of-0.5..=0.5gives effective EV100 limits of 4–5. To carry over UE's +1 stop bias, set a constant compensation of1.0and shift the correction range to0.5..=1.5. The effective limits become EV100 3–4, making the image one stop brighter across the range.Testing
Built tests that step between bright and dark inputs and check that exposure changes gradually while staying inside the range. Also checked fixed corrections, changes to the range, exposure compensation, and that the default produces the same results as before.
Checked the converted settings from Zorah's GreenHouse, ThroneRoom, and Restir levels, including extra exposure bias.
This was AI w/ Fable 5.1 and Astra as part of my work to get the Zorah scene working. It was found as I was looking at how to use all of the values from the assets and noticed there was no way to do this. This required a few iterations to get to the final state since UE's built in bias is not obvious, but was tested both in the scene and with some standalone tests to validate that it is correct. Reviewed, cleaned up, opened PR!