render.PushRenderTarget

From Garry's Mod
Jump to: navigation, search
 render.PushRenderTarget( )

Contents

Description

Pushes the current render target and viewport to the RT stack then sets a new current render target and viewport. If the viewport is not specified, the dimensions of the render target are used instead.

This is similar to a call to render.SetRenderTarget and render.SetViewPort where the current render target and viewport have been saved beforehand.

See also render.PopRenderTarget.

Arguments

ITexture texture

The new render target to be used.

Arguments

number x=0

X origin of the viewport.

Arguments

number y=0

Y origin of the viewport.

Arguments

number w=texture:Width()

Width of the viewport.

Arguments

number h=texture:Height()

Height of the viewport

Examples

Example

Shows how you can use alpha channel with render targets.

render.PushRenderTarget( texture )
render.OverrideAlphaWriteEnable( true, true )

render.ClearDepth()
render.Clear( 0, 0, 0, 0 )

render.OverrideAlphaWriteEnable( false )
render.PopRenderTarget()


Personal tools
Navigation