Revision Difference
render.GetResolvedFullFrameDepth#561031
<function name="GetResolvedFullFrameDepth" parent="render" type="libraryfunc">
<description>Returns the `_rt_ResolvedFullFrameDepth` texture for SSAO depth. It will only be updated if <page>GM:NeedsDepthPass</page> returns true.</description>
<realm>Client</realm>
<rets>
<ret name="" type="ITexture">The depth texture.</ret>
</rets>
</function>
<example>
<description>Render the depth pass to the screen.</description>
<code>
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 )
</code>
<output><image src="https://cdn.discordapp.com/attachments/454773761728839682/1090041181846638673/image.png"/></output>⤶
<output><upload src="ab571/8dc388e4e483f90.png" size="146994" name="depth_example.png" /></output>⤶
</example>