← All resources

Depth | Unity Shader Code Basics 04

Auto-discovered

Video / channel Beginner

Daniel Ilett

Visit resource ↗

Description

This YouTube tutorial by Daniel Ilett is part 4 of Unity Shader Code Basics. It is a single free video lesson on depth in Unity shaders, continuing from earlier parts on texturing and transparency.

It covers the depth buffer and z-testing, ShaderLab ZWrite and ZTest, reading _CameraDepthTexture for a silhouette effect, adding DepthOnly and DepthNormals passes so custom opaque shaders appear in depth-dependent effects, linearizing depth with Linear01Depth, and an x-ray style override using URP Render Objects with a Greater depth test.

It is for beginners to intermediate Unity shader authors working in URP who can already write basic HLSL ShaderLab passes. Prior parts of the series help, but depth concepts are explained with live edits.

Access is a free YouTube upload with a spoken walkthrough of shader files and Scene View checks. No paid assets are required beyond a URP project.

It is useful as a practical depth primer that connects buffer theory to silhouette, depth-prepass, and Render Objects workflows you can copy into custom shaders.