Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question WebGL 1 issue with Texture creation and ShadowAuto

Discussion in 'Web' started by Binngi, Apr 18, 2023.

  1. Binngi

    Binngi

    Joined:
    Jul 18, 2018
    Posts:
    2
    Hello everyone,

    after upgrading from Unity 2021.3.10f1 to 2022.2.14f1 due to some scene loading issues I got errors after the initial loading screen and I just don't know what causes them or how to address them.

    The Debug Build shows the following error alongside an NullReferenceException multiple times:

    Texture creation failed. 'R32_SFloat' is not supported for Render usage on this platform.


    It seems like the game is stuck in a loop, because the JS error log keeps on throwing the same errors as well. In the JS log I also got the error message:

    'ShadowAuto' is not supported. RenderTexture::GetTemporary fallbacks to DepthAuto format on this platform.


    I am confused because I don't use a render texture and did not change a texture format prior to this error.

    Even after changing the texture formats of the Sprite Atlasses and individual textures, as well as the compression formats in the player settings, the error message did not change.

    I am working on a browser game that has to run on both desktop mobile devices, therefore I am using the depreciated (and not supported for mobile devices) WebGL 1, so I cannot switch to WebGL 2. I Used this in the past and despite memory issues it worked just fine.

    Thanks for your help!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,058
    I can't help with this particular issue but you can relatively quickly try to narrow down if this is due to some internal Unity change by testing a build made with the earliest and latest previous minor versions (the middle digit).

    In this case try 2022.2.0f1 first and see if the same issue occurs. If not and all is fine you can divide and conquer by trying the (latest / 2) patch version, ie 2022.2.8f1 (latest = 2022.2.15f1). If that works try a higher minor version until you find the version where it breaks. Then you can check the changelog and/or report a bug.

    You may also try the latest 2021.3.23f1 if even 2022.2.0f1 fails to see if a simple patch version update helps.

    Notably you should first delete the Library folder of the 2021.3.10f1 version of the project to see if the issue persists after deleting the library. If it does, make a copy of that project and open it with a different Unity version. Ideally, use a fresh copy for every version upgrade just to be on the safe side in regards to what's been cached in the Library folder. Most certainly do not open a project with an earlier Unity version without first deleting the Library, and avoid downgrading Unity on the production version of the project.

    Ultimately you will want to figure out the cause of the "scene loading issues" that prompted you to update. After all, those may not have to do with the Unity version but may be project specific. By upgrading you may simply alter the behaviour of the issue, thus the error you reported may actually be related to the same issue but they show up differently in builds.

    Render textures are used for a number of non-obvious things like video players and possibly in 3rd party packages/assets. Sometimes it helps to do a "find in files" including packages for the related error messages or usages of types.
     
    Last edited: Apr 19, 2023
  3. Binngi

    Binngi

    Joined:
    Jul 18, 2018
    Posts:
    2
    Thanks CodeSmile! I will try to use other Versions of Unity and narrow down the issue.
    Also thanks for the hint with the render textures, I will look into that.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,058