Forum Discussion

Viconthebeach's avatar
2 years ago

Set HDR enabled/disabled at runtime?

Passthrough still won't works (black screen) if HDR is enabled in the render pipeline asset settings,
so I must build the project with HDR disabled.

How can I activate HDR when the passthrough stage is done to get post processing effects on ?

Actually I can successfully tick from script the HDR option, but it is not activating post processing effects at runtime.

 

 

// This ticks the checkbox while running on editor, but no effects at runtime on the headset.
var urpAsset = (UniversalRenderPipelineAsset)GraphicsSettings.renderPipelineAsset;
urpAsset.supportsHDR = true;

 

 

 

3 Replies

  • Got it, using different URP renderers and setting the desired renderer for the camera at runtime:

    Camera.main.GetUniversalAdditionalCameraData().SetRenderer(1); // index 1 is HDR renderer 
    Camera.main.GetUniversalAdditionalCameraData().renderPostProcessing = true;
    Camera.main.GetUniversalAdditionalCameraData().allowHDROutput = true;
    Camera.main.allowHDR = true;

     

    Don't forget to set the HDR enabled on the Pipeline Asset prior to build, passthrough will works if the camera uses a no HDR renderer and postprocessing is disabled.

    • maoshmellow's avatar
      maoshmellow
      Explorer

      Hi Vic,

      Thanks for documenting your process. I've been running into a similar issue and was wondering if you could elaborate on how you can set a renderer to be "no HDR"? To my belief, you set HDR options for URP in project settings and not on the renderer itself.

      • Viconthebeach's avatar
        Viconthebeach
        Protege

        Hi, Just go to the project panel, right click>create>Rendering>URP Asset (with URP renderer)
        Then look to the inspector panel of the newly created renderer pipeline asset, in the quality settings there's a HDR checkbox. But in fact now the issue isn't occuring anymore, you can just use a Render Pipeline Asset with HDR on, then set the camera with or without HDR output and post-processing effects. It works like a charm now.