Search Unity

Scene Color ShaderGraph Node (_CameraOpaqueTexture) with URP & 2D lighting

Discussion in 'Shader Graph' started by Cerzi, Oct 9, 2019.

  1. Cerzi

    Cerzi

    Joined:
    Dec 28, 2014
    Posts:
    12
    Can anyone confirm that the _cameraOpaqueTexture does not render any URP sprites in the current version? I've tried just about everything and can't get the texture to render any sprites, even those set as opaque.

    Is there any fancy new approach to this, such as being able to render certain layers (even if theyre transparent) before doing the opaque texture grab? Seems like this might now be possibly but it's hell trying to find any documentation that is up to date.
     
    dr4 likes this.
  2. Torgie

    Torgie

    Joined:
    Apr 7, 2015
    Posts:
    7
    Same problem for me. I'm giving up on the idea for now.
     
  3. whoisj

    whoisj

    Joined:
    Jan 4, 2018
    Posts:
    26
    Does the Scene Color Node not work for you?

    Which master node are you using? I ask because each master node defines a set of keywords which enable/disable functionality throughout the pipeline.
     
  4. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Scene Color Node is not working for me either (2019.3.0f3 + URP 7.1.7 + Shader graph 7.1.7) although I made the PBR master node surface to transparent.
     
  5. Expsy

    Expsy

    Joined:
    Nov 4, 2016
    Posts:
    5
    I'm also looking for a solution.
     
  6. vetasoft

    vetasoft

    Joined:
    Nov 15, 2013
    Posts:
    432
    Not working on 2019.3.3f1 + URP 7.2.1
     
  7. Inspekt

    Inspekt

    Joined:
    Aug 11, 2015
    Posts:
    4
    Have the same problem.
     
  8. dr4

    dr4

    Joined:
    Jan 14, 2015
    Posts:
    108
    I asked around 4 months ago and one of the Unity collaborators said that they are aware of this and that it will be fixed, but there is no dates for when that will happen
     
  9. Mucha505

    Mucha505

    Joined:
    Apr 19, 2015
    Posts:
    6
    Hi, I've had similar issue, where I needed to use _CameraOpaqueTexture to create gravity distortion effect and managed to make it work with 2D Renderer, URP, Unity 2019.3

    In this link https://unitylist.com/p/wsc/Shader-Graph-Experiments I've read that you can "create a second camera that renders to a texture and use that as a property instead of _CameraOpaqueTexture." and that' exactly what I've done:

    1. Create render texture
    2. Create secondary camera that display same content as main camera and set render texture to the texture you've just created.
    3. In shader graph use this render texture instead of _CameraOpaqueTexture

    Here is more detailed tutorial about render texture http://unity.grogansoft.com/in-game-security-camera-using-render-texture/
     
  10. DrabanL

    DrabanL

    Joined:
    Nov 13, 2014
    Posts:
    41
    weird, i tried that but it looks like its actually working only in Scene view. in Play mode i see just white color

    ----

    EDIT: i should have mentioned that i was using a UI shader, in which case i had to use Unlit shader to make it work in UI
     
    Last edited: Apr 26, 2020
  11. Mucha505

    Mucha505

    Joined:
    Apr 19, 2015
    Posts:
    6
    I forgot to mention that I've set the second camera layers to not display the "default" layer.
    Then I've set the layer of object displaying my gravity distortion effect to the "default" layer.
    And at the end I've made sure that none of my objects is using the "default" layer (because I'm using this layer for the GrabPass)

    I've done that because the effect was working on itself recursively and I've had the same "only white color" issue in play mode.
     
    DrabanL likes this.
  12. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    This is going to force render everything again causing huge performance cost. Surely this is not the optimal way?
     
  13. dr4

    dr4

    Joined:
    Jan 14, 2015
    Posts:
    108
    it is not,any current solution has massive performance issues, ideally Unity would add this feature back, but they don't seem to consider it as a priority for some reason, when I saw that it was removed I expected it to be back in the next release, a year later, still no word about it
     
  14. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I really hope Unity communicate their 2DRenderer plans better. We know it is not supported pretty much.. but will it ever be? I hate to be in a dark room..
     
    dikar771 and dr4 like this.
  15. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    When it's gonna be fixed? I can't work n my projects because no one renders water shader.
     
    dikar771 likes this.
  16. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    It's rather the 2D Renderer does not support the OpaqueTexture yet... Hopefully it lands soon, cause I also need it badly.
     
    EyeDev44 likes this.
  17. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    It used to work in my game in 2019.2. But after updating a year ago Unity juust destroyed it.
    Here how it worked:


    After update it not rendered. Since 2021.2, it rendering just a transparent color without any normal distortion.