Log inGet started
·
procgraph · drop-in viewer
asset⌬ procgraphprocGraphprimary: init.luau·part ofpackage effectShowcase.package·originates fromworld 0fc7535e-6…

muzzleFlash.procGraph

The bloom at a barrel the instant a weapon fires: a ragged star of light and a tongue of flame down the bore, gone within three frames; a spray of burning powder that streaks out, falls and cools; a few puffs of smoke that swell, rise and thin; and a light that throws the flash o…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

muzzleFlash

The bloom at a barrel the instant a weapon fires: a ragged star of light and a tongue of flame down the bore, gone within three frames; a spray of burning powder that streaks out, falls and cools; a few puffs of smoke that swell, rise and thin; and a light that throws the flash on whatever stands near.

The bore runs along the effect's -Z. Stand it on a child of the weapon at the muzzle, so it follows the weapon, and play it from the start on each shot:

-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local function mountFlash(weapon, muzzleOffset)
    local muzzle = entity.spawn("muzzle", { parent = weapon.id, position = muzzleOffset })
    muzzle.component.add("Generator", { graph = graph, playOn = "manual", ending = "hold" })
    local flash = muzzle.component.get("Generator")
    return function()
        flash:seek(0)
        flash:play()
    end
end
InputDefaultWhat it does
size0.28Width of the flash in metres: a pistol at 0.12, a rifle at 0.28, a tank gun at 1.2. Every layer scales with it.
light1Strength of the light it throws, as a multiple of the default.

It plays 54 frames at 60 fps (0.9 s). Played again, it plays the frames its first play cooked, so a weapon firing on full auto cooks it once.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

muzzleFlash — the bloom at a barrel the instant a weapon fires. Five layers, each the part of a real discharge the eye reads: a ragged star of light at the muzzle and a tongue of flame down the bore line, both gone within three frames; a spray of burning powder streaking out along the bore and cooling from white through orange to nothing; a few puffs of smoke that swell, rise and thin out; and a light that throws the flash onto whatever stands near. Everything is built at a flash 0.28 m across and scaled by `size`, so one graph covers a pistol and a cannon. The bore runs along -Z.

scaled(name: string, points: any, dims: any) → any

Every layer is simulated at the reference size, then its positions and sizes are multiplied by `size / 0.28`.

argtypedescription
namestring
pointsany
dimsany

drawn(name: string, points: any, shader: string, blend: string, properties: any?) → any

argtypedescription
namestring
pointsany
shaderstring
blendstring
propertiesany?

flashLayer(name: string, count: number, lifetime: any, sizeRange: any, velocity: any, dims: any) → any

argtypedescription
namestring
countnumber
lifetimeany
sizeRangeany
velocityany
dimsany
⌬ Metadata
cost{"cookMs":552,"gpuMs":0.2,"measuredOn":"native debug build, headless, on an empty stage in edit mode. `vramBytes` is the peak rise in renderer.gpuMemory() (compute, instances, meshes, textures) over an idle baseline while one play runs from an empty cook cache: its solvers, its instanced draws and the frames its cache holds. `cookMs` is that play's cook time over every frame (playback().cost.cookMs); a play fired while one holds the frames, or after, replays them. `gpuMs` is the peak rise in the frame's measured GPU time over the same baseline, whose own spread is about 0.2 ms, so it is the bound that instrument supports.","vramBytes":531000}descriptionThe bloom at a barrel the instant a weapon fires: a ragged star of light, a tongue of flame down the bore line (-Z), a spray of burning powder, a puff of smoke and a flash of light on the scene, all sized off one width in metres.familycombatkindeffect

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

