GPU Particles

particle.gpu.create

Client

Creates 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_mesh and self:set_trail to 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

TypeNameDescription
particleinstanceGPU particles instance

Examples

Create a GPU particle emitter
local entity = particle.gpu.create()

entity:set_position({0, 1, 0})
entity:emit()
Spawn a one-off burst and clean it up
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)

On this page