Search Unity

Why you're getting a mystery TempBuffer on mobile device after removing Post Processing from project

Discussion in 'Editor & General Support' started by sampenguin, Jan 28, 2019.

  1. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    https://issuetracker.unity3d.com/is...r-does-not-disable-cameras-m-forceintort-flag

    Took me a couple days to track down this issue, happening in 2018.3.1f1. Cross posting it here so anyone else googling for "what is creating TempBuffer unity mobile ios" might stumble across it and not beat their head against a wall for days.

    Basically if you ever used Unity's Post Processing stack in your project, then removed it when you realized it is death on mobile devices, it doesn't clean itself up all the way on any camera that had a Post Process layer attached to it. The fingerprints are if you run the profiler and open the rendering frame debug window, you'll see an unnecessary execution of "Camera.ImageEffects" calling a Hidden/BlitCopy shader and copying this buffer to your final window target.

    The quick workaround is to turn debug mode on Inspector on your camera object, then turn off the "Force Into RT" checkbox. Instant performance and memory win!

    Unity's PP stack should really come with a giant red flag warning to NOT use it on mobile targeted projects.
     
    RockWoo, chrismarch, wuageek and 4 others like this.
  2. Ville

    Ville

    Joined:
    Oct 5, 2012
    Posts:
    19
    Thanks, I got hit by this.
     
  3. EirikWahl

    EirikWahl

    Joined:
    Apr 7, 2018
    Posts:
    21
    Thank you so much for posting this!
     
  4. tangwilliam

    tangwilliam

    Joined:
    May 4, 2016
    Posts:
    22
    Thanks ! I just came into this problem.
     
  5. roberto_sc

    roberto_sc

    Joined:
    Dec 13, 2010
    Posts:
    144
    I'm having the same problem.

    How did you find out about this and what does "Force into RT" really means?
     
  6. VRHealthMain

    VRHealthMain

    Joined:
    May 24, 2017
    Posts:
    14
    You just saved me after a 2 month long search for answers. I had a strange jitter in oculus quest. I just couldn't find why! It was that Force into RT thing! You are Awesome!
     
  7. LucasRizzotto

    LucasRizzotto

    Joined:
    Dec 11, 2015
    Posts:
    27
    Got hit by this as well, but the camera already has Force Into RT off.
     
  8. wuageek

    wuageek

    Joined:
    Aug 14, 2020
    Posts:
    1
    Cheers! Unity PP Stack is really a hell for Mobile.
     
  9. JJunior

    JJunior

    Joined:
    May 22, 2019
    Posts:
    53
    After many builds and tests on android I realized that this 'force into rt' was killing my game performance on mobile... Them I searched for it on google and found out this thread! Thanks to share this man!
     
  10. FissicsPeep

    FissicsPeep

    Joined:
    Jan 14, 2014
    Posts:
    80
    I am seeing similar on my project. I have checked that the "Force into RT" is off.

    In the frame debugger, I am seeing two clear's of mystery 1x1 tempbuffer's for both my main camera and a secondary camera.



    I have no idea what these are, or what system owns them. I don't know how I can find out more information about them in Unity. I want them gone :)

    (Unity 2021.2.7f1)
     
    Last edited: May 15, 2022
  11. yuluotian

    yuluotian

    Joined:
    Mar 13, 2022
    Posts:
    2
    I'm facing the same problem but I'm sure I turned off "Force into RT".
     
  12. yuluotian

    yuluotian

    Joined:
    Mar 13, 2022
    Posts:
    2
    Well, I finally found out what the problem was:
    the AdditionalLightsShadowCasterPass and MainLightsShadowCasterPass will always call ShadowUtils.GetTemporaryShadowTexture(...) to create a 1x1 TempBuffer When there are no shadow-casting main(additional)lights in the scene or "Cast Shadows" is off in URP assets.
     
    lvwxu likes this.
  13. night533

    night533

    Joined:
    Jan 15, 2015
    Posts:
    7
    I am facing the same problem too...
    It seems there's no other way than waiting for the official fix.....