How can I use world normals in a post processing shader?

In a nutshell, I want to do a post processing effect using the world normals of the scene.

I’m using Unity 2020.3.26 and URP 10.8.1 and I tried hard to use _CameraDepthNormalsTexture in my unlit shader but it doesn’t work no matter what I do (although _CameraDepthTexture works fine). I obviously set cam.depthTextureMode = DepthTextureMode.DepthNormals.

What can I do to access the world normal texture in a post processing shader?

Include this hlsl and just use SampleSceneNormals

But be sure you’ve configured your ScriptableRenderPass properly in your PPS ScriptableRendererFeature, it will guarantee that DepthNormalOnlyPass will be always executed before your renderer feature (if it’s not been executed yet) and _CameraNormalsTexture will be filled.
8424399--1114989--upload_2022-9-8_12-10-22.png

1 Like