godotengine / godotengine/godot
ACES tonemapper uses incorrect gamma curve
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot v4.2.stable
Godot v4.2.1.stable
### System information
Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz (6 Threads)
### Issue description
Scenes displayed with the ACES tonemapper show extremely dark mids, with overblown contrast and saturation in the highlights.
linear:

Reinhard:

filmic:

ACES:

It appears that the tonecurve is assuming an encoding gamma, while the data is in fact linear. To demonstrate, here is the screenshot in a color managed After Effects project using the ACES/rec709 display transform:

Still very dark (no exposure compensation), but much more realistic and manageable. This is what I would expect.
Here is the same but using After Effect's ACES/sRGB display transform:

This is behaving similarly to Godot's tonemapper, accounting for the 1.8f exposure bias in Godot's tonemap code making it darker. sRGB and rec709 use the same gamut but have different gamma curves.
To emphasise, the issue is not that the scene is too dark. It's a dark scene and I would expect to have to compensate somehow when using ACES anyway. the issue is unmanageably high contrast and oversaturated colors between highlights and midtones, indicative of overcorrected gamma. Here is the scene in Godot's ACES tonemapper with brighter lights and higher exposure respectively:


The contrast is way too high, highlights are way too blown out, high mids are way too saturated. As it stands the tonemapper is neither ACES compliant nor useable aesthetically.
### Steps to reproduce
- Apply ACES tonemapper to any 3d scene
### Minimal reproduction project (MRP)
[ACES tonemap gamma mrp.zip](https://github.com/godotengine/godot/files/13953767/ACES.tonemap.gamma.mrp.zip)
Contributor guide
Research direction
Reproduce the ACES tonemapper behavior with the linked minimal reproduction project and compare it with the linear, Reinhard, and filmic results shown in the issue. Then trace the ACES tonemapper implementation and verify the gamma behavior against the supplied After Effects comparisons; done means mids, highlights, contrast, and saturation behave as described for an ACES display transform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100