reze-engine 0.58.1 → 0.58.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/effect-points.d.ts +30 -0
  2. package/dist/effect-points.d.ts.map +1 -0
  3. package/dist/effect-points.js +49 -0
  4. package/dist/engine.d.ts +25 -2
  5. package/dist/engine.d.ts.map +1 -1
  6. package/dist/engine.js +199 -35
  7. package/dist/graph/style-group.d.ts +7 -0
  8. package/dist/graph/style-group.d.ts.map +1 -1
  9. package/dist/light-grid.d.ts +25 -0
  10. package/dist/light-grid.d.ts.map +1 -0
  11. package/dist/light-grid.js +91 -0
  12. package/dist/model.d.ts +9 -0
  13. package/dist/model.d.ts.map +1 -1
  14. package/dist/model.js +6 -0
  15. package/dist/pmx-loader.d.ts.map +1 -1
  16. package/dist/pmx-loader.js +11 -6
  17. package/dist/shaders/cast-api.d.ts +1 -1
  18. package/dist/shaders/cast-layout.d.ts +5 -3
  19. package/dist/shaders/cast-layout.d.ts.map +1 -1
  20. package/dist/shaders/cast-layout.js +5 -3
  21. package/dist/shaders/directives.d.ts +3 -0
  22. package/dist/shaders/directives.d.ts.map +1 -1
  23. package/dist/shaders/directives.js +5 -0
  24. package/dist/shaders/lights.d.ts +14 -9
  25. package/dist/shaders/lights.d.ts.map +1 -1
  26. package/dist/shaders/lights.js +118 -65
  27. package/dist/shaders/passes/composite.d.ts +1 -1
  28. package/dist/shaders/passes/composite.d.ts.map +1 -1
  29. package/dist/shaders/passes/composite.js +2 -0
  30. package/dist/shaders/passes/grid.d.ts.map +1 -1
  31. package/dist/shaders/passes/grid.js +2 -0
  32. package/dist/shaders/passes/particles.d.ts +20 -1
  33. package/dist/shaders/passes/particles.d.ts.map +1 -1
  34. package/dist/shaders/passes/particles.js +36 -1
  35. package/dist/shaders/passes/trails.d.ts.map +1 -1
  36. package/dist/shaders/passes/trails.js +2 -1
  37. package/dist/shaders/points-api.d.ts +11 -0
  38. package/dist/shaders/points-api.d.ts.map +1 -0
  39. package/dist/shaders/points-api.js +58 -0
  40. package/package.json +1 -1
  41. package/src/effect-points.ts +67 -0
  42. package/src/engine.ts +215 -35
  43. package/src/graph/style-group.ts +12 -1
  44. package/src/light-grid.ts +139 -0
  45. package/src/model.ts +12 -0
  46. package/src/pmx-loader.ts +13 -6
  47. package/src/shaders/cast-layout.ts +5 -3
  48. package/src/shaders/directives.ts +8 -0
  49. package/src/shaders/lights.ts +118 -65
  50. package/src/shaders/passes/composite.ts +2 -0
  51. package/src/shaders/passes/grid.ts +2 -0
  52. package/src/shaders/passes/particles.ts +46 -2
  53. package/src/shaders/passes/trails.ts +2 -1
  54. package/src/shaders/points-api.ts +66 -0
