self:set_param_rt
Client
Binds a rendertarget instance to a sampler uniform on the shader
Syntax
local status = self:set_param_rt(
name,
rendertarget
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of the sampler uniform as declared in the GLSL source |
rendertarget | rendertarget | Rendertarget instance to bind |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.shader.create("assets/shaders/postfx.glsl", core.shader.shader_mode.CANVAS_ITEM)
local rendertarget = core.rendertarget.create({1920, 1080})
entity:set_param_rt("screen_tex", rendertarget)local entity = core.shader.create("assets/shaders/reflection.glsl", core.shader.shader_mode.SPATIAL)
local rendertarget = core.rendertarget.create({512, 512})
entity:set_param_rt("reflection_tex", rendertarget)