GPU Particles
self:set_mesh
ClientDraws every particle as the mesh of a model instead of a quad
Syntax
local status = self:set_mesh(
model,
component = all
)The model is only a mesh source.
- Model — the model keeps existing, destroy or hide it if it is only a mesh source.
- Components — without
componentevery component is used, each as its own draw pass (max4). - Look — billboarding turns off, size comes from the
SCALEparameter, and the mesh keeps its own materials unlessself:set_materialis used.
Parameters
| Type | Name | Description |
|---|---|---|
model | model | Model instance to take the mesh from |
string | component | Name of a single mesh component to use Defaults to every component of the model (up to 4) |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
core.model.load("leaf", "assets/leaf.glb")
local leaf = core.model.create("leaf")
local entity = particle.gpu.create()
entity:set_mesh(leaf)
leaf:destroy()core.model.load("leaf", "assets/leaf.glb")
local leaf = core.model.create("leaf")
local entity = particle.gpu.create()
entity:set_mesh(leaf, "Leaf")