package/dist/model.d.ts CHANGED
@@ -69,6 +69,11 @@ export interface Bone {
69
69
  appendMove?: boolean;
70
70
  /** 軸制限: this bone rotates ONLY about this axis (the twist bones use it). */
71
71
  fixedAxis?: [number, number, number];
72
+ /** Where the bone's tail sits at rest, as an offset from its head — the
73
+ * direction a PMX editor draws it pointing. PMX states it either as that
74
+ * offset or as another bone to point at; both arrive here as the offset.
75
+ * An effect reading named points takes it as the point's length and way. */
76
+ tail?: [number, number, number];
72
77
  /** 変形階層: MMD poses whole layers in order, not bones in array order.
73
78
  * Parsed but not yet honoured — distinct from Model's `deformOrder`, which is
74
79
  * this engine's parent-before-child traversal. */
@@ -373,6 +378,10 @@ export declare class Model {
373
378
  /** A bone's posed matrix — model space, column-major, the live array rather
374
379
  * than a copy. Null for a name this rig does not have. */
375
380
  getBoneWorldMatrix(boneName: string): Float32Array | null;
381
+ /** A bone's posed matrix by INDEX — model space, column-major, the live
382
+ * array. For walking bones that share a name, which the name lookup
383
+ * collapses to one. Null past the end. */
384
+ getBoneWorldMatrixAt(index: number): Float32Array | null;
376
385
  getBoneWorldPosition(boneName: string): Vec3 | null;
377
386
  /**
378
387
  * A bone's forward axis, normalised — which way a foot points, where a head
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","source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AO,CAAC,aAAa,CAAyB;IAI9C,OAAO,CAAC,4BAA4B;IA4HpC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;IAkDlD;kFAC8E;IAC9E,oBAAoB,IAAI,MAAM,EAAE;IAIhC;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,IAAI,IAAI;IA4C1B,oBAAoB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;CA0GhD"}
package/dist/model.js CHANGED
@@ -758,6 +758,12 @@ export class Model {
758
758
  return null;
759
759
  return this.runtimeSkeleton.worldMatrices[idx].values;
760
760
  }
761
+ /** A bone's posed matrix by INDEX — model space, column-major, the live
762
+ * array. For walking bones that share a name, which the name lookup
763
+ * collapses to one. Null past the end. */
764
+ getBoneWorldMatrixAt(index) {
765
+ return this.runtimeSkeleton.worldMatrices[index]?.values ?? null;
766
+ }
761
767
  // World bone origin (world matrix col3); unknown name → null
762
768
  getBoneWorldPosition(boneName) {
763
769
  const idx = this.runtimeSkeleton.nameIndex[boneName];
@@ -1 +1 @@
1
- {"version":3,"file":"pmx-loader.d.ts","sourceRoot":"","sources":["../src/pmx-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAcN,MAAM,SAAS,CAAA;AAGhB,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEzE,qBAAa,SAAS;IACpB,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,mBAAmB,CAAI;IAC/B,OAAO,CAAC,eAAe,CAAI;IAC3B,OAAO,CAAC,gBAAgB,CAAI;IAC5B,OAAO,CAAC,iBAAiB,CAAI;IAC7B,OAAO,CAAC,aAAa,CAAI;IACzB,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,kBA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,YAAY;IAWpB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,cAAc;IAsEtB,OAAO,CAAC,UAAU;IAkLlB,OAAO,CAAC,WAAW;IAgMnB,OAAO,CAAC,iBAAiB;IAgDzB,OAAO,CAAC,gBAAgB;IA+FxB,OAAO,CAAC,WAAW;IAmGnB,OAAO,CAAC,kBAAkB;IAmC1B,OAAO,CAAC,OAAO;IAkJf,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,OAAO;IAwBf,OAAO,CAAC,QAAQ;CAIjB"}
@@ -305,15 +305,15 @@ export class PmxLoader {
305
305
  const parentIndex = this.getNonVertexIndex(this.boneIndexSize);
306
306
  const deformLayer = this.getInt32(); // 変形階層
307
307
  const flags = this.getUint16();
308
- // Tail: bone index or offset vector3
308
+ // Tail: bone index or offset vector3. Kept either way — the bone it
309
+ // names is resolved to an offset once every head is known.
310
+ let tailOffset;
311
+ let tailBone;
309
312
  if ((flags & FLAG_TAIL_IS_BONE) !== 0) {
310
- this.getNonVertexIndex(this.boneIndexSize);
313
+ tailBone = this.getNonVertexIndex(this.boneIndexSize);
311
314
  }
312
315
  else {
313
- // tail offset vec3
314
- this.getFloat32();
315
- this.getFloat32();
316
- this.getFloat32();
316
+ tailOffset = [this.getFloat32(), this.getFloat32(), this.getFloat32()];
317
317
  }
318
318
  // Append transform (inherit/ratio)
319
319
  let appendParent = undefined;
@@ -398,10 +398,14 @@ export class PmxLoader {
398
398
  ikIteration,
399
399
  ikLimitAngle,
400
400
  ikLinks,
401
+ tailOffset,
402
+ tailBone,
401
403
  };
402
404
  }
403
405
  for (let i = 0; i < count; i++) {
404
406
  const a = abs[i];
407
+ const to = a.tailBone !== undefined && a.tailBone >= 0 && a.tailBone < count ? abs[a.tailBone] : null;
408
+ const tail = to ? [to.x - a.x, to.y - a.y, to.z - a.z] : a.tailOffset;
405
409
  const boneData = {
406
410
  name: a.name,
407
411
  parentIndex: a.parent,
@@ -419,6 +423,7 @@ export class PmxLoader {
419
423
  ikIteration: a.ikIteration,
420
424
  ikLimitAngle: a.ikLimitAngle,
421
425
  ikLinks: a.ikLinks,
426
+ ...(tail ? { tail } : {}),
422
427
  };
423
428
  bones.push(boneData);
424
429
  }
@@ -1,4 +1,4 @@
1
- export declare const CAST_API = "\nconst RZ_SUBJECTS: i32 = 4;\nconst RZ_SAMPLES: i32 = 128;\n/** The anchor ADDRESS SPACE \u2014 how many an effect may declare, not how many it\n * did. RZ_TRAIL_SLOTS is the per-effect number and is not this one; the two\n * being one number was the old trail bug. */\nconst RZ_MAX_ANCHORS: i32 = 16;\nconst RZ_TRAIL_SAMPLES: i32 = 128;\n\nstruct RzSubject {\n /** On the FLOOR, under the body \u2014 where a ring or a magic circle belongs. */\n root: vec3f,\n /** At the hips, the middle of the body \u2014 where an aura belongs. */\n center: vec3f,\n /** Bounding sphere: xyz centre, w radius. Deliberately generous \u2014 cull with it. */\n bounds: vec4f,\n /**\n * How much of this character is still THERE: 1 whole, 0 gone.\n *\n * What setModelDissolve last set on them, which the material pass has already\n * acted on by the time an effect runs \u2014 so an effect drawing what LEAVES a\n * dissolving body (sparks, ash, a ghost) reads the same number the body was\n * taken apart with, rather than keeping a clock of its own and hoping the two\n * agree. 1 on a scene that never dissolves anybody.\n */\n dissolve: f32,\n /**\n * Where she LOOKS: a unit direction from between the eyes, in world space.\n * Exact while her eyes are on something (Engine.setEyeTracking); otherwise\n * the motion's own eye turn undone through the range map \u2014 an eye bone\n * turns a fraction of the way toward what it looks at, and this gives back\n * the whole of it. An effect that should go where the look goes \u2014 a beam,\n * a light \u2014 takes this rather than an eye bone's axis, and it holds in\n * either mode. Zero, with looking false, only for a model without eyes.\n */\n gaze: vec3f,\n looking: bool,\n /** False past the end of the cast, and every field is then zero. */\n valid: bool,\n}\n\nstruct RzAnchor {\n pos: vec3f,\n /** World units per second, from the previous frame. Direction for a trail,\n * magnitude for anything that should react to how hard someone is moving. */\n vel: vec3f,\n /** The bone's forward axis \u2014 which way a foot points, where a head looks. */\n fwd: vec3f,\n /** False when this rig has no such bone. Check it: the alternative is drawing\n * a hand effect at the world origin on every model that spells it differently. */\n valid: bool,\n}\n\n/**\n * How many characters THIS EFFECT is on, up to four.\n *\n * Not how many the scene holds. An effect applies to the whole cast unless the\n * scene says otherwise (Engine.setEffectSubjects), and where it says otherwise\n * this counts only the models named \u2014 so an effect aimed at one dancer sees one\n * subject, at index 0, and an author who wrote a loop over the cast gets the\n * targeting for free.\n *\n * Which is the whole design: the FILTER IS IN THE INDEX SPACE, not in the\n * shaders. There is no mask an effect can read, because an effect asking \"am I\n * allowed on this one\" is an effect that can get the answer wrong, and 18 of the\n * shipped built-ins would have had to be rewritten to ask at all.\n */\nfn rzSubjectCount() -> i32 {\n let live = _rzCastLive();\n let mask = _rzSubjectMask();\n var n = 0;\n for (var i = 0; i < live; i++) {\n if ((mask & (1u << u32(i))) != 0u) { n++; }\n }\n return n;\n}\n\n/** This effect's i-th subject \u2192 the scene's slot, or -1 past its own count.\n * Every accessor below goes through it, which is what keeps one effect's\n * subject 1 from being another's. */\nfn _rzSubjectSlot(i: i32) -> i32 {\n if (i < 0) { return -1; }\n let live = _rzCastLive();\n let mask = _rzSubjectMask();\n var n = 0;\n for (var s = 0; s < live; s++) {\n if ((mask & (1u << u32(s))) == 0u) { continue; }\n if (n == i) { return s; }\n n++;\n }\n return -1;\n}\n\n/** Which model this is, stable across a scene \u2014 for per-subject variation. */\nfn rzSubjectId(i: i32) -> u32 {\n let g = _rzSubjectSlot(i);\n if (g < 0) { return 0u; }\n return u32(_rzCast[g * 4 + 1].w);\n}\n\nfn rzSubject(i: i32) -> RzSubject {\n var s: RzSubject;\n let g = _rzSubjectSlot(i);\n s.valid = g >= 0;\n if (!s.valid) { return s; }\n let b = g * 4;\n s.root = _rzCast[b].xyz;\n s.dissolve = _rzCast[b].w;\n s.center = _rzCast[b + 1].xyz;\n s.bounds = _rzCast[b + 2];\n s.gaze = _rzCast[b + 3].xyz;\n s.looking = _rzCast[b + 3].w > 0.5;\n return s;\n}\n\n/**\n * Where a named bone is, this frame.\n *\n * The slot is the author's own: the Nth #anchor in their file, in the order\n * they wrote them. _rzSlot turns that into the scene's address, which is what\n * keeps two effects that both anchor to a wrist from reading each other's.\n */\nfn rzAnchor(subject: i32, slot: i32) -> RzAnchor {\n var a: RzAnchor;\n a.valid = false;\n let g = _rzSlot(slot);\n let s = _rzSubjectSlot(subject);\n if (s < 0 || g < 0 || g >= RZ_MAX_ANCHORS) { return a; }\n let b = 16 + (g * 4 + s) * 3;\n a.valid = _rzCast[b].w > 0.5;\n a.pos = _rzCast[b].xyz;\n a.vel = _rzCast[b + 1].xyz;\n a.fwd = _rzCast[b + 2].xyz;\n return a;\n}\n\n/**\n * How many samples of a path are recorded \u2014 0 for an anchor that asked for no\n * trail, and for one that has not moved yet.\n *\n * Bounded by the anchor cap, NOT by how many anchors asked for a trail. Those\n * are different index spaces: storage is addressed by anchor slot, so an\n * untrailed #anchor followed by a trailed one put the trail at index 1 with a\n * bound of 1 and rzTrail returned zero \u2014 a ribbon that silently did not draw.\n */\nfn rzTrailCount(subject: i32, slot: i32) -> i32 {\n let g = _rzSlot(slot);\n let s = _rzSubjectSlot(subject);\n if (s < 0 || g < 0 || g >= RZ_MAX_ANCHORS) { return 0; }\n return i32(_rzCast[16 + (g * 4 + s) * 3 + 2].w);\n}\n\n/** Sample i of a path: xyz where it was, w how many seconds ago. i = 0 is now. */\nfn rzTrail(subject: i32, slot: i32, i: i32) -> vec4f {\n let n = rzTrailCount(subject, slot);\n if (i < 0 || i >= n) { return vec4f(0.0); }\n let base = 208 + (_rzSlot(slot) * 4 + _rzSubjectSlot(subject)) * RZ_TRAIL_SAMPLES;\n return _rzCast[base + i];\n}\n";
1
+ export declare const CAST_API = "\nconst RZ_SUBJECTS: i32 = 4;\nconst RZ_SAMPLES: i32 = 128;\n/** The anchor ADDRESS SPACE \u2014 how many an effect may declare, not how many it\n * did. RZ_TRAIL_SLOTS is the per-effect number and is not this one; the two\n * being one number was the old trail bug. */\nconst RZ_MAX_ANCHORS: i32 = 48;\nconst RZ_TRAIL_SAMPLES: i32 = 128;\n\nstruct RzSubject {\n /** On the FLOOR, under the body \u2014 where a ring or a magic circle belongs. */\n root: vec3f,\n /** At the hips, the middle of the body \u2014 where an aura belongs. */\n center: vec3f,\n /** Bounding sphere: xyz centre, w radius. Deliberately generous \u2014 cull with it. */\n bounds: vec4f,\n /**\n * How much of this character is still THERE: 1 whole, 0 gone.\n *\n * What setModelDissolve last set on them, which the material pass has already\n * acted on by the time an effect runs \u2014 so an effect drawing what LEAVES a\n * dissolving body (sparks, ash, a ghost) reads the same number the body was\n * taken apart with, rather than keeping a clock of its own and hoping the two\n * agree. 1 on a scene that never dissolves anybody.\n */\n dissolve: f32,\n /**\n * Where she LOOKS: a unit direction from between the eyes, in world space.\n * Exact while her eyes are on something (Engine.setEyeTracking); otherwise\n * the motion's own eye turn undone through the range map \u2014 an eye bone\n * turns a fraction of the way toward what it looks at, and this gives back\n * the whole of it. An effect that should go where the look goes \u2014 a beam,\n * a light \u2014 takes this rather than an eye bone's axis, and it holds in\n * either mode. Zero, with looking false, only for a model without eyes.\n */\n gaze: vec3f,\n looking: bool,\n /** False past the end of the cast, and every field is then zero. */\n valid: bool,\n}\n\nstruct RzAnchor {\n pos: vec3f,\n /** World units per second, from the previous frame. Direction for a trail,\n * magnitude for anything that should react to how hard someone is moving. */\n vel: vec3f,\n /** The bone's forward axis \u2014 which way a foot points, where a head looks. */\n fwd: vec3f,\n /** False when this rig has no such bone. Check it: the alternative is drawing\n * a hand effect at the world origin on every model that spells it differently. */\n valid: bool,\n}\n\n/**\n * How many characters THIS EFFECT is on, up to four.\n *\n * Not how many the scene holds. An effect applies to the whole cast unless the\n * scene says otherwise (Engine.setEffectSubjects), and where it says otherwise\n * this counts only the models named \u2014 so an effect aimed at one dancer sees one\n * subject, at index 0, and an author who wrote a loop over the cast gets the\n * targeting for free.\n *\n * Which is the whole design: the FILTER IS IN THE INDEX SPACE, not in the\n * shaders. There is no mask an effect can read, because an effect asking \"am I\n * allowed on this one\" is an effect that can get the answer wrong, and 18 of the\n * shipped built-ins would have had to be rewritten to ask at all.\n */\nfn rzSubjectCount() -> i32 {\n let live = _rzCastLive();\n let mask = _rzSubjectMask();\n var n = 0;\n for (var i = 0; i < live; i++) {\n if ((mask & (1u << u32(i))) != 0u) { n++; }\n }\n return n;\n}\n\n/** This effect's i-th subject \u2192 the scene's slot, or -1 past its own count.\n * Every accessor below goes through it, which is what keeps one effect's\n * subject 1 from being another's. */\nfn _rzSubjectSlot(i: i32) -> i32 {\n if (i < 0) { return -1; }\n let live = _rzCastLive();\n let mask = _rzSubjectMask();\n var n = 0;\n for (var s = 0; s < live; s++) {\n if ((mask & (1u << u32(s))) == 0u) { continue; }\n if (n == i) { return s; }\n n++;\n }\n return -1;\n}\n\n/** Which model this is, stable across a scene \u2014 for per-subject variation. */\nfn rzSubjectId(i: i32) -> u32 {\n let g = _rzSubjectSlot(i);\n if (g < 0) { return 0u; }\n return u32(_rzCast[g * 4 + 1].w);\n}\n\nfn rzSubject(i: i32) -> RzSubject {\n var s: RzSubject;\n let g = _rzSubjectSlot(i);\n s.valid = g >= 0;\n if (!s.valid) { return s; }\n let b = g * 4;\n s.root = _rzCast[b].xyz;\n s.dissolve = _rzCast[b].w;\n s.center = _rzCast[b + 1].xyz;\n s.bounds = _rzCast[b + 2];\n s.gaze = _rzCast[b + 3].xyz;\n s.looking = _rzCast[b + 3].w > 0.5;\n return s;\n}\n\n/**\n * Where a named bone is, this frame.\n *\n * The slot is the author's own: the Nth #anchor in their file, in the order\n * they wrote them. _rzSlot turns that into the scene's address, which is what\n * keeps two effects that both anchor to a wrist from reading each other's.\n */\nfn rzAnchor(subject: i32, slot: i32) -> RzAnchor {\n var a: RzAnchor;\n a.valid = false;\n let g = _rzSlot(slot);\n let s = _rzSubjectSlot(subject);\n if (s < 0 || g < 0 || g >= RZ_MAX_ANCHORS) { return a; }\n let b = 16 + (g * 4 + s) * 3;\n a.valid = _rzCast[b].w > 0.5;\n a.pos = _rzCast[b].xyz;\n a.vel = _rzCast[b + 1].xyz;\n a.fwd = _rzCast[b + 2].xyz;\n return a;\n}\n\n/**\n * How many samples of a path are recorded \u2014 0 for an anchor that asked for no\n * trail, and for one that has not moved yet.\n *\n * Bounded by the anchor cap, NOT by how many anchors asked for a trail. Those\n * are different index spaces: storage is addressed by anchor slot, so an\n * untrailed #anchor followed by a trailed one put the trail at index 1 with a\n * bound of 1 and rzTrail returned zero \u2014 a ribbon that silently did not draw.\n */\nfn rzTrailCount(subject: i32, slot: i32) -> i32 {\n let g = _rzSlot(slot);\n let s = _rzSubjectSlot(subject);\n if (s < 0 || g < 0 || g >= RZ_MAX_ANCHORS) { return 0; }\n return i32(_rzCast[16 + (g * 4 + s) * 3 + 2].w);\n}\n\n/** Sample i of a path: xyz where it was, w how many seconds ago. i = 0 is now. */\nfn rzTrail(subject: i32, slot: i32, i: i32) -> vec4f {\n let n = rzTrailCount(subject, slot);\n if (i < 0 || i >= n) { return vec4f(0.0); }\n let base = 592 + (_rzSlot(slot) * 4 + _rzSubjectSlot(subject)) * RZ_TRAIL_SAMPLES;\n return _rzCast[base + i];\n}\n";
2
2
  /**
3
3
  * Which subjects this effect applies to, as WGSL — the second of the two names a
4
4
  * mount owes CAST_API (`_rzCastLive` is the first, and a mount with a view
@@ -23,8 +23,10 @@ export declare const EFFECT_SUBJECT_VEC4S = 4;
23
23
  *
24
24
  * 8 was reachable, and quietly: two effects each wanting two hands, two feet and
25
25
  * a head is ten, so the second one silently lost its ribbons to a diagnostic
26
- * nobody was reading. 16 is double the headroom for 131KB of storage buffer,
27
- * where 8 cost 66KB.
26
+ * nobody was reading. 16 held until an effect traced a HAND: an outline through
27
+ * every finger reads fifteen bones a hand, thirty for the pair, before any other
28
+ * effect in the scene asks for one. 48 is that and room beside it, for 393KB of
29
+ * storage buffer where 16 cost 131KB.
28
30
  *
29
31
  * The cost really is only that. The per-frame upload is bounded by the last
30
32
  * TRAILED slot, not by this cap (see the writeBuffer in updateCastBuffer), so a
@@ -39,7 +41,7 @@ export declare const EFFECT_SUBJECT_VEC4S = 4;
39
41
  * scene's anchor count grows, which is a different feature from raising a number
40
42
  * that was never load-bearing.
41
43
  */
42
- export declare const EFFECT_ANCHORS = 16;
44
+ export declare const EFFECT_ANCHORS = 48;
43
45
  /**
44
46
  * Path samples kept per trailed anchor — 128 at the 60Hz sampling rate is a
45
47
  * ~2.1 second ribbon.
@@ -1 +1 @@
1
- {"version":3,"file":"cast-layout.d.ts","sourceRoot":"","sources":["../../src/shaders/cast-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,IAAI,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAA;AACvC,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,QAAgF,CAAA"}
1
+ {"version":3,"file":"cast-layout.d.ts","sourceRoot":"","sources":["../../src/shaders/cast-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,IAAI,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAA;AACvC,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,QAAgF,CAAA"}
@@ -23,8 +23,10 @@ export const EFFECT_SUBJECT_VEC4S = 4;
23
23
  *
24
24
  * 8 was reachable, and quietly: two effects each wanting two hands, two feet and
25
25
  * a head is ten, so the second one silently lost its ribbons to a diagnostic
26
- * nobody was reading. 16 is double the headroom for 131KB of storage buffer,
27
- * where 8 cost 66KB.
26
+ * nobody was reading. 16 held until an effect traced a HAND: an outline through
27
+ * every finger reads fifteen bones a hand, thirty for the pair, before any other
28
+ * effect in the scene asks for one. 48 is that and room beside it, for 393KB of
29
+ * storage buffer where 16 cost 131KB.
28
30
  *
29
31
  * The cost really is only that. The per-frame upload is bounded by the last
30
32
  * TRAILED slot, not by this cap (see the writeBuffer in updateCastBuffer), so a
@@ -39,7 +41,7 @@ export const EFFECT_SUBJECT_VEC4S = 4;
39
41
  * scene's anchor count grows, which is a different feature from raising a number
40
42
  * that was never load-bearing.
41
43
  */
42
- export const EFFECT_ANCHORS = 16;
44
+ export const EFFECT_ANCHORS = 48;
43
45
  /**
44
46
  * Path samples kept per trailed anchor — 128 at the 60Hz sampling rate is a
45
47
  * ~2.1 second ribbon.
@@ -29,6 +29,9 @@ export type EffectDirectives = {
29
29
  particles: number;
30
30
  lights: number;
31
31
  grid: number;
32
+ /** `#points <prefix>`: every bone on every model whose name starts with it,
33
+ * as rzPoint(i) in the particle stages. Null when the file declares none. */
34
+ points: string | null;
32
35
  bloom: boolean;
33
36
  /** This effect takes the cast apart — the host reads the timing. */
34
37
  dissolve: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/shaders/directives.ts"],"names":[],"mappings":"AA8BA,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IAChC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CA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CAAA;KAAE,GAAG,IAAI,CAAA;IACjE;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAoBD;;;+BAG+B;AAC/B,eAAO,MAAM,cAAc,QAAmC,CAAA;AAG9D;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAA8B,CAAA;AAmBzD,MAAM,MAAM,eAAe,GAAG;IAAE,UAAU,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEhF,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CA+K7D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpD"}
@@ -37,6 +37,7 @@ const SPEC = {
37
37
  particles: 1,
38
38
  lights: 1,
39
39
  grid: 1,
40
+ points: 1,
40
41
  bloom: 0,
41
42
  dissolve: 0,
42
43
  mirror: 0,
@@ -88,6 +89,7 @@ export function parseDirectives(wgsl) {
88
89
  particles: 0,
89
90
  lights: 0,
90
91
  grid: 0,
92
+ points: null,
91
93
  bloom: false,
92
94
  dissolve: false,
93
95
  ground: null,
@@ -204,6 +206,9 @@ export function parseDirectives(wgsl) {
204
206
  case "dissolve":
205
207
  d.dissolve = true;
206
208
  return;
209
+ case "points":
210
+ d.points = args[0];
211
+ return;
207
212
  case "mirror":
208
213
  d.mirror = true;
209
214
  return;
@@ -1,6 +1,6 @@
1
- /** Floats before the first record. One is the count; the rest keep the records
2
- * vec4-aligned, which is what lets a future pass read them as vec4s. */
3
- export declare const LIGHT_HEADER = 4;
1
+ /** Words before the first record: the counts, the grid's placement and the
2
+ * outside mask, four vec4s — see the layout above. */
3
+ export declare const LIGHT_HEADER = 16;
4
4
  /** Floats per light — see the layout above. */
5
5
  export declare const LIGHT_STRIDE = 16;
6
6
  /**
@@ -14,14 +14,19 @@ export declare const LIGHT_STRIDE = 16;
14
14
  * interior brings a hundred or more, and the ceilings of sixteen and then
15
15
  * forty-eight each cut a real scene in half. Past this the extras are dropped.
16
16
  *
17
- * What it does NOT buy: a scene that genuinely lights a fragment from a hundred
18
- * lamps pays for a hundred iterations of the loop. The distance test below
19
- * rejects most of them in a few instructions, which is what makes a rig of this
20
- * size affordable at all; clustering is what replaces the linear walk when a
21
- * scene wants every one of them close enough to matter.
17
+ * A fragment pays for the document lamps its grid cell names, so the cost
18
+ * follows how many reach a place rather than how many the scene holds. It is
19
+ * also why the cap is 128: one vec4u of bits per cell.
22
20
  */
23
21
  export declare const MAX_LIGHTS = 128;
24
- /** Floats in the whole buffer. */
22
+ /** Words of lamp bits per grid cell — one bit per lamp the cap allows. */
23
+ export declare const LIGHT_MASK_WORDS: number;
24
+ /** The grid's cell budget. 32k cells over a stage a couple of hundred units
25
+ * across is a cell of about four — finer than the lamps it separates. */
26
+ export declare const LIGHT_GRID_CELLS = 32768;
27
+ /** Where the grid starts, in words. */
28
+ export declare const LIGHT_GRID_BASE: number;
29
+ /** Words in the whole buffer: header, records, grid. */
25
30
  export declare const LIGHTS_FLOATS: number;
26
31
  /**
27
32
  * The RzLight struct, declared in EVERY module a user's source is spliced into.
@@ -1 +1 @@
1
- {"version":3,"file":"lights.d.ts","sourceRoot":"","sources":["../../src/shaders/lights.ts"],"names":[],"mappings":"AA0CA;yEACyE;AACzE,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,+CAA+C;AAC/C,eAAO,MAAM,YAAY,KAAK,CAAA;AAC9B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,kCAAkC;AAClC,eAAO,MAAM,aAAa,QAA2C,CAAA;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,qJAQhC,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,QAA4B,CAAA;AAE3D,8CAA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;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAgIhE"}
@@ -11,18 +11,27 @@ import { subjectMaskApi } from "./cast-api";
11
11
  // renderer that bolted a second key light onto a toon shader has shipped. A
12
12
  // light here brightens; it does not restate the shading.
13
13
  //
14
- // So there are no per-light shadows, no area lights and no clustering. The loop
15
- // runs over the lights a scene HAS, not over the cap, so a scene with four pays
16
- // for four; the cap only bounds the buffer and the worst case.
14
+ // So there are no per-light shadows and no area lights. A fragment walks the
15
+ // DOCUMENT's lamps through a world-space grid (see light-grid.ts): its cell
16
+ // names the lamps that can reach it, so a stage rig of fifty costs each pixel
17
+ // the handful standing near it. The lamps an EFFECT emits are placed by a
18
+ // compute pass every frame, which the grid never sees, and are walked in full.
17
19
  //
18
- // LAYOUT. A 4-float header (count, then padding that keeps the records
19
- // vec4-aligned), then MAX_LIGHTS records of 16 floats — four vec4s:
20
+ // LAYOUT, in 32-bit words, read by the shader as vec4u. A 16-word header:
21
+ //
22
+ // [0] light count (f32) [1] how many are the document's (f32)
23
+ // [4..6] grid origin (f32) [7] 1 / cell edge (f32)
24
+ // [8..10] grid dims (u32) [12..15] the OUTSIDE mask (u32 bits)
25
+ //
26
+ // then MAX_LIGHTS records of 16 floats — four vec4s:
20
27
  //
21
28
  // [0..2] position, world space [3] radius
22
29
  // [4..6] colour PREMULTIPLIED by intensity [7] type
23
30
  // [8..10] aim, unit, pointing away from the light [11] cos of the outer angle
24
31
  // [12] cos of the inner angle [13..15] spare
25
32
  //
33
+ // then the grid: LIGHT_MASK_WORDS words of lamp bits per cell.
34
+ //
26
35
  // Colour carries intensity because nothing reads them apart: every use is the
27
36
  // product, and storing two numbers that are only ever multiplied is two numbers
28
37
  // that can disagree.
@@ -38,9 +47,10 @@ import { lyricsApi } from "./lyrics-api";
38
47
  import { clockApi, trailSlotsApi, viewportApi } from "./passes/hosted-api";
39
48
  import { idApi } from "./id-api";
40
49
  import { sceneLightApi, worldAmbientWgsl } from "./scene-light-api";
41
- /** Floats before the first record. One is the count; the rest keep the records
42
- * vec4-aligned, which is what lets a future pass read them as vec4s. */
43
- export const LIGHT_HEADER = 4;
50
+ import { pointsApi } from "./points-api";
51
+ /** Words before the first record: the counts, the grid's placement and the
52
+ * outside mask, four vec4s — see the layout above. */
53
+ export const LIGHT_HEADER = 16;
44
54
  /** Floats per light — see the layout above. */
45
55
  export const LIGHT_STRIDE = 16;
46
56
  /**
@@ -54,15 +64,20 @@ export const LIGHT_STRIDE = 16;
54
64
  * interior brings a hundred or more, and the ceilings of sixteen and then
55
65
  * forty-eight each cut a real scene in half. Past this the extras are dropped.
56
66
  *
57
- * What it does NOT buy: a scene that genuinely lights a fragment from a hundred
58
- * lamps pays for a hundred iterations of the loop. The distance test below
59
- * rejects most of them in a few instructions, which is what makes a rig of this
60
- * size affordable at all; clustering is what replaces the linear walk when a
61
- * scene wants every one of them close enough to matter.
67
+ * A fragment pays for the document lamps its grid cell names, so the cost
68
+ * follows how many reach a place rather than how many the scene holds. It is
69
+ * also why the cap is 128: one vec4u of bits per cell.
62
70
  */
63
71
  export const MAX_LIGHTS = 128;
64
- /** Floats in the whole buffer. */
65
- export const LIGHTS_FLOATS = LIGHT_HEADER + MAX_LIGHTS * LIGHT_STRIDE;
72
+ /** Words of lamp bits per grid cell — one bit per lamp the cap allows. */
73
+ export const LIGHT_MASK_WORDS = MAX_LIGHTS / 32;
74
+ /** The grid's cell budget. 32k cells over a stage a couple of hundred units
75
+ * across is a cell of about four — finer than the lamps it separates. */
76
+ export const LIGHT_GRID_CELLS = 32768;
77
+ /** Where the grid starts, in words. */
78
+ export const LIGHT_GRID_BASE = LIGHT_HEADER + MAX_LIGHTS * LIGHT_STRIDE;
79
+ /** Words in the whole buffer: header, records, grid. */
80
+ export const LIGHTS_FLOATS = LIGHT_GRID_BASE + LIGHT_GRID_CELLS * LIGHT_MASK_WORDS;
66
81
  /**
67
82
  * The RzLight struct, declared in EVERY module a user's source is spliced into.
68
83
  *
@@ -153,7 +168,7 @@ ${viewportApi("viewU[6].w")}
153
168
  ${trailSlotsApi(cast.trailCount)}
154
169
  // The id accessors, stubbed: this module cannot read an attachment the
155
170
  // scene pass writes. See id-api.ts — the author's whole file compiles here.
156
- ${idApi(false, 0, 0) + castDistanceStub() + sceneLightApi(false, 0, 0)}
171
+ ${idApi(false, 0, 0) + castDistanceStub() + sceneLightApi(false, 0, 0) + pointsApi(false)}
157
172
  // The dials the author declared, if any. A lamp is exactly the thing someone
158
173
  // retunes — its colour and its reach — so an emitter reads params like every
159
174
  // other mount rather than being the one place a #param resolves to nothing.
@@ -217,51 +232,55 @@ fn lightEmitMain(@builtin(global_invocation_id) gid: vec3u) {
217
232
  }
218
233
  /** The rz*Light accessors, with the buffer declared at the given binding. */
219
234
  export function lightsApi(group, binding) {
235
+ const R = LIGHT_HEADER / 4;
236
+ const S = LIGHT_STRIDE / 4;
220
237
  return /* wgsl */ `
221
- @group(${group}) @binding(${binding}) var<storage, read> _rzLights: array<f32>;
238
+ // vec4u, so a record is four loads and a cell's lamp bits are one. Floats come
239
+ // out through bitcast; the bits must NOT pass through f32 on the way, where a
240
+ // mask that happens to spell a NaN is not guaranteed to survive a load.
241
+ @group(${group}) @binding(${binding}) var<storage, read> _rzLights: array<vec4u>;
222
242
 
223
243
  const RZ_MAX_LIGHTS: u32 = ${MAX_LIGHTS}u;
224
244
 
225
245
  /** How many positional lights the scene has. Zero is the ordinary case. */
226
- fn rzLightCount() -> u32 { return min(u32(_rzLights[0]), RZ_MAX_LIGHTS); }
246
+ fn rzLightCount() -> u32 { return min(u32(bitcast<f32>(_rzLights[0].x)), RZ_MAX_LIGHTS); }
247
+
248
+ /** How many of them the document placed — the ones the grid indexes. */
249
+ fn _rzLightDocCount() -> u32 { return min(u32(bitcast<f32>(_rzLights[0].y)), rzLightCount()); }
250
+
251
+ /** One vec4 of light i's record. */
252
+ fn _rzLightVec(i: u32, k: u32) -> vec4f { return bitcast<vec4f>(_rzLights[${R}u + i * ${S}u + k]); }
227
253
 
228
254
  /** Light i's world position. */
229
- fn rzLightPos(i: u32) -> vec3f {
230
- let b = ${LIGHT_HEADER}u + i * ${LIGHT_STRIDE}u;
231
- return vec3f(_rzLights[b], _rzLights[b + 1u], _rzLights[b + 2u]);
232
- }
255
+ fn rzLightPos(i: u32) -> vec3f { return _rzLightVec(i, 0u).xyz; }
233
256
 
234
257
  /** How far light i reaches. Its falloff is zero AT this distance, not merely
235
- * small, so the light has a bound a cull can be derived from later. */
236
- fn rzLightRadius(i: u32) -> f32 { return _rzLights[${LIGHT_HEADER}u + i * ${LIGHT_STRIDE}u + 3u]; }
258
+ * small, which is the bound the grid is built from. */
259
+ fn rzLightRadius(i: u32) -> f32 { return _rzLightVec(i, 0u).w; }
237
260
 
238
261
  /** Light i's colour, already multiplied by its intensity. */
239
- fn rzLightColor(i: u32) -> vec3f {
240
- let b = ${LIGHT_HEADER}u + i * ${LIGHT_STRIDE}u + 4u;
241
- return vec3f(_rzLights[b], _rzLights[b + 1u], _rzLights[b + 2u]);
242
- }
262
+ fn rzLightColor(i: u32) -> vec3f { return _rzLightVec(i, 1u).xyz; }
243
263
 
244
264
  /** Where light i points, away from itself. The zero vector for a point light. */
245
- fn rzLightAim(i: u32) -> vec3f {
246
- let b = ${LIGHT_HEADER}u + i * ${LIGHT_STRIDE}u + 8u;
247
- return vec3f(_rzLights[b], _rzLights[b + 1u], _rzLights[b + 2u]);
248
- }
265
+ fn rzLightAim(i: u32) -> vec3f { return _rzLightVec(i, 2u).xyz; }
249
266
 
250
267
  /** The cosines a spot fades between: x its outer edge, y its inner one. A point
251
268
  * light stores (-1, -1), which saturates the cone term to 1. */
252
- fn rzLightCone(i: u32) -> vec2f {
253
- let b = ${LIGHT_HEADER}u + i * ${LIGHT_STRIDE}u + 11u;
254
- return vec2f(_rzLights[b], _rzLights[b + 1u]);
269
+ fn rzLightCone(i: u32) -> vec2f { return vec2f(_rzLightVec(i, 2u).w, _rzLightVec(i, 3u).x); }
270
+
271
+ /** The document lamps that can reach p: its grid cell's bits, or the outside
272
+ * mask beyond the grid. Written so a NaN position fails the inside test. */
273
+ fn _rzLightCellMask(p: vec3f) -> vec4u {
274
+ let g = bitcast<vec4f>(_rzLights[1]);
275
+ let dims = _rzLights[2].xyz;
276
+ let c = floor((p - g.xyz) * g.w);
277
+ if (!(all(c >= vec3f(0.0)) && all(c < vec3f(dims)))) { return _rzLights[3]; }
278
+ let ci = vec3u(c);
279
+ return _rzLights[${LIGHT_GRID_BASE / 4}u + (ci.z * dims.y + ci.y) * dims.x + ci.x];
255
280
  }
256
281
 
257
282
  /**
258
- * Every positional light's contribution at a surface point, as light — not as a
259
- * finished colour. Multiply by whatever the surface's albedo is.
260
- *
261
- * WITH NO LIGHTS THIS RETURNS EXACTLY ZERO and the loop never runs, so a scene
262
- * that declares none is arithmetically identical to one compiled before lights
263
- * existed. That is the property the whole feature is gated on: adding this to
264
- * every material must cost nothing until someone asks for a light.
283
+ * One light's contribution at a surface point.
265
284
  *
266
285
  * FALLOFF IS RELATIVE TO THE RADIUS, and deliberately not physical.
267
286
  *
@@ -275,33 +294,67 @@ fn rzLightCone(i: u32) -> vec2f {
275
294
  * zero, and the curve between them is the same shape whatever the scene's
276
295
  * scale. Both dials now mean what they say, which for a composer beats being
277
296
  * right about photons. (1 - t²)² — smooth at both ends, exactly 0 at the
278
- * radius, so the bound a cull could be derived from is still real.
297
+ * radius, so the bound the grid is built from is real.
298
+ */
299
+ fn _rzLightOne(i: u32, p: vec3f, n: vec3f) -> vec3f {
300
+ let pr = _rzLightVec(i, 0u);
301
+ let d = pr.xyz - p;
302
+ let dist = length(d);
303
+ // Out of reach before anything else is computed. The grid is conservative —
304
+ // a cell's bit means the lamp CAN reach part of it — so this still runs.
305
+ if (dist >= pr.w) { return vec3f(0.0); }
306
+ let toLight = d / max(dist, 1e-4);
307
+ // Facing the light, and nothing behind it. No wrap or half-lambert: this
308
+ // layer adds light, and a wrapped term would lift the shadow side, which is
309
+ // the ramp's business and not this one's.
310
+ let ndl = max(dot(n, toLight), 0.0);
311
+ if (ndl <= 0.0) { return vec3f(0.0); }
312
+ let t = clamp(dist / max(pr.w, 1e-4), 0.0, 1.0);
313
+ let falloff = 1.0 - t * t;
314
+ // How far inside the cone this point sits: 1 within the inner angle, 0 past
315
+ // the outer one, squared for the same soft edge the falloff has. A point
316
+ // light's (-1, -1) divides by the floor and clamps to 1, so it pays one
317
+ // dot product and no branch.
318
+ let cone = rzLightCone(i);
319
+ let aim = clamp((dot(-toLight, rzLightAim(i)) - cone.x) / max(cone.y - cone.x, 1e-4), 0.0, 1.0);
320
+ return rzLightColor(i) * (ndl * falloff * falloff * aim * aim);
321
+ }
322
+
323
+ /** The lamps named by one word of a cell's bits, lowest first. */
324
+ fn _rzLightWord(bits0: u32, base: u32, p: vec3f, n: vec3f) -> vec3f {
325
+ var acc = vec3f(0.0);
326
+ var bits = bits0;
327
+ loop {
328
+ if (bits == 0u) { break; }
329
+ let i = base + firstTrailingBit(bits);
330
+ bits = bits & (bits - 1u);
331
+ acc = acc + _rzLightOne(i, p, n);
332
+ }
333
+ return acc;
334
+ }
335
+
336
+ /**
337
+ * Every positional light's contribution at a surface point, as light — not as a
338
+ * finished colour. Multiply by whatever the surface's albedo is.
339
+ *
340
+ * WITH NO LIGHTS THIS RETURNS EXACTLY ZERO and neither walk runs, so a scene
341
+ * that declares none is arithmetically identical to one compiled before lights
342
+ * existed. That is the property the whole feature is gated on: adding this to
343
+ * every material must cost nothing until someone asks for a light.
279
344
  */
280
345
  fn rzLightsDiffuse(p: vec3f, n: vec3f) -> vec3f {
281
346
  var acc = vec3f(0.0);
282
347
  let count = rzLightCount();
283
- for (var i = 0u; i < count; i = i + 1u) {
284
- let d = rzLightPos(i) - p;
285
- let dist = length(d);
286
- // Out of reach before anything else is computed. The falloff is already
287
- // exactly zero at the radius, so this changes no pixel — it is what keeps a
288
- // stage rig's far lamps off the bill at every fragment they do not light.
289
- if (dist >= rzLightRadius(i)) { continue; }
290
- let toLight = d / max(dist, 1e-4);
291
- // Facing the light, and nothing behind it. No wrap or half-lambert: this
292
- // layer adds light, and a wrapped term would lift the shadow side, which is
293
- // the ramp's business and not this one's.
294
- let ndl = max(dot(n, toLight), 0.0);
295
- if (ndl <= 0.0) { continue; }
296
- let t = clamp(dist / max(rzLightRadius(i), 1e-4), 0.0, 1.0);
297
- let falloff = 1.0 - t * t;
298
- // How far inside the cone this point sits: 1 within the inner angle, 0 past
299
- // the outer one, squared for the same soft edge the falloff has. A point
300
- // light's (-1, -1) divides by the floor and clamps to 1, so it pays one
301
- // dot product and no branch.
302
- let cone = rzLightCone(i);
303
- let aim = clamp((dot(-toLight, rzLightAim(i)) - cone.x) / max(cone.y - cone.x, 1e-4), 0.0, 1.0);
304
- acc = acc + rzLightColor(i) * (ndl * falloff * falloff * aim * aim);
348
+ let docs = _rzLightDocCount();
349
+ // The document's lamps: only those the grid says can reach this cell.
350
+ if (docs > 0u) {
351
+ let m = _rzLightCellMask(p);
352
+ acc = acc + _rzLightWord(m.x, 0u, p, n) + _rzLightWord(m.y, 32u, p, n) +
353
+ _rzLightWord(m.z, 64u, p, n) + _rzLightWord(m.w, 96u, p, n);
354
+ }
355
+ // The effects' lamps, which move every frame on the GPU: all of them.
356
+ for (var i = docs; i < count; i = i + 1u) {
357
+ acc = acc + _rzLightOne(i, p, n);
305
358
  }
306
359
  return acc;
307
360
  }