Search Unity

RenderTexture transparency ignored

Discussion in 'Universal Render Pipeline' started by Pimpace, Oct 22, 2019.

  1. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Hello!

    I have a camera with output target to a render texture. When I turn on post process on this camera, transparency is gone. More precisely, background transparency. It shows the opaque color of this camera no matter if color's transparency is zero. Background type set to solid color.

    Is this the intended behavior?
     
    burningmime likes this.
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi,
    which rendering pipeline and more specifically on which Unity version are you working at the moment? This situation is currently somewhat fragmented with standard render pipeline, SRP with HDRP and LWRP which now morphed to URP and differences between 2018, 2019.2 and 2019.3.x. I know that some effects affect alpha (or overwrite it?) at least when using Post-processing Stack v2 on 2018 and HDRP. I haven't tried that on 2019.3 and with HDRP/URP yet, actually I should check it. But it's different thing as the post-processing is built in to those new render pipelines.

    Anyway, if I assume you were on 2018, I know that Vignette effect writes to alpha, if you have post-processing on, you will see white gradient in the alpha channel. Bloom too writes that halo to alpha. But you shouldn't get flat alpha.

    Anti-aliasing modes affect that alpha too I think, if you have FXAA on, post-processing stack v2 effects use alpha to store LDR luminosity. I'm not expert on this but at least in some cases this ends up to the final alpha of the RenderTexture.
     
    Last edited: Oct 22, 2019
  3. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    This is URP forum is not? :) But fair enough.

    I'm using URP with Unity 2019.3.0b7 and I'm usign post processing V3. (V3 is already built into URP) Film grain, Chromatic Abb, Bloom, Color Adjustment. I'm using these PP on the camera I wanna project the renderTexture. (corr.: projected into 3D object's transparent material what sees the main camera)

    I did some further test; I turned off all the PP effects, also the AA options on each camera. The only thing I did, I checked the Post Processing checkbox under the rendering group on the render texture targeted camera.

    Bammm... alpha/transparency is gone. It's probably a bug.
    Can you confirm this @Olmi?
     
  4. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Ouch sorry I somehow missed that lol, checked new posts and somehow mixed up the forum section in my head... I'll check it here sec.
     
    Last edited: Oct 22, 2019
  5. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Sigh, exactly same result, as soon as I toggle the "Post Processing" option on under the Rendering sub-section, the alpha gets solid white. So yes, same behavior as you had over there. Looks like a bug unless this is somehow the expected behavior now.

    I was using Unity 2019.3.0b7.
     
    Last edited: Oct 22, 2019
  6. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Thanks @Olmi!

    erhhmmm... can we expect a Unity developer here, please?
     
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Which version of Universal RP are you using?
    7.1.1 should have this fixed.
    If it's not, please report a bug.
     
  8. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    7.1.2 Sir! And sadly hasn't got fixed. :( Bug report just sent for this.
     
  9. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Bump! Still there in 7.1.6 with Unity 19.3.0f3.
    Any news?
     
  10. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Hey!

    I contacted with devs on this matter, and they replied that this is by design. So they wont make it to work. This is because PP effects needs alpha itself, so it wont work with render textures which also use alpha channel. :(
    This is it, such is life Mate... :(
     
  11. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Oh wow...It worked back then with pp stack v2, right? Or was it even before that?
    That's so sad, it means that I can't have a nice antialiasing on my RT :(
     
  12. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Has anyone figured out a way to have antialiasing on RenderTextures with transparency? I have the exact same problem.
     
  13. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    Dude, did you read the thread? ;) this
     
  14. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Sorry -- to clarify, I mean "has anyone figured out a workaround". Such as an algorithm for adding antialiasing manually.
     
    StripeGuy likes this.
  15. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    41
    The key here is the transparency. It just wont work, they did this by design... o_O I don't get it either. If this has a workaround, I think it has big impact on performance.
     
  16. sinjimonkey

    sinjimonkey

    Joined:
    Jul 31, 2013
    Posts:
    72
    Okay so the more pertinent question is ... how do I turn the URP off??? I don't care about any special pipeline stuff I just need alpha channels work work with render textures to play transparent video clips!!!

    I need this to work the way it did in Unity 2018!
     
  17. sinjimonkey

    sinjimonkey

    Joined:
    Jul 31, 2013
    Posts:
    72
    Okay, URP isn't default in Unity (Yet) and I don't have it installed... so this isn't what's causing my problem...