#HDR Output - Changing PaperWhiteNits

1 messages · Page 1 of 1 (latest)

wicked pivot
#

Hi guys,

currently I am struggling with the HDR Output of Unity, especially changing the PaperWhiteNits value by code.
This is my current test code. For safety reasons, I loop through each display.

using UnityEngine;

public class SetHDRPaperWhite : MonoBehaviour
{

    [SerializeField] [Range(0, 400)] private float paperWhiteNits;
    void Awake()
    {
        SetHDR();
    }

    void SetHDR()
    {
        Debug.LogWarning("Calling SetHDR()!");

        foreach (var hdrOutput in HDROutputSettings.displays)
        {
            if (!hdrOutput.available)
                continue;
       
            Debug.LogWarning("HDR available, adjusting paperWhiteValue");
            
            Debug.LogWarning($"Current PaperWhiteNits Value: {hdrOutput.paperWhiteNits}");
            hdrOutput.automaticHDRTonemapping = true;
            hdrOutput.paperWhiteNits          = paperWhiteNits;
            Debug.LogWarning($"After Modification PaperWhiteNits Value: {hdrOutput.paperWhiteNits}");
        }
    }
}

Using this snippet, regarding to the log, it works. Values are changing and that's it. But visually, there is no difference.
Doing the 'same' by manipulating volume overrides, it behaves as it should.

So my question is ... how do I manipulate it, so it is applied to the display?

Thanks for your help 🙂

worthy basalt
#

Have you looked at the Tonemapping volume component? It also has a paperwhite settings, which can override HDROutputSettings.

wicked pivot
#

@worthy basalt Sorry for the late reply, was sick during the last few days. Anyway.

What do you mean by this? Yes, there is a Global Volume in the scene, but without a Tonemapping Override.
Or is there a place somewhere else I miss?

worthy basalt
#

No, I just mean the Tonemapping override. You can see here for URP that it first uses the paperWhiteNits value from the HDRDisplayInformation, but if detectPaperWhite is false, which is the default value, it will instead use the paperWhite value configured in Tonemapping. I'm not seeing that there's any code checking if Tonemapping is overridden at all, so I think it will end up using the default paperWhite value in the Tonemapping component, which is 300.

#

Try overriding Tonemapping just to enable detectPaperWhite and see if that fixes it.

wicked pivot
#

Okay, phew 😄
Thanks- will give it a try now.

worthy basalt
#

I honestly didn't know you could change the paperWhiteNits property directly on the device. I thought that was just a readonly property directly reported from the hardware. I've been changing the paperWhite property on the Tonemapping component instead.

wicked pivot
# worthy basalt I honestly didn't know you could change the paperWhiteNits property directly on ...

Nope, sadly not. The monitor might report something to Unity, but I have vastly different results coming from bug reports.
Recently I got a HDR monitor to reproduce it, but one player had just a black screen, not playable at all and on my hardware, everything is way to bright and desaturated.

The desaturation is another problem (it looks like raw footage of high end cameras (log profile)) but the brightness is the bigger problem ^^

#

I ticked the box here, and yeah. It does what it tries to tell me. PaperWhiteValues are set automatically (looks still wrong), but this is usually now what you want.
...and setting the PaperWhiteNits now, is completely ignored as set 😄

worthy basalt
#

Having a good default is good, but it's more important that users get to configure this themselves. Most games with HDR support also have a calibration step.

wicked pivot
#

Yep, and this is what I would like to approach 😄
This is what I guess is the PaperWhiteValue is all about.

Otherwise I did not found anything else to adjust.
...anyway, it still does not react to my changes and using the volume override isn't an option, since we do not have any in the main menu - it's pure UI

worthy basalt