# ACES and Uncharted Inverse Tone Mapping

This topic is 444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Before AA, I apply tone mapping and after AA, I apply inverse tone mapping.

For the Reinhard operator this is trivial, but what about the Uncharted and ACES operators?

float3 ToneMap_ACESFilmic(float3 hdr) {
static const float a = 2.51f;
static const float b = 0.03f;
static const float c = 2.43f;
static const float d = 0.59f;
static const float e = 0.14f;

return (hdr * (a * hdr + b))
/ (hdr * (c * hdr + d) + e);
}

float3 ToneMap_Uncharted(float3 hdr) {
static const float a = 0.22f;
static const float b = 0.30f;
static const float c = 0.10f;
static const float d = 0.20f;
static const float e = 0.01f;
static const float f = 0.30f;

return ((hdr * (a * hdr + b * c) + d * e)
/ (hdr * (a * hdr + b) + d * f)) - e / f;
}

They claim to be efficient in the number of FLOPs, but the inverse is the opposite and not uniquely defined (you have two choices due to the squares)?

##### Share on other sites

You cheat:

1. Apply a trivial reversible tonemap operator before AA
2. Resolve AA
3. Apply the reverse of the tonemap operator in step 1
4. Now apply the tonemap you wanted (Uncharted, ACES, whatever).

##### Share on other sites
34 minutes ago, Matias Goldberg said:

You cheat:

1. Apply a trivial reversible tonemap operator before AA
2. Resolve AA
3. Apply the reverse of the tonemap operator in step 1
4. Now apply the tonemap you wanted (Uncharted, ACES, whatever).

Does one also skip the eye adaption (e.g. average luminance) in step 1 and 3?

Krzysztof Narkowicz gave me the following link for the resolve only:

Edited by matt77hias

##### Share on other sites

Eye adaptation happens after step 3.

Steps 1-3 is not about tonemap correctness, it's about correct AA. After step 3, you have antialiased colour data you can tonemap and eye adapt as you like.

##### Share on other sites

I also recommend Matias Goldberg's answer, but just to mention, someone has also done the inverse of the Uncharted operator.

##### Share on other sites
33 minutes ago, turanszkij said:

I also recommend Matias Goldberg's answer, but just to mention, someone has also done the inverse of the Uncharted operator.

Though, I calculated the inverse with Wolfram and obtained two functions. I will take a closer look later.

Edited by matt77hias

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634113
• Total Posts
3015570
×