Improve AgX tonemapping curve and update tonemapping docs. #102435
+74
−70
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.
Draft State
I have left this PR in a draft state solely to reduce the review workload; I hope that I will be able to greatly improve performance with a new approximation of the AgX tonemapping curve in linear encoding, but it will take me at least a few more weeks of full-time research and trial-and-error to do this.
If the production team would prefer to review this PR as-is and merge it now, you're very welcome to! The new high performance approximation that I have in mind could be merged at a later time.
Tonemapping Curve
This PR changes the tonemapping curve to no longer be an approximate, but instead be an exact simplification of the original tonemapping curve of AgX. This addresses all of the issues described in #102416, while maintaining similar performance.
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 (with white parameter): 1.35 ms
Tony McMapface: 1.29 ms
AgX (this PR): 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
Docs
The docs changes make the tonemapper descriptions consistent with each other, making them easier to quickly compare. They follow this format:
I have also updated the
white
documentation along with this refresh.