Hi,
I just tested Scene Color node with URP 2D and I didn’t managed to get it working… The output is simply solid color. I made sure that everything is set up correctly but no luck. And then I switched to URP 3D and magically the shader worked. I wonder if URP 2D needs some extra setup or is it just not supported?
The 2D Renderer can be set up to use _CameraSortingLayerTexture. It’s not quite the same as SceneColor but similar.
Look for the Heat Haze Overlay scene.
Dev discusses setup here: Unity 2DRenderer Heat Distortion shown in the Unity GDC Showcase 2021 not working (note this post is a little old so the github is probably more accurate if something seems off). See also: 2D renderer -> _CameraSortingLayerTexture · Issue #1 · gamedevserj/Shader-Graph-Experiments · GitHub
How to set it up
In Shader Graph declare a new Texture2D property, make sure its reference is _CameraSortingLayerTexture, and UNCHECK Exposed. This tells ShaderGraph to get the global texture by that name.
Set up your 2D Renderer Data asset to generate the _CameraSortingLayerTexture.
The sprite that makes use of that Shader Graph must be set to render AFTER the _CameraSortingLayerTexture is created (set it to a later Sorting Layer) or else you’ll get the last frame’s colors which will look very odd.
1 Like