Skip to content

Fix AutoExposure and ColorGrading stopping working when Tonemapping is set to None#23522

Open
momoluna444 wants to merge 1 commit intobevyengine:mainfrom
momoluna444:fix-tonemapping-none
Open

Fix AutoExposure and ColorGrading stopping working when Tonemapping is set to None#23522
momoluna444 wants to merge 1 commit intobevyengine:mainfrom
momoluna444:fix-tonemapping-none

Conversation

@momoluna444
Copy link
Copy Markdown
Contributor

Objective

Fix AutoExposure and ColorGrading stopping working when Tonemapping is set to None.

Solution

Removed the early return in the tonemapping pass.

Testing

Now auto_exposure and color_grading are working even with Tonemapping::None.

if *tonemapping == Tonemapping::None {
return;
}
// NOTE: Do not return early when tonemapping is set to None, as color grading
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead check that color grading and exposure are enabled? I don't like that this pass would now run unconditionally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked, and found AutoExposure is in bevy_post_process. This means we'd have to add it as a dependency for bevy_core_pipeline, would that be okay?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess that won't work. It would cause a circular dependency. Maybe the right way is moving tonemapping into bevy_post_process? I wonder why we didn't do that before.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cc @atlv24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall there being a complication when i tried to put tonemapping in bevy_post_process, things may have changed its worth trying again.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 26, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-23522

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@momoluna444
Copy link
Copy Markdown
Contributor Author

Currently, tonemapping is located in bevy_core_pipeline, while AutoExposure is in bevy_post_process. Since bevy_post_process already depends on bevy_core_pipeline, we cannot directly add bevy_post_process as a dependency for bevy_core_pipeline without creating a circular dependency.

I can think of the following potential solutions:

  • Add a helper marker component in bevy_core_pipeline to indicate whether AutoExposure is enabled.
  • Move tonemapping into bevy_post_process (I haven't investigated this fully yet, so I'm not sure what the blockers might be).
  • Add a new Linear tonemap variant to explicitly define this behavior.
  • Require users to manually remove the TonemappingPlugin or the Tonemapping component when they want to disable tonemapping entirely (as this PR currently does). However, Tonemapping is currently registered as a required component, and prepare_mesh_view_bind_groups assumes it always exists on a view. This approach would require further cleanup.

@alice-i-cecile alice-i-cecile added S-Needs-Help The author needs help finishing this PR. and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 26, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member

alice-i-cecile commented Mar 26, 2026

Move tonemapping into bevy_post_process (I haven't investigated this fully yet, so I'm not sure what the blockers might be).

This makes intuitive sense to me, but the rendering folks may have nuanced opinions about why this would be bad. Tonemapping is more common that the other post-processing steps, so we may want to granularly feature-flag that crate at some point.

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-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Help The author needs help finishing this PR. X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants