INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Using a HDR 3D LUT with JRVR HDR to HDR tonemapping  (Read 1284 times)

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566
Using a HDR 3D LUT with JRVR HDR to HDR tonemapping
« on: March 21, 2025, 03:24:17 pm »

Support for HDR 3D LUT in JRVR was added in MC 34 beta 16 :) thanks team!

When I specify a SDR 3D LUT with OS HDR disabled, it's enabled when playing SDR content and disabled when playing HDR, as expected.

If I have OS HDR enabled, is there a way to use a HDR LUT (BT2020 PQ) for all content, as SDR Rec-709 can be tonemapped to HDR BT2020?

Does it make a difference if we disable HDR to HDR tonemapping?

I could do with a bit more accuracy, and if I could have a single HDR calibration for all content, I could use the native gamut with a large 3D LUT, which should produce decent results.

Has anyone tried this and has some results to share?

Alternatively, I heard that it was possible to use dwm_LUT (https://github.com/lauralex/dwm_lut) to generate a windows LUT, has anyone tried this with JRVR?

Any ideas, experiences and step by step welcome!
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566
Re: Using a 3D LUT with JRVR HDR to HDR tonemapping
« Reply #1 on: March 22, 2025, 04:01:10 am »

I found this old thread of mine that raised the question: https://yabb.jriver.com/interact/index.php?topic=138937.msg963262#msg963262

So the question to Hendrik is would there be a way to enable a separate 3D LUT for HDR Content, or would it be disabled when using HDR passthrough?

When using HDR to HDR tonemapping, JRVR is tonemapping before passing the content forward to the display, so hopefully it should be able to apply a HDR 3D LUT as the display shouldn't be doing any tonemapping?

When enabling OS HDR and using HDR to HDR tonemapping, SDR 709 would be tonemapped to HDR, so there is only the need for a single HDR LUT, that wouldn't be disabled when tonemapping to HDR.

Would this be possible? It would really help to increase picture accuracy in both SDR and HDR if we could use a single HDR LUT and the native gamut of the display to tonemap/correct all content.
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566
Re: Using a 3D LUT with JRVR HDR to HDR tonemapping
« Reply #2 on: March 26, 2025, 05:36:42 pm »

I'm making progress with this little project :)

dwm_lut doesn't seem to be working with Windows 11 24H2, but I did some testing with Reshade (https://reshade.me/) using DirectX 11 and I was able to apply a 65^3 .cube 3D LUT while using HDR to HDR tonemapping with JRVR using the following shader:
https://github.com/aron7awol/CubeLUT3Ddith
This shows that it can be done :)

Unfortunately, I'm getting dropped frames, freezes and even crashes when Reshade is enabled, so a native implementation in JRiver would be much better. [EDIT: I've resolved the frame drops and crashes with Reshader, but a native support of a HDR 3D LUT by JRVR in one of the formats already supported would still be great.]

Hendrik, is there any way to add support for a HDR 3D LUT in JRVR? Or if it's already possible, how do we prevent the 3D LUT from being disabled when playing back HDR content if we load a HDR 3D LUT in the settings?

It would be a great selling point if MC was able to correct not only SDR but also HDR content.

Is no one else interested in this?
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

I found this even older thread https://yabb.jriver.com/interact/index.php/topic,132879.msg920801.html#msg920801 where Hendrik is suggesting what, in my opinion, would be the best solution for this (an entirley separate calibration for HDR output in its own section):

"I suppose it could make sense to entirely separate Calibration for HDR output in its own section, as the gamut/gamma options also don't apply to it (which isn't as much separating, but renaming the Calibration group, since HDR is not even in there yet). The HDR section could also be disabled if HDR pass-through is disabled, as in that direction it ensures that it'll never be used."

Any chance of this happening in V34?

If anyone else is interested in HDR 3D LUT support in MC when using HDR passthrough (ideally with HDR to HDR tonemapping enabled as JRVR is much better than any TV/Projector at this and if you specify the TV/PJ peak brightness it should avoid double tonemapping in most cases), please make yourself known, that might increase our chances to see this happen :)

If it's just me, I won't blame Hendrik / devs for thinking it can wait.
Logged

datdude

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2270

I'd be interested if it made a noticeable difference in the video quality. I have no clue what the real-world differences would be.
Logged
"You are not a beautiful or unique snowflake." -  Just a very big snowball

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

I'd be interested if it made a noticeable difference in the video quality. I have no clue what the real-world differences would be.
I’m only interested in real world differences :)

It depends on your display/projector. On my Samsung S90C (QD OLED), even after a good manual calibration using the CMS, low stimulus levels are significantly undersaturated. This doesn’t show in standard calibration reports but it’s obvious if you run saturation sweeps at 5-15% stimulus. As a result, colors are understaturated in dark scenes. A HDR 3D LUT allows to restore the proper saturation (and brightness levels) at all stimulus levels, not just at the levels the CMS works at.

This improvement is very visible, at least here. Your display could have more visible errors in other areas.
If you tried to adjust these lower stim levels with the CMS, then all the higher stim levels that would be wrong, as the CMS isn’t linear.

SDR LUTs are an option with projectors because you can get the same peak brightness in SDR and HDR, so you can tonemap to BT2020 SDR, but with most HDR TVs your peak brightness is only available in HDR. For example, I get 1,360nits in HDR but only 500nits or so in SDR, so clearly using a SDR BT2020 3D LUT doesn’t work for me.

I’m going to post some before/after measurements to show this, but it really depends on your display and on your ability to make good profiles and generate good 3D LUTs.
Logged

datdude

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2270

Good to know. I have an LG C1 OLED. Looking to upgrade soon hopefully. LG G5 is looking ok but has near black and gradation issues that may not be fixable. Hoping Sony releases a new QD-OLED this year that doesn't have these types of issues out of the box. If the LUT takes it to another level that would be great! I don't have the equipment or knowledge yet to create them. Is there a recommended guide on how to do so?
Logged
"You are not a beautiful or unique snowflake." -  Just a very big snowball

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

Good to know. I have an LG C1 OLED. Looking to upgrade soon hopefully. LG G5 is looking ok but has near black and gradation issues that may not be fixable. Hoping Sony releases a new QD-OLED this year that doesn't have these types of issues out of the box. If the LUT takes it to another level that would be great! I don't have the equipment or knowledge yet to create them. Is there a recommended guide on how to do so?

It looks like the more they push brightness, the more LG is causing issues in the low end sadly. Only a few more days to find out about Sony, but even if it’s QD OLED it will be limited to 77” this year. Anything above that will be WOLED, as usual. Too many downsides for me.

Re a guide, not really, LUT creation is a bit of a dark art and really depends on each display. I’ll make a how to for my S90C when I’m fully happy with the results.

EDIT: That's not what I use, but you might want to take a look at DisplayCAL, it's a free software that can be used to profile a display and generate a 3D LUT. There are many more options (Calman, Colorspace etc), but that one is free: https://displaycal.net/
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 11111

I'll look into adding a HDR 3DLUT option, and leave it entirely up to the user to make sure the 3DLUT actually does something decent.
Logged
~ nevcairiel
~ Author of LAV Filters

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

I'll look into adding a HDR 3DLUT option, and leave it entirely up to the user to make sure the 3DLUT actually does something decent.

That’s fantastic, thank you. Of course, it is up to the user to create a LUT that works (once the implementation is confirmed working by beta testers with experience and the ability to help you assess results and provide known good LUTs, ie LUTs in a format supported by JRiver that work fine). That’s absolutely not JRiver’s responsibility to help users in this area, especially inexperienced users. I think that’s the way it currently works with SDR 3D LUTs (which, by the way, are working great here for SDR content). It needed a bit of finetuning initially, then it was done. Of course I’m happy to help in any way that you might find useful.
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566
Re: [Feature Request]: Using a HDR 3D LUT with JRVR HDR to HDR tonemapping
« Reply #10 on: April 13, 2025, 08:49:06 am »

