core.shader.create
Client
Creates a new shader instance by loading GLSL source from a file path
Syntax
local instance = core.shader.create(
path,
mode
)Parameters
| Type | Name | Description |
|---|---|---|
string | path | File path to a GLSL shader asset |
core.shader.shader_mode | mode | Rendering pipeline to target |
Returns
| Type | Name | Description |
|---|---|---|
shader | instance | Created shader instance |
Examples
local entity = core.shader.create("assets/shaders/ripple.glsl", core.shader.shader_mode.CANVAS_ITEM)
util.event.on("sandbox:draw", function()
core.engine.draw_material(
{0, 0},
core.engine.get_resolution(),
entity
)
end)