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

help create a glsl shader #48

Closed geextahslex closed 10 months ago

geextahslex commented 10 months ago

Hi, I have an issue with my tone mapping, and I know how to fix it (in Photoshop), but I have no idea about how to create glsl filters. That looks very complicated. My Issue: I am annoyed with the the LSD style colors in the 0-10 (0-255) brightness range.
My solution is to desaturate the low range 0-4 (brightness), and then make a transition between 4-15 to make it look smooth.

It would be awesome to control A: effect 0-100% and B: the range, to be flexible.

In photoshop it looks like this: a desaturaion layer with these settings: filter

Example Blue horse dgdfg

Here its fixed HDR fix f

natural-harmonia-gropius commented 10 months ago

See 6.1.8 of https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-BT.2446-1-2021-PDF-E.pdf, modify the function.

By the way, are you using hdr-toys? shouldn't have issue about over-saturate in low-light.

geextahslex commented 10 months ago

Yes I am, but there are so many options. I just started using mpv a few days ago, so all these comands are a bit overwhelming, lol ^^. I just try everything out and compare screenshots. I just now discovered that there is a srgb profile (srgb/srgb_inv) and that helped. I have a normal sdr tv (my goal is HDR tone mapping). I don't now what pq,hlg and bt.1886 is meant for.. ^^

do I need to run "hdr-toys-helper.lua" when Im not using the "dynamic.glsl"?

natural-harmonia-gropius commented 10 months ago

Dose tone-mapping/bt2390 also showing blue-ish house? If so, it is "creator's intention".

I just now discovered that there is a srgb profile (srgb/srgb_inv) and that helped.

This would make dark area darker, but fine if you feel good with it.

do I need to run "hdr-toys-helper.lua" when Im not using the "dynamic.glsl"?

Need.

geextahslex commented 10 months ago

So this blue horse came from switching from "jedypod" to "lea" there was no screenshot with explanation at the main page, so I just tried it out, and it desaturated low mids (which was great) but boosted the dark range (0-10rgb) and shifted the hue slightly, from green-ish to dark blue-ish (what you see at the screenshot).

But srgb/srgb_inv fixed all of it. Would be nice to know when to use lea and when to use jedypod

natural-harmonia-gropius commented 10 months ago

when to use lea and when to use jedypod

Use which one you feel good, currently there is no best solution.

geextahslex commented 10 months ago

Okay, I will.

Is there an option to make the "dynamic.glsl" run better on old hardware? Maybe don't check every frame but every 10th or so? I get like 10 FPS ^^

natural-harmonia-gropius commented 10 months ago

What gpu you using? in my device default combines of hdr-toys faseter than scaler.

geextahslex commented 10 months ago

I have a integrated intel gpu: intel HD 4600 (haswell)

natural-harmonia-gropius commented 10 months ago

How many fps you get with mpv's bulit-in tone-mapping? and are you using display-resample?

geextahslex commented 10 months ago

Out of the box mpv it is always smooth (24 fps) and also with the other glsl I use, run smooth. Dynamic.glsl it is about 10 fps (rivatuner says so). I don't use this line "display-resample". Only these both "builtin-scalers" and "deband=no" (honestly I dont know what they do^^)

natural-harmonia-gropius commented 10 months ago

I have no idea about performance, I suggest you to use bulit-in tone-mapping, this shader doesn't lead as far as performance needs.

geextahslex commented 10 months ago

Is it possible to find a "st2094-10.glsl" shader?

natural-harmonia-gropius commented 10 months ago

Is it possible to find a "st2094-10.glsl" shader?

https://ieeexplore.ieee.org/document/7513370