24+items
✦
shader · born here
❒asset
# fxSmoke A puff of smoke on a card facing the camera (`zero_billboard`), for blending over the frame. It draws a soft, lumpy disc of three-octave value noise whose edge is pushed in and out by the noise, and as the puff ages the noise thins it from its wisps inward. It is lit by the ambient light plus the sun, wrapped around a sphere normal under the card so the side toward the sun is brighter. The colour is the element's colour times that light, and the alpha is the density times the element's opacity times `gain`. The combat graphs beside it in `combat/` draw with it as `fxSmoke`, transparent. The `impact` graph uses it for the burst of dust and grit off the struck surface (grit colour `(0.58, 0.53, 0.46)`, opacity falling from 0.55 to 0 over life), and the `muzzleFlash` graph for the puffs of smoke leaving the bore (grey `(0.56, 0.54, 0.52)`, opacity falling from 0.42 to 0). Both swell the card as it ages. The `bench_mixed` scene places both graphs and the `main` scene places `muzzleFlash`. The shader includes `@builtin::shaderModules.billboard`. ## Properties | Property | Type | Default | Meaning | |---|---|---|---| | `gain` | float | 1.0 | Multiplies the output alpha. | | `vertexBoundsDilation` | float | 5 | How far the vertex hook moves a vertex past the mesh, in world units: the culling bounds grow by it so a moved vertex stays inside them. | ## Lanes | Lane | Carries | |---|---| | `data0.rgb` | Smoke colour, multiplied by the lighting. | | `data1.x` | Seed: picks the puff's lumps. | | `data1.y` | Life, 0 at birth to 1 at death: thins the puff and drifts its noise. | | `data1.z` | Opacity. |
▲ 0↑ born
✦
shader · born here
❒asset
# fxFlash The bloom of a discharge, drawn procedurally on a card for additive blending. With `shape` 0 it is a ragged star facing the camera (`zero_billboard`): five to seven spikes of hashed length and turn around a white-hot core, each spike brightest at its root and fading to its tip. With `shape` above 0.5 it is a tongue of flame on a card turned onto the element's Y axis (`zero_billboard_streak`), running from the middle of the card (the muzzle) to its tip along +Y, wavering at its edges and cooling toward the tip, on the half of the card between its middle and its +Y end. The petals are re-seeded every 1/30 s of world time, so a flash held for more than one frame flickers. The colour is the element's `data0` colour over the shape, plus a white `(1.0, 0.95, 0.85)` core scaled by the colour's brightest channel. The combat graphs beside it in `combat/` draw with it as `fxFlash`, additive. The `impact` graph draws two stars (`shape` 0) at the point of impact for three frames. The `muzzleFlash` graph draws three stars turned apart by their seeds (`shape` 0) and one tongue of flame down the bore (`shape` 1). Both colour the flash from an HDR ramp that falls to black over its short life. The `bench_mixed` scene places both graphs and the `main` scene places `muzzleFlash`. The shader includes `@builtin::shaderModules.billboard`. ## Properties | Property | Type | Default | Meaning | |---|---|---|---| | `gain` | float | 1.0 | Multiplies the output colour. | | `shape` | float | 0.0 | 0 draws the camera-facing star; above 0.5 draws the tongue along the element's Y axis. | | `vertexBoundsDilation` | float | 5 | How far the vertex hook moves a vertex past the mesh, in world units: the culling bounds grow by it so a moved vertex stays inside them. | ## Lanes | Lane | Carries | |---|---| | `data0.rgb` | The element's colour in linear HDR. | | `data1.x` | Seed that turns and re-sizes the petals; the shader adds a step every 1/30 s. |
▲ 0↑ born
✦
shader · born here
❒asset
# fxSpark A spark: a card turned onto its element's motion and stretched along it (`zero_billboard_streak`), drawn as a white-hot core fading to its colour at the rim and tapering to a point at both ends. The width across the streak follows `1 - along^2`, so the card is widest at its middle; pixels outside that width are discarded. The body carries the element's colour, and a white core is added on the axis, scaled by the colour's brightest channel (capped at 4) times 0.35. The result times `gain` is added to the frame. The combat graphs beside it in `combat/` draw with it as `fxSpark`, additive. The `impact` graph uses it for the sparks thrown back off the struck surface, the `muzzleFlash` graph for the burning powder streaking out of the bore, and the `tracer` graph for the round's white-hot streak and the embers it sheds. Each graph turns the particle onto its velocity, lengthens its Y scale, and colours it from an HDR ramp that cools over its life. The `bench_mixed` scene places all three graphs and the `main` scene places `muzzleFlash`. The shader includes `@builtin::shaderModules.billboard`. ## Properties | Property | Type | Default | Meaning | |---|---|---|---| | `gain` | float | 1.0 | Multiplies the output colour. | | `vertexBoundsDilation` | float | 0.3 | How far the vertex hook moves a vertex past the mesh, in world units: the culling bounds grow by it so a moved vertex stays inside them. | ## Lanes | Lane | Carries | |---|---| | `data0.rgb` | The element's colour in linear HDR. |
▲ 0↑ born
❒
package · born here
❒asset
# effectShowcase The procedural effects of the Procgen Effects Showcase world. Each one is a `.procGraph` that plays through a `Generator`, and every shader, material and module a graph draws with sits beside it in this package, so the package carries everything its graphs need. Each graph's README says what it makes, how to place it and what each of its inputs changes. ## Contents | Folder | Graphs | What they make | |---|---|---| | `combat/` | `impact`, `muzzleFlash`, `tracer` | A round striking a hard surface, the bloom at a barrel as a weapon fires, and the glowing streak of a round in flight. They draw with `fxFlash`, `fxSmoke` and `fxSpark` in `combat/shaders/`. | | `blast/` | `wall_blast` | A charge blowing a breach through a stone block wall, on a 9.6 s loop. | | `storm/` | `storm`, `tower` | A thunderstorm around a lone tower: wind-driven rain, lightning striking on the schedule `schedule.module` keeps, and sparks and smoke where strikes land. `tower` is the stone keep it stands around. | | `rift/` | `arcane_rift` | A rift tearing open in the ground, its motes and rubble moved by the compute shaders in `rift/compute/`. | | `dragon/` | `dragon_breath` | A dragon's fire breath sweeping a courtyard: a flame jet, rolling smoke and drifting embers. | | `launch/` | `launch` | A heavy-lift rocket liftoff on one looping timeline, with the heat-haze material `rk_haze_mat`. | | `waterfall/` | `wf_env`, `wf_water`, `wf_spray`, `wf_foam`, `wf_mist` | A waterfall built in parts: the cliff, basin and boulders, the falling and still water, the droplets, the foam where the falls land, and the mist with its rainbow. Its water materials are in `waterfall/materials/`. | | `shaders/` | | `fx_noise`, the noise functions the waterfall and wall blast shaders include. | ## Playing one A graph plays on a `Generator` component bound to it: ```lua -- `graph` is the graph's reference: the AssetRef `asset.resolve` or a search returns for it. local e = entity.spawn("impact", { position = { 0, 1, 0 } }) e.component.add("Generator", { graph = graph, playOn = "load" }) ``` Set a graph's inputs with the Generator's `params`, e.g. `params = { size = 3 }`.
▲ 0↑ born
backing path · effectShowcase.package/combat/muzzleFlash.procGraph

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.