For some reason it outputs Grey with Unlit, and Black with Lit. What’s going on here exactly? I have Opaque Texture enabled in the Render Pipeline settings.
Scene Color uses _CameraOpaqueTexture
which is not compatible with the new 2D Renderer, the last answer I got about this was months ago, they said that they are aware of the problem and will work on it at some point, but that it is not a priority so they cannot give any release date.
Edit:
I did find one of the mentions to it in the following link, I read another comment with a little more of detail on another post but because it wasn’t directed to me I cannot find it I’m afraid (both around the same lines, Unity doesn’t seem to consider it a priority), look for @Chris_Chu answer to @dr4 comment.
Well, the best solution I found was getting a Texture from a second camera. Depending on the case it might work for you. Remember to hide the objects that use this texture from the second camera.
In case if you haven’t found the solution yet,the shader graphs u are creating must recieve lighting in order to be visible.make a 2d light(point light,global light) from the hierarchy,bring it near ur objects and it should be fine.
Mine is still grey and I tried adding a global 2D light, I would guess that if the shader is unlit you shouldn’t need any lights right?
Any solution to this? I’ve been struggling for hours trying to get it to work.
I was getting the same thing. I realized I only had objects that were rendering to the transparent queue in my scene. When I added an opaque object then that showed up in the scene color node. A hack I did was just set my transparent objects to an earlier queue like alpha test or something and then they were included and still transparent. However, this required managing their order carefully since they are rendering with opaques.
Here’s a comprehensive answer…
The Scene Color Node does not work because it uses the _CameraOpaqueTexture. Since the 2D Renderer does not generate an opaque texture - and transparent sprites do not write to that texture - it’s not going to work.
You probably want to use the _CameraSortingLayerTexture. You can find a demo of it here:
Look for the Heat Haze Overlay scene. It essentially lets you take a snapshot of the current state of the transparent scene at a particular point.
Set up your 2D Renderer Data asset to generate the _CameraSortingLayerTexture.
To sample it, 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.
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.
Another option is using a Render Texture.
How does a RenderTexture contrast with _CameraSortingLayerTexture?
You may use multiple RenderTextures if you need them, whereas _CameraSortingLayerTexture only supports ONE texture. Its advantage is it’s built into the 2D Renderer, and it’s slightly faster esp for mobile b/c it’s built into 2D Renderer pass. Also it operates between a Sorting Layer, so unlike a RenderTexture you don’t use Layers (and separate cameras).