Garry's Mod Wiki

showz

Description

Outputs the $BASETEXTURE of the .a or .r channel, raised to a power for debugging the depth texture. Use the r_showz_power convar to raise the resulting depth image to a power. This number can also be negative: r_showz_power -1.

$BASETEXTURE works only with capital letters. If you enter it in small letters, the texture will not be added to the material. Also, the texture should be entered after creating the material. For the same reason.

Parameters

ITexture BASETEXTURE
Texture of depth. Example: _rt_ResolvedFullFrameDepth.
number alphadepth
Selecting a channel of $basetexture for output from a shader. 0 — show .r channel; 1 — show .a channel.

Example

Creation of showz material and output render.GetResolvedFullFrameDepth to HUD.

local mat = CreateMaterial("showz_resolvedfullframedepth", "showz", { ["$ALPHADEPTH"] = 0, }) mat:SetTexture("$BASETEXTURE", render.GetResolvedFullFrameDepth()) RunConsoleCommand("r_showz_power", 1) hook.Add("HUDPaint", "showz_test", function() render.SetMaterial(mat) render.DrawScreenQuad() end)
Output: