Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ccce7e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove Hermitian tone-mapping curve for HLG" into tm-d1-dev am: cb9f076c

parents 27d4fdd7 cb9f076c
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -299,8 +299,8 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
                highp vec3 ScaleLuminance(highp vec3 color) {
                    // The formula is:
                    // alpha * pow(Y, gamma - 1.0) * color + beta;
                    // where alpha is 1000.0, gamma is 1.2, beta is 0.0.
                    return color * 1000.0 * pow(color.y, 0.2);
                    // where alpha is displayMaxLuminance, gamma is 1.2, beta is 0.0.
                    return color * displayMaxLuminance * pow(color.y, 0.2);
                }
            )__SHADER__";
            break;
@@ -316,7 +316,6 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
    // Tone map absolute light to display luminance range.
    switch (needs.getInputTF()) {
        case Key::INPUT_TF_ST2084:
        case Key::INPUT_TF_HLG:
            switch (needs.getOutputTF()) {
                case Key::OUTPUT_TF_HLG:
                    // Right now when mixed PQ and HLG contents are presented,
@@ -396,6 +395,14 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
                    break;
            }
            break;
        case Key::INPUT_TF_HLG:
            // HLG OOTF is already applied as part of ScaleLuminance
            fs << R"__SHADER__(
                 highp vec3 ToneMap(highp vec3 color) {
                     return color;
                 }
             )__SHADER__";
            break;
        default:
            // inverse tone map; the output luminance can be up to maxOutLumi.
            fs << R"__SHADER__(