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

MRT RenderTextures: log says "colorHandles[0].object->backBuffer == depthHandle.object->backBuffer"

Discussion in 'Scripting' started by metaleap, Jun 27, 2014.

  1. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    I've been using multiple-render-targets for over a month successfully now.

    The setup has 4 RenderTextures: [0]=ARGB32, [1]=RGHalf, [2]=RGB565, [3]=Depth

    This worked fine all the time with Camera.SetTargetBuffers, all RenderTextures were created only once during app start-up and destroyed on exit.

    So today I thought "I'm gonna be a smart one" and disable RT [2] if a certain user-config-setting indicates it's never needed or sampled. Means, instead of "create once during app start, destroy on exit", I now have to recreate the tex array as that config setting is toggled. (OK I could do acrobatics of keeping the others alive and resizing and reshuffling the array, but hey brute-force doesn't hurt during code-prototyping.)

    That actually all works perfectly fine but whenever said user-config-setting is toggled (and only then) and the rendertexes-array is recreated, I get the following the 3 new, never-seen-before messages:



    Odd, huh? What does that tell me? Looks like a warning I should heed, even though everything works smooth as silk!
     
  2. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    After a restart of Unity, now when recreating all RenderTextures, I find a console warning (not error) message:

    RenderTexture: Resolving non-color surfaces.

    Once so far Unity also crashed when I triggered recreating of all MRT rendertextures+renderbuffers. Seems to happen only very rarely but sometimes.

    What the heck is the "safe" way of recreating multiple-render-target-buffers at runtime?