DepthWrite
Description
This is a shader for depth write. It can either write all the depth from the scene at once or render models one by one, but with alpha support. It also has treesway support.
This shader outputs Depth based on
ProjPos.W, so it's only suitable for Perspective cameras. It won't work with Orthographic projection (shadow maps), since ProjPos.W for Orthographic is always equal to 1. In this case, you'll need to create your own shader analogous to DepthWrite that outputs ProjPos.Z using Shaders/screenspace_general.Parameters
ITexture BASETEXTURE
Basetexture allows the shader to work with the
.a channel to create alpha support for depth.boolean COLOR_DEPTH
Write depth as color. Allows output of
COLOR0 as ProjPosW / 4000. This is what render.GetResolvedFullFrameDepth does.
To normalize the depth buffer, use this formula:
1 / depth / 4000.Default: false
Garry's Mod
Rust
Steamworks
Wiki Help