ACES and Uncharted Inverse Tone Mapping

Started by
5 comments, last by matt77hias 6 years, 5 months ago

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)?

🧙

Advertisement

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).
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:

https://gpuopen.com/optimized-reversible-tonemapper-for-resolve/

🧙

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.

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

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.

🧙

This topic is closed to new replies.

Advertisement