Search Unity

Black screen with 2 cameras and allowing hdr on metal

Discussion in 'General Graphics' started by ff_acc, Jan 14, 2020.

  1. ff_acc

    ff_acc

    Joined:
    Jan 14, 2020
    Posts:
    2
    Hello!

    I have 2 cameras and a cube in my test scene. First cameras viewport is (0,0,1,1) ,depth is 0. Second cameras viewport is (0.1,0,1,1) ,depth is 1. Both of thems allowHDR is enabled.
    And i set the hdrMode is RBG111110 because is will publish it to iphone.
    Snipaste_2020-01-14_12-24-17.png

    Since the second cameras viewport smaller than the first one and its hdr is enabled, so unity creat a new renderBuffer for the second camera before the second camera rendering, I see that in framedebugger.
    Snipaste_2020-01-14_13-39-26.png

    But I need publish game to iphone with metal.
    In metal, the new renderTextures load action seems to be DontCare.
    So the _MainTex has nothing is colorBuffer, and because the format of RT has no alpha channel, the empty pixel on this RT is black.

    Based on this, the final screen is black like below Snipaste_2020-01-14_13-55-51.png
    The Blue in left is the first cameras solidColor.

    I want the rendering result of the second cam blend to the first, but not covers the first result.

    Maybe I should change the load action of the new renderTexture to Load. But I dont know how to do that.
    Or maybe I should change the second cameras RT. I tried it with command buffer but not working.
    Can anyone please help me.
     
  2. ff_acc

    ff_acc

    Joined:
    Jan 14, 2020
    Posts:
    2
    My second camera's clear flag is dont clear, I forgot write it