GPU Particles
self:set_material
ClientSets the material particles are drawn with
Syntax
local status = self:set_material(
material
)Textures keep the built-in material behavior.
- Image, SVG, rendertarget or path — billboard, blend mode, unshaded and the particle color keep working.
- Shader — replaces the built-in material, draw the particles however you like.
Parameters
| Type | Name | Description |
|---|---|---|
string | image | svg | rendertarget | shader | material | Material to apply: • string - file path to an image asset• image - pre-loaded image instance• svg - svg instance• rendertarget - rendertarget instance• shader - spatial shader instance |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = particle.gpu.create()
entity:set_material("assets/spark.png")local entity = particle.gpu.create()
local shader = core.shader.create("assets/shaders/flower.glsl", core.shader.shader_mode.SPATIAL)
entity:set_material(shader)