natural-harmonia-gropius / hdr-toys

Componentized Rec.2100 to Rec.709 conversion shader for mpv-player, featuring dynamic curves and a uniform color space.
MIT License
112 stars 1 forks source link

HDR Toys washed out vs Spline #30

Closed pbiancardi closed 1 year ago

pbiancardi commented 1 year ago

Figured I would open a new issue for this.

HDR Toys seems very washed out to me, almost like a gamma or level issue somewhere. It is very visible with the debug menu even (top Spline bottom HDR Toys).

Spline HTOY

this

natural-harmonia-gropius commented 1 year ago

Grayed subtitles and osd are expected, they followed target-*.

Try to replace calc_user_params_from_metered() in dynamic.glsl and modify the value of shadow (2.0, 4.0 or higher).

void calc_user_params_from_metered() {
    float L_min_ev = log2(L_min / L_sdr);
    float L_max_ev = log2(L_max / L_sdr);
    float L_hdr_ev = log2(L_hdr / L_sdr);

    float shadow = 1.0;
    shoulderLength = L_max_ev / L_hdr_ev;
    shoulderStrength = L_max_ev;
    toeLength = shadow * L_max_ev / CONTRAST_sdr;
    toeStrength = 0.5 + 0.5 * (shadow * L_min / toeLength);
}
pbiancardi commented 1 year ago

Is float shadow = 16.0 too high? Somewhere in there looks better to me. Also you don't seem to have the red push that is happning in spline right now? HDR Toys 16.0 first spline second.

HDR Toys 159732 Spline 159732
pbiancardi commented 1 year ago

HDR Toys 16 first Spline second, with this adjustment I am not washed out anymore and I get rid of that red push (I assume that should not be near as red as spline makes it).

HDR Toys 181109 16 shadow Spline 181109
pbiancardi commented 1 year ago

NM when watching this very noticeably flickers with higher values. Even with 1.0 it seems to flicker some but this is the right track, helps it look less washed out.

natural-harmonia-gropius commented 1 year ago

ffmpeg -i input.mp4 -ss 00:00 -t 10 output.mp4 Take some clips plz.

pbiancardi commented 1 year ago
void calc_user_params_from_metered() {
    float L_min_ev = log2(L_min / L_sdr);
    float L_max_ev = log2(L_max / L_sdr);
    float L_hdr_ev = log2(L_hdr / L_sdr);

    float shadow = 1.0;
    shoulderLength = L_max_ev / L_hdr_ev;
    shoulderStrength = L_max_ev;
    toeLength = shadow * L_max_ev / CONTRAST_sdr;
    toeStrength = 0.5 + 0.5 * (shadow * L_min / toeLength);
}

Here you go, this one is really bad right when the guy at the bar turns around. There is no flicker with MadVR or Spline. There is a little flicker with your current master code. There is a little flicker with the code posted here and it gets worse the higher I put float shadow.

https://www.dropbox.com/s/71203a4uvy3j7j0/Creed.mkv?dl=0

natural-harmonia-gropius commented 1 year ago

Can you try https://github.com/natural-harmonia-gropius/hdr-toys/pull/31?

And could you take a clip of the https://github.com/natural-harmonia-gropius/hdr-toys/issues/30#issuecomment-1606153789?

pbiancardi commented 1 year ago

Can you try #31?

And could you take a clip of the #30 (comment)?

This is looking really good.

Here is the clip - https://www.dropbox.com/s/psq24onerdyymoj/output.mkv?dl=0