Rendering pipeline with hdr breaks clearColor

Hello there,

I notices that creating a rendering pipeline with HDR influences the clearColor of the scene: Babylon.js Playground

As you can see in the pg after setting HDR = true the clearColor of the scene is yellow instead of orange. The fog isn’t affected and remains orange.

The documentation says “The HDR value should be true as long as possible, unless you’re targetting cheap fallback for low end devices.”.

I am confused why it changes the clearColor. The color of fog and ground are fine.

Please enlighten me

So as the pipeline is using a post process, it basically processes all the screen. The area with meshes and materials adapt quite easily as they will now output in hdr linear space before being post processed.

The clear color is not rendered and completely in control of the user.

So in case you see it (not filling the entire screen with meshes), you could simply convert your color to linear space. scene.clearColor = yourColor.toLinearSpace();

4 Likes

Thanks, that really helped me.

https://playground.babylonjs.com/#EM3B0W#1

2 Likes