- Home /
HDR data is not rendered into render texture when using URP
I recently upgraded to Universal Render Pipeline. I followed this (https://docs.unity3d.com/Packages/c...7.2/manual/rendering-to-a-render-texture.html) instruction to have multiple cameras in my scene. I have a bloom effect in my scene which is working perfectly in my ARCamera(main camera). But, after adding the second camera, the bloom effect is not appearing in the game view (working in scene view). I've enabled post-processing in both cameras (I'm sure that there is no problem with the cameras). The problem is, render texture is not capturing the HDR color from the ARCamera. How to fix this? Reference Images available in this thread: https://forum.unity.com/threads/hdr-bloom-issue-when-using-multiple-cameras-in-urp.834619/#post-5515264
Answer
Changing "Color Format" of Render Texture to R16G16B16A16_SFLOAT worked for me
Can you please update your question with the answer. In your thread, gaaradim gives the answer. If people don't pay attention to the link you mention, they will never have the answer :)
Thanks for the suggestion. I completely forgot this thread. Updated my question with the answer.
Answer by Jagrafess · Mar 12 at 03:04 AM
I'm trying to do a similar thing in unity 2021.2.15f (latest unity version at the time) using URP.
I've got a sun (sphere) with a material with a HDR emissive colour with an intensity of 10, I render this to a cube map using this code:
public class CubeMapGenerator : MonoBehaviour
{
public Camera Camera;
public RenderTexture RenderTexture;
public GameObject Background;
public Material BackgroundMaterial;
void Start()
{
RenderTexture.format = RenderTextureFormat.DefaultHDR;
Camera.allowHDR = true;
Camera.RenderToCubemap(RenderTexture);
Background.SetActive(false);
BackgroundMaterial.SetTexture("_Tex", RenderTexture);
RenderSettings.skybox = BackgroundMaterial;
}
}
I then place the rendered texture into a Cubemap material and apply as my skybox and add post effects with bloom threshold of 1.0.
There is no bloom effect, it suggests there's no values sorted above 1.0 in the rendered texture colour channels, my sun object (still sitting in the scene) glows dramatically as expected.
Is there something I'm missing I've tried all the format options including R32G32B32A32_FLOAT.
I've made a demo project of this which I can put into a GitHub repo if that helps.
Okay worked it out, the camera has to have anti-aliasing off and the URP assert requires Post-processing > Grading Mode set to High Dynamic Range, worked this out purely by fiddling, there's no clear documentation around this.
Answer by Highavenue01 · Jul 29, 2020 at 03:16 PM
Found solution. Updated my question with the answer!