core.rendertarget.set_active

Client

Sets the active rendertarget


Syntax

local status = core.rendertarget.set_active(
    rendertarget = nil,
    clear = false,
    instant = false
)

Parameters

TypeNameDescription
rendertargetrendertargetRendertarget instance to set as active
Omitting this argument will unset the currently active rendertarget
boolclearDetermines the clear state:
• When true - clears the rendertarget upon binding
• When false - preserves the existing contents
boolinstantDetermines the clear timing:
• When true - applies the clear immediately
• When false - defers the clear to the next frame

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Set a rendertarget as active with various clear options
local entity = core.rendertarget.create(1920, 1080, false)

-- Bind the rendertarget with a clear
core.rendertarget.set_active(entity, true)

-- Bind the rendertarget with an immediate clear
core.rendertarget.set_active(entity, true, true)

-- Unset the active rendertarget
core.rendertarget.set_active()

On this page