Search Unity

Help Wanted LWRP Distortion Trick: Does this still work?

Discussion in 'Shader Graph' started by Horus_Sungod42, Jun 10, 2019.

  1. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    75
    Hello, I've seen a cool tutorial to get a distortion-like effect in the LWRP, using the shadergraph.

    https://twitter.com/cirocontns/status/1024373927739568128?lang=en

    However, I can't get it to work, the _CameraOpaqueTexture texture node only return gray. Does this neat trick still supposed to work? How can I get a texture 2D asset to give me the camera's opaque texture?

    - The camera has Opaque Texture on.
    - The shader's master node is set to transparent.
    - I'm in the 6.5 LWRP

    Thank you
     
  2. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    75
    On further research, I saw the existence of the Scene Color Node.

    However, still no luck. I'm unable to use the camera opaque texture in a shader, the node returning only gray.

    Is there something special to plug in the Scene Color's input?

    - The camera has the Additional Data script.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    8,364
    It has to be enabled on the pipeline asset as well.
     
    Horus_Sungod42 likes this.
  4. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    75
    That seems to have done the trick. When the camera has depth on, but not the asset, it flickers.

    Thank you!
     
  5. jakobskote

    jakobskote

    Joined:
    Feb 15, 2017
    Posts:
    48
    @Horus_Sungod42 How did you manage to remove the flickering? I'm following this blur tutorial, but the Texture I get from _CameraOpaqueTexture is flickering constantly and not showing in scene. I tried disable/enable depth on both camera and pipeline asset.

    EDIT: I managed to resolve this issue by restarting Unity. Good times. Still flickering af in the shader graph editor though, but works in scene.
     
    Last edited: Oct 22, 2019
  6. DuvE

    DuvE

    Joined:
    May 22, 2016
    Posts:
    117
    Is LWRP going to support not only Opaque texture? Because it is a really big restriction, able to distort only the opaque objects.
     
unityunity