GPU Particles
particle.gpu.create
ClientCreates a new GPU particle emitter
Syntax
local instance = particle.gpu.create()The emitter is created idle.
- Quad particles — each particle is a camera-facing quad by default.
- Look — see
self:set_material,self:set_meshandself:set_trailto change what is drawn. - Draw distance — emitters stop rendering past the camera far plane scaled by the player's particle distance setting, at
100%only the far plane limits them.
Parameters
| No parameters are accepted by this function |
|---|
Returns
| Type | Name | Description |
|---|---|---|
particle | instance | GPU particles instance |
Examples
local entity = particle.gpu.create()
entity:set_position({0, 1, 0})
entity:emit()local entity = particle.gpu.create()
entity:set_position({0, 1, 0})
entity:set_one_shot(true)
entity:burst()
-- fire and forget: destroy once the cycle has finished
util.timer.create(function()
entity:destroy()
end, util.math.floor(entity:get_lifetime() * 1000), 1)