Garry's Mod Wiki

Revision Difference

render.GetResolvedFullFrameDepth#549501

<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>⤶ ⤶ </example>⤶