Skip to content

Improve Environment saturation color adjustment.#111898

Open
allenwp wants to merge 1 commit into
godotengine:masterfrom
allenwp:environment-adj-prioritize-quality
Open

Improve Environment saturation color adjustment.#111898
allenwp wants to merge 1 commit into
godotengine:masterfrom
allenwp:environment-adj-prioritize-quality

Conversation

@allenwp

@allenwp allenwp commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

This commit changes the saturation color adjustment to behave as follows for all rendering configurations:

  • Apply saturation with luminance weights on linear-encoded values, preventing brightness from changing with certain colors.
  • Apply contrast after saturation to avoid a performance regression when HDR 2D is disabled. This ordering is reversed compared to Godot 4.5 and earlier.

Rationale and screenshots

Rationale and screenshots for this PR can be found in godotengine/godot-proposals#13195.

Changes and improvements

Problem: Low-luminance colours change in apparent brightness when saturation is changed. A prime example is deep blue colours which appear to brighten when saturation is decreased and darken when saturation is increased.

The solution to this problem is to simply apply saturation to linear-encoded values using CIE luminance weights for the Rec. BT.709 primaries that Godot uses:

Original Even weights (Godot 4.5 HDR 2D enabled) This PR (Rec. 709 luminance weights)
Image Image Image

@AThousandShips AThousandShips added this to the 4.x milestone Oct 22, 2025
@allenwp allenwp force-pushed the environment-adj-prioritize-quality branch from bfb6867 to 6a89bd4 Compare October 22, 2025 15:52
@allenwp allenwp changed the title Improve Environment adjustments (favor visual quality). Improve Environment saturation color adjustment. Oct 22, 2025
@allenwp allenwp modified the milestones: 4.x, 4.6 Oct 23, 2025
@allenwp allenwp marked this pull request as ready for review October 23, 2025 03:04
@allenwp allenwp requested review from a team as code owners October 23, 2025 03:04
@allenwp allenwp force-pushed the environment-adj-prioritize-quality branch from 6a89bd4 to 0a1f61d Compare October 23, 2025 18:04
@AThousandShips AThousandShips added this to the 4.x milestone Oct 24, 2025
@AThousandShips AThousandShips removed the request for review from a team October 24, 2025 11:26
This commit changes the saturation color adjustment to behave as follows for all rendering configurations:

- Apply saturation with luminance weights on linear-encoded values, preventing brightness from changing with certain colors.
- Apply contrast after saturation to avoid a performance regression when HDR 2D is disabled. This ordering is reversed compared to Godot 4.5 and earlier.
@allenwp allenwp force-pushed the environment-adj-prioritize-quality branch from 0a1f61d to 001c8c9 Compare November 26, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Environment adjustments.

2 participants