self:apply_to_model
Client
Applies the shader's material to a model instance
Syntax
local status = self:apply_to_model(
model
)Parameters
| Type | Name | Description |
|---|---|---|
model | model | Model instance to apply the shader material to — refer to core.model.create |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.shader.create("assets/shaders/dissolve.glsl", core.shader.shader_mode.SPATIAL)
local model = core.model.create("assets/props/crate.glb")
entity:set_param("dissolve_amount", 0.0)
entity:apply_to_model(model)local entity = core.shader.create("assets/shaders/toon.glsl", core.shader.shader_mode.SPATIAL)
local model = core.model.create("assets/characters/hero.glb")
entity:apply_to_model(model)