Search Unity

Bug RenderTexture shows completely black on Android/iOS and WebGL builds but works perfectly in Editor

Discussion in 'General Graphics' started by tuncturelFlavour, Jan 18, 2023.

  1. tuncturelFlavour

    tuncturelFlavour

    Joined:
    Oct 27, 2021
    Posts:
    3
    Hi there,

    We're on Unity 2021.3.14f1 and have a camera that views the avatar of the player. This camera has its Target Texture field set to a RenderTexture asset in our project. This RenderTexture asset is then referenced in a RawImage component on the UI where we can see it. Long story short during Play time in the Editor we can see the avatar on our UI element where the RawImage is and everything works as intended. When we build our game into WebGL, Android or iOS the RawImage show pitch black instead. I'm looking for some advice on solving this issue. Below I'm attaching some screenshots to give more information.
    -We have already tried changing the color format and depth stencil format which had no effect on the matter.
    -We also tried adding a material (a default sprite material) to the RawImage component and that also had no impact on the matter.
    It seems this issue started after we switched from Unity 2021.3.9f1 to 2021.3.14f1

     
  2. tuncturelFlavour

    tuncturelFlavour

    Joined:
    Oct 27, 2021
    Posts:
    3
    We finally solved this bug. More like we found a way around it but I will detail next week how we found more clues and what we did to apply a fix. I'm a bit exhausted so the details will have to wait a little.
     
  3. JohnHer

    JohnHer

    Joined:
    Jun 11, 2019
    Posts:
    6
    How did you fix that? Dealing with the same issue right now
     
  4. nov411337

    nov411337

    Joined:
    Jan 27, 2019
    Posts:
    9
    We are facing the same problem using 2022.2.6f1. Can you just give an hint about the way around?
    It is very frustrating making videogames like this. Wasting 500% effort to fix problems on webcam and input texts on webgl...
     
  5. h1ggs

    h1ggs

    Joined:
    Dec 21, 2017
    Posts:
    14
    hi can we get an update on how you fixed it???
     
  6. nov411337

    nov411337

    Joined:
    Jan 27, 2019
    Posts:
    9