Add support for white parameter to AgX tonemapper (Mk. 2)#102425
Closed
allenwp wants to merge 1 commit intogodotengine:masterfrom
Closed
Add support for white parameter to AgX tonemapper (Mk. 2)#102425allenwp wants to merge 1 commit intogodotengine:masterfrom
allenwp wants to merge 1 commit intogodotengine:masterfrom
Conversation
Fixes godotengine#101558 and godotengine#102416 Also limits white parameter from being set lower than 0.01 in the editor.
This was referenced Feb 4, 2025
Contributor
Author
|
I discovered that this approach does not work well with HDR output and variable Extended Dynamic Range (EDR) output. I have drafted a new work in progress prototype that demonstrates a new tonemapping curve for AgX that includes a Please try it out and leave feedback on that PR! |
Contributor
Author
|
Superseded by #106940, which gives stable behaviour across all variable / extended dynamic range (EDR), HDR, and SDR. |
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.
Not cherry-pickable to 4.3, as AgX is only in 4.4.
Also limits white parameter from being set lower than 0.01 in the editor.
Draft State
I am intentionally leaving this PR in a draft state because I expect that the performance characteristics are not be suitable for merging this into Godot. Additionally, documentation must be further updated in this PR if it was to be merged.
Usage
In addition to resolving issues with using AgX with the Mobile renderer, the white parameter can be used to give higher contrast by decreasing
white. This approach is higher quality than using the Environment's contrast adjustment and does not significantly affect the brightness of the scene like the previous incorrect approach.Consistent rendering between Mobile and Forward+
Because the Mobile renderer only provides values to the tonemapper up to
2.0, you can achieve a similar appearance with AgX between the Mobile and Forward+ renderers by setting thewhiteparamter to2.0or less. This makes it easier to use AgX on a cross-platform game that must use the Mobile renderer on some platforms, but uses the Forward+ renderer on others.Limitations
The
whiteparameter does not function below values of1.172, so this parameter is clipped to this minimum inEnvironmentStorage.Performance
Using the visual profiler, Calinou's tonemapping test scene, ~4K window, and an NVIDIA 980 Ti on Windows 11, I recorded the following performance stats:
AgX (this PR): 1.35 ms
Tony McMapface: 1.29 ms
AgX (exact, hardcoded white): 1.22 ms
AgX (Godot 4.4 beta 2): 1.19 ms
ACES: 1.07 ms
Filmic: 1.0 ms
Rienhard: 0.93 ms
Linear: 0.82 ms