I just found out that you had implemented this in beta 16... Thank you so much, I'll test this as soon as I can and will report back.
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

Well, at least the HDR LUT loads, so that's a first step :)

I'm not with the HTPC so I've just tested the option and checked that it accepted a standard .cube HDR LUT (full levels).

Thanks for implementing it the way you suggested earlier, with a separate slot for SDR and HDR LUTs, that's great.

I'm testing with a 65^3 .cube LUT generated with custom tools using pGen or MPV (as there is no way I know of to use MC as a pattern generator). I've tested it and measured it (both with pGen, MPV and madTPG), so I know it a good one.

Is there a way to display the name of the LUT being used in the OSD, just to be sure that it's enabled and is being actually used at that time?
If that takes too much space, maybe just display SDR LUT or HDR LUT enabled?

Also is there any way to add a shader to show in a split screen before/after (similar to the before/after shader in Reshade), or to enable/disable the LUT on the fly with hotkeys? It's easy to upload a bad LUT to see that it's actually applied, but when it's a good LUT and the display is already fairly close, it can be difficult to confirm that all works as expected.

I'll test the LUT properly when I'm back with the HTPC. Thanks again for implementing this, it's very exciting!
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 73138
  • Where did I put my teeth?

Maybe in the Ctrl-J menu?
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

Maybe in the Ctrl-J menu?

Thanks, but Ctrl-J is what brings up the OSD, as far as I can see there is no mention of the LUT being used there (as was the case with SDR LUTs).

I'm suggesting adding this information there, so that we know a LUT is in the path (and, ideally, which one).
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 11111

The render steps at the bottom will indicate that a 3DLUT is being used, and when its HDR output it will use the HDR LUT if specified, never the SDR one.

Split screen is not likely possible with the way our renderer is setup.
Logged
~ nevcairiel
~ Author of LAV Filters

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

The render steps at the bottom will indicate that a 3DLUT is being used, and when its HDR output it will use the HDR LUT if specified, never the SDR one.

Split screen is not likely possible with the way our renderer is setup.

Great thanks, I'll take a look at the render steps. [EDIT: I see it, that's perfect].

Understood about the split screen. Is there a way to switch the LUT on/off on the fly with hotkeys? That would be very helpful.

Thanks again for implementing this.
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

I checked the hotkeys here https://wiki.jriver.com/index.php/Keyboard_Hot-keys and it doesn't look like hotkeys for switching the 3D LUT on/off are available.
I think it's been requested a few times in the past (not only by myself), if there was any way to implement it it would be much appreciated.

I've tested the HDR LUT briefly and visually all seems to be working as it should. I'll test it more thoroughly when I'm done generating a new LUT and can look at specific content, but so far, so good, at least with a 65^3 :)
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4514

Iirc you can switch profiles via a command so can create a profile with lut and another without then switch between them
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 73138
  • Where did I put my teeth?

Zones should work.  Ctrl-T to toggle.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4514

Jrvr config is separate to zones so that won't work
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

Iirc you can switch profiles via a command so can create a profile with lut and another without then switch between them
Thanks, would you have a link to a resource for this? I can't find a hotkey for switching profiles in the link I posted above.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 73138
  • Where did I put my teeth?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4514

It's an MCC command

NEW: Added the ability to configure the default profile used in JRVR, in the config dialog, context menu, as well as MCC (10080-10083).
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

Maybe here:  https://yabb.jriver.com/interact/index.php?topic=133480.0

Thanks Jim, so I've created a second output profile called 3D LUT off (duplicate of the default profile with the 3D LUT on). It has an internal ID of 1, and I assume the default one has an ID of 2. The question is how do I switch between the two profiles on the fly using a hotkey?
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

It's an MCC command

