ptes_arcs.computeShader
The tesla coil's plasma discharge, as geometry: one thread per polyline point, rebuilding every vertex of the arc ribbon mesh each frame.
ptes_arcs
The tesla coil's plasma discharge, as geometry: one thread per polyline point, rebuilding every vertex of the arc ribbon mesh each frame.
Sixteen channels share the ribbon — two standing power arcs into the grounded strike masts, four strikers, two air streamers, two ground crawlers, four toroid brush-corona fans and two upward connecting leaders — plus twenty branches that re-roll off them. A channel's path is FROZEN for the life of one strike: piecewise-linear value noise keyed on the strike's trunk seed, so the path snaps on re-seed and holds still in between. Re-strikes ("darts") re-roll only the fine octaves and the branch set; the channel drifts buoyantly upward (banjo) between them. A growing leader reveals its frozen path tip-first with a bright ionization head.
preseed/parts/p_tesla.module drives it, at ceil(1184 / 128) workgroups — one
thread per point over 10 long arcs × 64 points, 6 corona arcs × 24 points and 20
branches × 20 points. ptes_init writes the matching index topology once.
Buffers
| binding | name | role |
|---|---|---|
| 0 | verts | the ribbon's vertex buffer, 23 u32 words per vertex, two vertices per point |
| 1 | par | the records below |
par
vec4<f32> records. The first four are global, then arc a in 0..15 occupies
five at 4 + a * 5.
| record | meaning |
|---|---|
| 0 | time, camera x, y, z (part-local) |
| 1 | global amplitude, global brightness, 0, 0 |
| 2, 3 | reserved |
| arc record | meaning |
|---|---|
| 0 | start x, y, z, end x |
| 1 | end y, end z, surge, trunk seed |
| 2 | width, brightness, seed, bulge |
| 3 | wobble amplitude, pin mode (1 = free tip), activity, dart count |
| 4 | banjo rise, reach, core mix, pulse |
Vertex layout
Two billboard vertices per point, written at the engine's 92-byte Vertex
stride. Position, normal and UV carry the ribbon; the colour channel carries the
channel's shading terms — surge, bright, coreMix, activity — which
ptes_plasma reads to light the arc.
Scoped to this part · feeds back into the world's score.