Skip to content

Add a correction range to auto exposure - #25799

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
stuartparmenter:feat/auto-exposure-correction-range
Sep 20, 2026
Merged

alice-i-cecile merged 2 commits into
bevyengine:mainfrom
stuartparmenter:feat/auto-exposure-correction-range

Conversation

@stuartparmenter

@stuartparmenter stuartparmenter commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Objective

Add AutoExposure::correction_range so 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::range for 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_range clamps 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.0 disables 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::ev100 at 4.5, a correction range of -0.5..=0.5 gives effective EV100 limits of 4–5. To carry over UE's +1 stop bias, set a constant compensation of 1.0 and shift the correction range to 0.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!

@stuartparmenter
stuartparmenter force-pushed the feat/auto-exposure-correction-range branch from c213d03 to 3c36b36 Compare September 15, 2026 18:27
@stuartparmenter stuartparmenter added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 15, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Sep 15, 2026
Comment thread crates/bevy_post_process/src/auto_exposure/settings.rs Outdated
Comment thread crates/bevy_post_process/src/auto_exposure/settings.rs Outdated
@Zeophlite Zeophlite added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 19, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Sep 20, 2026
Merged via the queue into bevyengine:main with commit 8fbd91a Sep 20, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants