pixi-effects 0.48.2 → 0.50.0

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 (88) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +53 -8
  3. package/ai/chat-template.html +8 -4
  4. package/ai/tools/check.mjs +6 -6
  5. package/dist/3d.cjs +967 -0
  6. package/dist/3d.cjs.map +1 -0
  7. package/dist/3d.d.cts +305 -0
  8. package/dist/3d.d.ts +305 -0
  9. package/dist/3d.js +960 -0
  10. package/dist/3d.js.map +1 -0
  11. package/dist/Canvas-BfZkAFJm.d.cts +12 -0
  12. package/dist/Canvas-BfZkAFJm.d.ts +12 -0
  13. package/dist/Composition-47U5U637.cjs +16 -0
  14. package/dist/{Composition-TJ5D7Z63.cjs.map → Composition-47U5U637.cjs.map} +1 -1
  15. package/dist/Composition-GVWWLFDL.js +7 -0
  16. package/dist/{Composition-5FKV2IBP.js.map → Composition-GVWWLFDL.js.map} +1 -1
  17. package/dist/Controller.d.cts +2 -2
  18. package/dist/Controller.d.ts +2 -2
  19. package/dist/{Movie-svZQF-9Z.d.cts → Movie-DogzDBuW.d.cts} +36 -5
  20. package/dist/{Movie--qSYKgAQ.d.ts → Movie-Y7iHg2V8.d.ts} +36 -5
  21. package/dist/{Spans-6A3VLHRH.js → Spans-3SEZSTQV.js} +6 -6
  22. package/dist/{Spans-6A3VLHRH.js.map → Spans-3SEZSTQV.js.map} +1 -1
  23. package/dist/{Spans-5ENZ3XGS.cjs → Spans-R426NVY3.cjs} +11 -11
  24. package/dist/{Spans-5ENZ3XGS.cjs.map → Spans-R426NVY3.cjs.map} +1 -1
  25. package/dist/{blendModes-V5XHC7U4.cjs → blendModes-2IDILRN6.cjs} +5 -5
  26. package/dist/{blendModes-V5XHC7U4.cjs.map → blendModes-2IDILRN6.cjs.map} +1 -1
  27. package/dist/{blendModes-535EMYGK.js → blendModes-4QH44GOL.js} +4 -4
  28. package/dist/{blendModes-535EMYGK.js.map → blendModes-4QH44GOL.js.map} +1 -1
  29. package/dist/{chunk-NGJXVJB7.cjs → chunk-3FCDRLW3.cjs} +5 -3
  30. package/dist/chunk-3FCDRLW3.cjs.map +1 -0
  31. package/dist/{chunk-JBDBICS2.js → chunk-C2HL5236.js} +4 -4
  32. package/dist/{chunk-JBDBICS2.js.map → chunk-C2HL5236.js.map} +1 -1
  33. package/dist/{chunk-WYR2AU4W.cjs → chunk-GXGIISFS.cjs} +5 -5
  34. package/dist/{chunk-WYR2AU4W.cjs.map → chunk-GXGIISFS.cjs.map} +1 -1
  35. package/dist/{chunk-BFRWSV3R.js → chunk-J4ZP76IL.js} +5 -4
  36. package/dist/chunk-J4ZP76IL.js.map +1 -0
  37. package/dist/{chunk-CCPJD76D.cjs → chunk-O2MD3L4J.cjs} +93 -93
  38. package/dist/chunk-O2MD3L4J.cjs.map +1 -0
  39. package/dist/{chunk-IVKI6CPH.js → chunk-SSVHAF3Q.js} +483 -20
  40. package/dist/chunk-SSVHAF3Q.js.map +1 -0
  41. package/dist/{chunk-6D4W2KZQ.js → chunk-TXNQLMRT.js} +6 -6
  42. package/dist/chunk-TXNQLMRT.js.map +1 -0
  43. package/dist/{chunk-RCKLUCB7.js → chunk-UTUUOQ47.js} +46 -20
  44. package/dist/chunk-UTUUOQ47.js.map +1 -0
  45. package/dist/{chunk-Z3DM4ETD.cjs → chunk-VVUSZVP7.cjs} +507 -42
  46. package/dist/chunk-VVUSZVP7.cjs.map +1 -0
  47. package/dist/{chunk-45ALIMAF.cjs → chunk-YOKRPAKA.cjs} +89 -63
  48. package/dist/chunk-YOKRPAKA.cjs.map +1 -0
  49. package/dist/index.cjs +35 -35
  50. package/dist/index.d.cts +3 -3
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.js +5 -5
  53. package/dist/loader.css +1 -1
  54. package/dist/{music-P4JRT73P.js → music-ATX22VAT.js} +3 -3
  55. package/dist/{music-P4JRT73P.js.map → music-ATX22VAT.js.map} +1 -1
  56. package/dist/{music-XQEPBIDT.cjs → music-OFVM3PYH.cjs} +3 -3
  57. package/dist/{music-XQEPBIDT.cjs.map → music-OFVM3PYH.cjs.map} +1 -1
  58. package/dist/present.cjs +5 -5
  59. package/dist/present.d.cts +2 -2
  60. package/dist/present.d.ts +2 -2
  61. package/dist/present.js +5 -5
  62. package/dist/three.cjs +13 -10
  63. package/dist/three.cjs.map +1 -1
  64. package/dist/three.d.cts +4 -12
  65. package/dist/three.d.ts +4 -12
  66. package/dist/three.js +8 -5
  67. package/dist/three.js.map +1 -1
  68. package/dist/{types-CTSrPvY3.d.cts → types-BZngm4nT.d.cts} +48 -5
  69. package/dist/{types-CTSrPvY3.d.ts → types-BZngm4nT.d.ts} +48 -5
  70. package/docs/api.md +45 -2
  71. package/docs/dsl.md +115 -1
  72. package/llms-full.txt +307 -6
  73. package/package.json +19 -3
  74. package/skills/pixi-effects/SKILL.md +4 -2
  75. package/skills/pixi-effects/reference/cheatsheet.md +4 -0
  76. package/skills/pixi-effects/reference/pitfalls.md +20 -0
  77. package/skills/pixi-effects/reference/recipes.md +119 -1
  78. package/skills/pixi-effects/template.html +14 -8
  79. package/dist/Composition-5FKV2IBP.js +0 -7
  80. package/dist/Composition-TJ5D7Z63.cjs +0 -16
  81. package/dist/chunk-45ALIMAF.cjs.map +0 -1
  82. package/dist/chunk-6D4W2KZQ.js.map +0 -1
  83. package/dist/chunk-BFRWSV3R.js.map +0 -1
  84. package/dist/chunk-CCPJD76D.cjs.map +0 -1
  85. package/dist/chunk-IVKI6CPH.js.map +0 -1
  86. package/dist/chunk-NGJXVJB7.cjs.map +0 -1
  87. package/dist/chunk-RCKLUCB7.js.map +0 -1
  88. package/dist/chunk-Z3DM4ETD.cjs.map +0 -1
package/dist/three.d.cts CHANGED
@@ -1,7 +1,8 @@
1
- import { b as Sequence, c as SpaceNow, d as SequenceCommon, e as PropValue, f as PathRouters, S as SequenceSpec } from './types-CTSrPvY3.cjs';
1
+ import { e as Sequence, b as SpaceNow, c as SequenceCommon, d as PropValue, f as PathRouters, S as SequenceSpec } from './types-BZngm4nT.cjs';
2
2
  import { Renderer } from 'pixi.js';
3
3
  import { Material, Texture, Scene, Camera, WebGLRenderer, Object3D, Group, Vector3, PerspectiveCamera } from 'three';
4
4
  import { WebGPURenderer } from 'three/webgpu';
5
+ import { C as CanvasCheck } from './Canvas-BfZkAFJm.cjs';
5
6
 
6
7
  /** The page-level default renderer of the three layers: `registerThree({ renderer })` sets it, a layer's own `renderer` wins. */
7
8
  type ThreeRendererKind = 'webgl' | 'webgpu';
@@ -145,17 +146,6 @@ interface ThreeSequenceSpec extends SequenceCommon {
145
146
  dispose?: (ctx: ThreeContext) => void;
146
147
  }
147
148
 
148
- /** What the determinism check found: the moments whose two pictures differ (channel values that differ, the largest difference out of 255; -1 when only a hash was compared) and the usual time of one draw. */
149
- interface CanvasCheck {
150
- differs: Array<{
151
- t: number;
152
- pixels: number;
153
- maxDiff: number;
154
- }>;
155
- drawMs: number; /** Moments where `draw` threw (or the layer has no working draw): the picture there is a checkerboard, which is not a picture that is the same twice. */
156
- threw: number[];
157
- }
158
-
159
149
  declare class ThreeSequence extends Sequence {
160
150
  private _renderer;
161
151
  /** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */
@@ -174,6 +164,8 @@ declare class ThreeSequence extends Sequence {
174
164
  private _borrowed;
175
165
  /** True once another layer owns this layer's state: destroying this one must not let it go. */
176
166
  private _donated;
167
+ /** What setup left on the objects the keyframes reach, shared with a layer that takes the scene over (core/setupValues.ts). */
168
+ private _setupValues;
177
169
  /** Things to do just before every draw (the 2D layers shown on meshes: `threeLayerTexture`), and those layers' handles. Both go with the state to a layer that takes it over. */
178
170
  private _drawHooks;
179
171
  private _layerTextures;
package/dist/three.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { b as Sequence, c as SpaceNow, d as SequenceCommon, e as PropValue, f as PathRouters, S as SequenceSpec } from './types-CTSrPvY3.js';
1
+ import { e as Sequence, b as SpaceNow, c as SequenceCommon, d as PropValue, f as PathRouters, S as SequenceSpec } from './types-BZngm4nT.js';
2
2
  import { Renderer } from 'pixi.js';
3
3
  import { Material, Texture, Scene, Camera, WebGLRenderer, Object3D, Group, Vector3, PerspectiveCamera } from 'three';
4
4
  import { WebGPURenderer } from 'three/webgpu';
5
+ import { C as CanvasCheck } from './Canvas-BfZkAFJm.js';
5
6
 
6
7
  /** The page-level default renderer of the three layers: `registerThree({ renderer })` sets it, a layer's own `renderer` wins. */
7
8
  type ThreeRendererKind = 'webgl' | 'webgpu';
@@ -145,17 +146,6 @@ interface ThreeSequenceSpec extends SequenceCommon {
145
146
  dispose?: (ctx: ThreeContext) => void;
146
147
  }
147
148
 
148
- /** What the determinism check found: the moments whose two pictures differ (channel values that differ, the largest difference out of 255; -1 when only a hash was compared) and the usual time of one draw. */
149
- interface CanvasCheck {
150
- differs: Array<{
151
- t: number;
152
- pixels: number;
153
- maxDiff: number;
154
- }>;
155
- drawMs: number; /** Moments where `draw` threw (or the layer has no working draw): the picture there is a checkerboard, which is not a picture that is the same twice. */
156
- threw: number[];
157
- }
158
-
159
149
  declare class ThreeSequence extends Sequence {
160
150
  private _renderer;
161
151
  /** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */
@@ -174,6 +164,8 @@ declare class ThreeSequence extends Sequence {
174
164
  private _borrowed;
175
165
  /** True once another layer owns this layer's state: destroying this one must not let it go. */
176
166
  private _donated;
167
+ /** What setup left on the objects the keyframes reach, shared with a layer that takes the scene over (core/setupValues.ts). */
168
+ private _setupValues;
177
169
  /** Things to do just before every draw (the 2D layers shown on meshes: `threeLayerTexture`), and those layers' handles. Both go with the state to a layer that takes it over. */
178
170
  private _drawHooks;
179
171
  private _layerTextures;
package/dist/three.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Sequence, buildScope, evaluateExpr, registerSequenceType } from './chunk-IVKI6CPH.js';
2
- import './chunk-BFRWSV3R.js';
1
+ import { Sequence, SetupValues, NOT_PURE, buildScope, evaluateExpr, registerSequenceType } from './chunk-SSVHAF3Q.js';
2
+ import './chunk-J4ZP76IL.js';
3
3
  import './chunk-WGRWFQOB.js';
4
4
  import { Texture, Sprite, TextureSource, RenderTexture, Matrix } from 'pixi.js';
5
5
  import { WebGLRenderer, Scene, PerspectiveCamera, Raycaster, Vector2, Vector3, Quaternion, Plane, Box3, RenderTarget, Group, AnimationMixer, LoopOnce, LoopRepeat, AmbientLight, DirectionalLight, SpotLight, PointLight, Color, SRGBColorSpace, Fog } from 'three';
@@ -167,7 +167,6 @@ function releaseThree(kind) {
167
167
  }
168
168
 
169
169
  // src/three/ThreeSequence.ts
170
- var NOT_PURE = /\bMath\s*\.\s*random\s*\(|\bDate\s*\.\s*now\s*\(|\bperformance\s*\.\s*now\s*\(|\bnew\s+Date\s*\(/;
171
170
  var ThreeSequence = class extends Sequence {
172
171
  _renderer = null;
173
172
  /** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */
@@ -189,6 +188,8 @@ var ThreeSequence = class extends Sequence {
189
188
  _borrowed = null;
190
189
  /** True once another layer owns this layer's state: destroying this one must not let it go. */
191
190
  _donated = false;
191
+ /** What setup left on the objects the keyframes reach, shared with a layer that takes the scene over (core/setupValues.ts). */
192
+ _setupValues = new SetupValues();
192
193
  /** Things to do just before every draw (the 2D layers shown on meshes: `threeLayerTexture`), and those layers' handles. Both go with the state to a layer that takes it over. */
193
194
  _drawHooks = /* @__PURE__ */ new Set();
194
195
  _layerTextures = [];
@@ -239,7 +240,7 @@ var ThreeSequence = class extends Sequence {
239
240
  this._gpu = kind === "webgpu";
240
241
  this.renderer = kind;
241
242
  this._key = spec.reuse === false || !spec.name ? null : JSON.stringify([spec.name, idOf(spec.setup), width, height, resolution, antialias, kind, spec.shareGpu !== false && !!this.root.gpu, !!spec.followCamera, !!spec.followLights, !!spec.followFog]);
242
- const donor = this._key !== null ? this.root.reuse?.claim(this._key) : null;
243
+ const donor = this._key !== null ? this.root.reuse?.claim(this._key, this) : null;
243
244
  if (donor && donor._lendable()) {
244
245
  this._borrow(donor, width, height, spec.name);
245
246
  return;
@@ -378,6 +379,7 @@ var ThreeSequence = class extends Sequence {
378
379
  this._camera = d._camera;
379
380
  this._ctx = d._ctx;
380
381
  this._objects = d._objects;
382
+ this._setupValues = d._setupValues;
381
383
  this._rt = d._rt;
382
384
  this._sharedTexture = d._sharedTexture;
383
385
  this._texture = d._texture;
@@ -396,6 +398,7 @@ var ThreeSequence = class extends Sequence {
396
398
  commitReuse() {
397
399
  const d = this._borrowed;
398
400
  if (!d) return;
401
+ this._setupValues.restore();
399
402
  d._donated = true;
400
403
  d._tracked = false;
401
404
  this._borrowed = null;
@@ -727,7 +730,7 @@ var ThreeSequence = class extends Sequence {
727
730
  this._warnPath(path, `no property "${prop}"`);
728
731
  return null;
729
732
  }
730
- return { target: obj, prop };
733
+ return this._borrowed ? this._setupValues.view(obj, prop, () => this._borrowed !== null) : (this._setupValues.note(obj, prop), { target: obj, prop });
731
734
  }
732
735
  _warnPath(path, why) {
733
736
  if (this._warnedPaths.has(path)) return;