self:set_param_texture
Client
Binds an image instance to a sampler uniform on the shader
Syntax
local status = self:set_param_texture(
name,
texture
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of the sampler uniform as declared in the GLSL source |
image | texture | Image instance to bind |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.shader.create("assets/shaders/distort.glsl", core.shader.shader_mode.CANVAS_ITEM)
local image = core.image.create("assets/textures/noise.png")
entity:set_param_texture("noise_tex", image)local entity = core.shader.create("assets/shaders/pbr_custom.glsl", core.shader.shader_mode.SPATIAL)
local diffuse = core.image.create("assets/materials/rock_diffuse.png")
entity:set_param_texture("albedo_tex", diffuse)