Garry's Mod Wiki

render.GetResolvedFullFrameDepth

  ITexture render.GetResolvedFullFrameDepth()

Description

Returns the _rt_ResolvedFullFrameDepth texture for SSAO depth. It will only be updated if GM:NeedsDepthPass returns true.

Returns

1 ITexture
The depth texture.

Example

Render the depth pass to the screen.

local function MyNeedsDepthPass() return true end -- Add hook so that the _rt_ResolvedFullFrameDepth texture is updated hook.Add( "NeedsDepthPass", "MyNeedsDepthPass", MyNeedsDepthPass ) local function RenderSSAOdepth() -- call render.GetResolvedFullFrameDepth() and draw the resulting itexture to the screen local texture = render.GetResolvedFullFrameDepth() render.DrawTextureToScreen( texture ) end -- Add hook to render pass to screen hook.Add( "RenderScreenspaceEffects", "RenderSSAOdepth", RenderSSAOdepth )
Output:
depth_example.png