Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Clarification on "Enable Compatible Format" for Render Texture

Discussion in 'General Graphics' started by dvdfu, Apr 22, 2022.

  1. dvdfu

    dvdfu

    Joined:
    Sep 1, 2015
    Posts:
    9
    Hi there, I'm making a mobile game that uses some post-processing effects (bloom) and also renders everything to a RenderTexture before displaying the final output. The color format for this RenderTexture is R16G16B16A16_SFLOAT.

    I learned recently that about 10% of Android testers are seeing black screens, because HDR render texture formats using floating-point numbers are only available in OpenGL ES 3.2, so everyone with devices that don't support that are unable to see anything.

    So I enabled "Enable Compatible Format" on the RenderTexture. The Unity manual describes this setting as so:

    Enable this checkbox to make Unity apply a compatible format to the render texture if the defined Color Format is not supported by the platform.​

    I was hoping the RenderTexture would fallback to a more widely supported color format if the device doesn't support R16G16B16A16_SFLOAT, but this doesn't seem to be the case, as 10% of the testers are still encountering a black screen.

    There seems to be lack of further documentation on what this setting does! What format does it actually fall back to? What is it checking to determine device compatibility? Is this setting what I should be using in order to support players on OpenGL ES 3.1 or prior?
     
  2. dvdfu

    dvdfu

    Joined:
    Sep 1, 2015
    Posts:
    9
    Solved this. It seems like ARGBHalf is the default used for HDR render texture formats, and ARGB32 is the default otherwise. Compatibility is checked using SystemInfo.SupportsRenderTextureFormat.

    It's worth noting that for correct results, I also needed Grading Mode set to LDR in the URP pipeline asset:
    upload_2022-4-26_16-5-33.png