Help me understand depth pre-pass stuff.

So I was working on some effects in URP 12.1.7 and was having fun with the ability to sample the depth texture in the opaque queue by setting my depth texture mode to force prepass. In URP 13.1.8 this is no longer possible… I guess…? The force prepass option is gone from the Pipeline renderer asset and replaced with the after transparents option. But here’s the thing… It still works… in edit mode.

Incidentally, back in UPR 12.1.7 flipping on depth priming mode revokes my opaque queue depth texture access, which seems counter intuitive.

I’ve tried poking through threads in search of answers and not been able to find much of anything. I’m clearly messing with powers beyond my understanding, but I’d just like to know what’s going on.

Hey, I suggest ignoring URP 13 (2022.1) and upgrading to URP 14 (if you’d like to) once it becomes stable.

There’s nearly no new feature in URP 13 compared to URP 12, and things like FSR 1.0 didn’t get backported to it too.
8656791--1165347--URP13.jpg

I think you can try enabling SSAO (After Opaque unchecked), and that should allow you to access Depth Texture in opaque rendering.

If it works, that’s because SSAO (After Opaque unchecked) requires Depth Texture and will be executed before opaque rendering. So URP will always enqueue a Depth Pre-pass to generate the depth texture rather than copy the depth buffer after opaque rendering.

Depth Priming will set the render target of Depth Prepass to depth buffer (camera’s depth), and only render pixels with equal depth value during opaque rendering.

If URP doesn’t copy depth before opaque, the Depth Texture won’t be available in opaque rendering. I think enabling SSAO (After Opaque unchecked) should solve the issue you encountered.

You can also write an empty renderer feature ( similar to this , but not the same) instead of adding SSAO.

  • Render Pass Event set to “BeforeRenderingOpaques”.
  • Replace the Normal requirement to Depth: ConfigureInput(ScriptableRenderPassInput.Depth);