NEW: Added the ability to configure the default profile used in JRVR, in the config dialog, context menu, as well as MCC (10080-10083).

Thanks Matt. So if I look in that list https://wiki.jriver.com/index.php/Media_Center_Core_Commands#Commands, I should use MCC command 10080 to switch between profile 0 (3D LUT on) and profile 1 (3D LUT off). How do I do this with a hotkey? Do I have to create two batch files with the MCC command and assign a hotkey to each batch file? I can use Roomie Remote to do this I guess.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4514

I am not familiar with roomie so difficult to comment but that sounds like it would work
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

I am not familiar with roomie so difficult to comment but that sounds like it would work

Thanks and no worries, I'm familiar with Roomie and MC Controller. I just wanted to check that the batch files with an MCC command was the simplest way to do this. I'll give it a try.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 11111

You should use 10074 to change the active output profile for a current file, eg. MC34 /MCC 10074,0
The global default profile (eg. 10080) is not a good choice for quick testing (it changes the default profile for all files, which is meant to be used to react to manual/external hardware changes)
Logged
~ nevcairiel
~ Author of LAV Filters

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566

You should use 10074 to change the active output profile for a current file, eg. MC34 /MCC 10074,0
The global default profile (eg. 10080) is not a good choice for quick testing (it changes the default profile for all files, which is meant to be used to react to manual/external hardware changes)

Great thanks, I'll give this a try and I'll report back.
Logged

Manni

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 566
Using a HDR 3D LUT with JRVR HDR to HDR tonemapping
« Reply #29 on: Yesterday at 05:32:12 am »

You should use 10074 to change the active output profile for a current file, eg. MC34 /MCC 10074,0
The global default profile (eg. 10080) is not a good choice for quick testing (it changes the default profile for all files, which is meant to be used to react to manual/external hardware changes)

OK, so I tried it and it works great :)

For those who would like to implement this, here is what I did:

I set my HDR 3D LUT in my default Output profile (ID 0)
I copied that profile into another Output profile, called 3D LUT Off, that has the ID 1.

I created two batch files to switch between the default profile (3D LUT On) and the one with the LUT disabled (3D LUT Off):

Here is the content of the batch file that enables the 3D LUT:
Code: [Select]
@ECHO Off
"C:/Program Files/J River/Media Center 34/MC34.exe" /MCC 10074,0

And here is the one that disables it:
Code: [Select]
@ECHO Off
"C:/Program Files/J River/Media Center 34/MC34.exe" /MCC 10074,1

As you can't run a batch file without having the command line window flashing on briefly (even with the @ECHO OFF command) as you can only minimize shortcuts on launch, I also created two .vbs files calling each batch file so that you can enable/disable the LUT without the flashing, which is distracting and prevents seeing small changes in the picture (for example when paused on a specific frame to see the impact of the LUT):

Here is content of the 3DLUT_On.VBS that enables the LUT:
Code: [Select]
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "[YOURPATH]\MCLUT_On.bat" & Chr(34), 0
Set WshShell = Nothing

And, as you can guess, the content of the 3DLUT_Off.VBS that disables the LUT:
Code: [Select]
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "[YOURPATH]\MCLUT_Off.bat" & Chr(34), 0
Set WshShell = Nothing

This works perfectly, no flash on screen, and the HDR (and/or SDR) LUT is correctly enabled or disabled on the fly, according to both the OSD and the picture. I'll just have to patch this into MCC/Roomie Remote when I find the time.
I was running this on my laptop and the LUT is definitely enabled/disabled, but that's a LUT made for the TV, so I'll do more testing now that I can enable/disable the LUT on the fly and I'll report back, but so far, so good.

The advantage of using MCC commands and profiles is that you can have as many LUT slots as you want, so you could test/use different LUTs.

Thanks all for the help in getting this to work, I find it difficult to evaluate LUTs on an already well-calibrated display without being able to at least enable/disable it on the fly.
Logged
Pages: [1]   Go Up