Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Superfluous "Requested RenderTexture format is not supported on this platform" warnings

Discussion in 'General Graphics' started by FU_JPS, Oct 27, 2021.

  1. FU_JPS

    FU_JPS

    Joined:
    Nov 21, 2012
    Posts:
    12
    We recently upgraded our Unity project from 2018 to 2020.3.11f1 and now on startup we constantly get the warning "Requested RenderTexture format R8 sRGB (1) is not supported on this platform, using R8 UNorm (5) fallback format" filling up the console window on startup. The warnings themselves seem to be harmless but they really increase the noise in the console. There's no callstack or anything to indicate where the warnings are coming from. Is there somehow we can pinpoint the cause of the warnings and fix them?

    Our project does use a couple custom effects that use single 8-bit channel RenderTextures that we create with RenderTextureFormat.R8 but I see nowhere to specify whether it's sRGB or UNorm.
    Unity - Scripting API: RenderTextureFormat (unity3d.com)

    I tried deleting Library\ShaderCache as suggested in some other forum posts with similar warnings but no luck.

    upload_2021-10-27_17-3-27.png
     
  2. ValentinHm

    ValentinHm

    Unity Technologies

    Joined:
    Dec 10, 2020
    Posts:
    14
    Last edited: Oct 27, 2021
  3. FU_JPS

    FU_JPS

    Joined:
    Nov 21, 2012
    Posts:
    12
    Thanks for the tip! I've just been inundated with other tasks but I'll try it out when I get the chance.

    A couple quick questions though:
    1. Rendering.GraphicsFormat is listed under "Experimental" - is that still safe to use in production?
    2. The warning message makes me think this is platform dependent; our game is for Android and iOS, so will we need to test both sRGB and UNorm and then choose the one that's supported?
     
  4. NicoLeyman

    NicoLeyman

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    33
    We've been working on getting GraphicsFormat out of experimental. It's not fully there yet but it is the format to use if you want to know what format is being used by the graphics hardware.
    Higher level formats like RenderTextureFormat are less specific and have some more automatic fallback options.
    That does tend to lead to issues where you unknowingly end up with a format that doesn't exactly do what you expect it to.
    GraphicsFormat indeed requires you to manually test for a suitable format that the current platform supports. You can then adapt your code's behavior to the supported format. There should be quite a few functions to help in the GraphicsFormatUtility class.