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

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.

1 Like

Same problem for me. I’m giving up on the idea for now.

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.

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.

I’m also looking for a solution.

Not working on 2019.3.3f1 + URP 7.2.1

Have the same problem.

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

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/

1 Like

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

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.

1 Like

This is going to force render everything again causing huge performance cost. Surely this is not the optimal way?

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

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…

2 Likes

When it’s gonna be fixed? I can’t work n my projects because no one renders water shader.

1 Like

It’s rather the 2D Renderer does not support the OpaqueTexture yet… Hopefully it lands soon, cause I also need it badly.

1 Like

It used to work in my game in 2019.2. But after updating a year ago Unity juust destroyed it.
Here how it worked:
https://www.youtube.com/watch?v=qyfmsWs5klQ

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