Quick answer: Call ConfigureInput(ScriptableRenderPassInput.Depth) in your pass. URP only generates _CameraDepthTexture when a pass declares it needs it.
A custom URP fog pass samples _CameraDepthTexture. It reads all zeros — URP didn’t produce the depth texture because nothing requested it.
Declare the Input
public class FogPass : ScriptableRenderPass
{
public FogPass()
{
ConfigureInput(ScriptableRenderPassInput.Depth);
}
}
URP scans all passes’ declared inputs. If any wants Depth, URP runs the depth prepass and binds _CameraDepthTexture.
Combined Inputs
ConfigureInput(ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal | ScriptableRenderPassInput.Color);
Request multiple. URP produces _CameraDepthTexture, _CameraNormalsTexture, _CameraOpaqueTexture as needed.
URP Asset Setting
Also enable Depth Texture in the URP Asset (or per-camera). ConfigureInput is the per-pass request; the asset toggle is the global enable. Both should align.
Render Graph (URP 17+)
With Render Graph, use resourceData.cameraDepthTexture as an explicit input to your pass node. The graph tracks the dependency automatically.
Verifying
Fog pass samples depth correctly — fog density varies with scene depth. Frame Debugger shows the depth prepass running before your pass.
“URP is demand-driven. Declare ConfigureInput(Depth) and the depth texture appears.”
For mobile, the depth prepass has a real cost — only request Depth in passes that genuinely need it, not speculatively.