When using multiple cameras and viewport and DefaultRenderingPipeline, I notice that camera2’s viewport has very dark contrast with HDR enabled.
See in this PG
Trying to set HDR to false fixes the problem :
Otherwise if in the DefaultRenderingPipeline, I add all the cameras, it is the layer to create a mask which creates a problem as we can see in this PG
Trying to set HDR to false fixes the problem:
Anyway, as soon as I turn HDR off, it seems to fix the issues. Is this normal or am I doing something wrong ?
Basically being in hdr forces everything to render in linear space so the material will not do any gamma correction.
I would advise to either use the pipeline on both camera or to create a imageProcessingPostProcess for the second camera which will basically render back in gamma space: https://playground.babylonjs.com/#E6OZX#942
I like the idea of the imageProssessingPostProcess.
But the second problem appears, even on your PG.
The minimap has a Layer problem. Logically the white frame of the Layer becomes transparent, but there it no longer has it with the imageProssessingPostProcess for HDR. Is there a reason for this?
Yup unfortunately it is because the post process will render with alpha test in a render target before applying it to the main canvas so the clear color would be visible. In this case, we either need to support alpha test in the post process or simpler, you could try to render the camera2 in a render target and then use it as a layer ?
I don’t understand how I should do this? Is there a PG example for this?
Thank you very much Sebavan for your help.
It’s great, it works well. Thank you very much Sebavan.
As a result, there is no longer any need for the imageProssessingPostProcess.
yup basically it will apply on the layer when adding it
Ah yes, I just understood. But suddenly my image on the layer which allowed to create on my project a round mini-map, is no longer taken into account with that your last solution @Sebavan?.
Well I think I’m going to set the HDR to false.
What do I lose with HDR to false? Just high definition?
Or is there another possible way. It works well with a simple camera, but with the Viewport or Layers it may be missing something to exploit the HDR? Or maybe I should just forget about HDR which solves all my problems and still keeps the scene in decent quality (I guess).
You can still make your mask only work in the rtt https://playground.babylonjs.com/#E6OZX#945
It works well. I was far from imagining that it was necessary to do all that. I can’t even figure out how it all works. There are plenty of layerMask and layer that I am lost.
But it works fine. It’s just perfect now.
I would like one day to have this level of knowledge of the Babylon engine. There’s so much I don’t know.
Huge thank you Sebavan.