Search Unity

Question UV modifications do not work on _CameraOpaqueTexture.

Discussion in 'Shader Graph' started by RedVonix, Oct 28, 2019.

  1. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    As the title says... there appears to be no way at all to modify the UV of the _CameraOpaqueTexture, even though numerous tutorials I've read online show doing just that to get some nice distortion. As the attached image shows, I'm creating a sprite shader with distortion, and I've gotten it to the point where it renders out the _CameraOpaqueTexture just fine, and I can modify the output of the SampleTexture2D node just fine. But nothing I do affects the UVs, which is what I kind of need to be able to distort it!

    Capture.PNG

    Any thoughts on what I might be doing wrong here? Thanks!
     
  2. whoisj

    whoisj

    Joined:
    Jan 4, 2018
    Posts:
    26
    Where is `CameraOpaqueTexture` coming from - just naming a graph node that doesn't produce any magic that I know of.

    Where and how are you applying the Sprite Lit texture?

    Are you just trying to warp a section of the screen or all of it?
     
  3. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    With Scriptable Render Pipeline, you can toggle a setting that causes _CameraOpaqueTexture to give you the render output from the camera (described here for reference: http://www.fabiocolombini.com/2018/08/shadergraph-refraction.html).

    In the above example I am showing that even without a texture, the material does not warp the shader. This same problem occurs regardless of what shader type is used.

    My final end-result is do essentially have things like glass and water that warps what is behind them.