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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Releasing render texture that is set as Camera.targetTexture! bug in 5.3

Discussion in 'General Graphics' started by fdsagizi2, Dec 10, 2015.

  1. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    Hi! In unity 5.3 we begin recive this message

    Releasing render texture that is set as Camera.targetTexture!

    and camera.targetTexture == null

    It happens only when we build game for Windows and MacOs ( WebGL work fine )

    Why it could happen?
     
    Last edited: Dec 10, 2015
  2. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    535
    I have exactly the same problem, don't have any idea what is that.
    I use one camera with renderTexture which created runtime. maybe need to mark it somehow. to prevent it from releasing?
     
  3. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    535
    Found temporary solution.
    I just created render texture in editor. and at runtime just change texture size and clear it. so it doesn't wiped out on resize.
     
  4. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    I have the same bug on output log pressing ALT+ENTER on Windows.

    I tried your solution but it doesn't work, maybe I'm missing something.
    I create a render texture in editor and link it to a Serialized variable in a script. At runtime in the Awake method I just change the size and antialiasing as user had set (what about clear it? How can I do?). Then I assign it to camera.targetTexture in the same method but the bug still persists.

    Can you please tell me more in details how to solve it?
     
  5. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    535
    have you tried to link render texture to camera.target without temp variable?
     
  6. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    I fixed this by turning off Occlusion Culling on the camera. Hopefully this helps someone else *shrug*
     
    misterlee likes this.
  7. misterlee

    misterlee

    Joined:
    Sep 19, 2014
    Posts:
    54
    I was getting this error every time I saved my scene! I tried turning off Occlusion Culling and it seems to have fixed it. Weird bug, thanks for the tip cadpeople!
     
  8. misterlee

    misterlee

    Joined:
    Sep 19, 2014
    Posts:
    54
    Ok I take it back, that didn't fix it after all. It still errors and looses my texture when I save after turning off occlusion culling on the camera.

    erm... sometimes. :(