pixi-effects 0.41.0 → 0.43.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 (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/dist/{Base-Jgkud1Aw.d.ts → Base-DKFQtqzW.d.ts} +1 -1
  5. package/dist/{Base-DQWIJ6bJ.d.cts → Base-lb5Uhaqu.d.cts} +1 -1
  6. package/dist/Controller.d.cts +2 -2
  7. package/dist/Controller.d.ts +2 -2
  8. package/dist/{Movie-CwqRLOzE.d.ts → Movie-B_qQIYV6.d.ts} +47 -4
  9. package/dist/{Movie-DWtxRiJ2.d.cts → Movie-BdUm2Mc9.d.cts} +47 -4
  10. package/dist/{chunk-Y2N6U3X5.js → chunk-6N5ZBUOU.js} +169 -8
  11. package/dist/chunk-6N5ZBUOU.js.map +1 -0
  12. package/dist/{chunk-RN5FWGGM.cjs → chunk-BEGOKE7Q.cjs} +169 -8
  13. package/dist/chunk-BEGOKE7Q.cjs.map +1 -0
  14. package/dist/index.cjs +25 -25
  15. package/dist/index.d.cts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +1 -1
  18. package/dist/loader.css +1 -1
  19. package/dist/present.cjs +1 -1
  20. package/dist/present.d.cts +2 -2
  21. package/dist/present.d.ts +2 -2
  22. package/dist/present.js +1 -1
  23. package/dist/three.cjs +115 -24
  24. package/dist/three.cjs.map +1 -1
  25. package/dist/three.d.cts +28 -2
  26. package/dist/three.d.ts +28 -2
  27. package/dist/three.js +117 -26
  28. package/dist/three.js.map +1 -1
  29. package/dist/{types-DIh93lFb.d.cts → types-DiNHtdrS.d.cts} +19 -0
  30. package/dist/{types-DIh93lFb.d.ts → types-DiNHtdrS.d.ts} +19 -0
  31. package/docs/api.md +23 -3
  32. package/docs/dsl.md +3 -2
  33. package/llms-full.txt +147 -17
  34. package/package.json +2 -1
  35. package/skills/pixi-effects/SKILL.md +2 -1
  36. package/skills/pixi-effects/reference/cheatsheet.md +2 -0
  37. package/skills/pixi-effects/reference/recipes.md +117 -11
  38. package/skills/pixi-effects/template.html +6 -6
  39. package/dist/chunk-RN5FWGGM.cjs.map +0 -1
  40. package/dist/chunk-Y2N6U3X5.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRN5FWGGM_cjs = require('./chunk-RN5FWGGM.cjs');
3
+ var chunkBEGOKE7Q_cjs = require('./chunk-BEGOKE7Q.cjs');
4
4
  require('./chunk-3HZV3UHU.cjs');
5
5
  var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
6
6
  var chunkLQDDDIC4_cjs = require('./chunk-LQDDDIC4.cjs');
@@ -12,99 +12,99 @@ var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "Movie", {
14
14
  enumerable: true,
15
- get: function () { return chunkRN5FWGGM_cjs.Movie; }
15
+ get: function () { return chunkBEGOKE7Q_cjs.Movie; }
16
16
  });
17
17
  Object.defineProperty(exports, "animateText", {
18
18
  enumerable: true,
19
- get: function () { return chunkRN5FWGGM_cjs.animateText; }
19
+ get: function () { return chunkBEGOKE7Q_cjs.animateText; }
20
20
  });
21
21
  Object.defineProperty(exports, "audioEnvelope", {
22
22
  enumerable: true,
23
- get: function () { return chunkRN5FWGGM_cjs.audioEnvelope; }
23
+ get: function () { return chunkBEGOKE7Q_cjs.audioEnvelope; }
24
24
  });
25
25
  Object.defineProperty(exports, "bpmEnvelope", {
26
26
  enumerable: true,
27
- get: function () { return chunkRN5FWGGM_cjs.bpmEnvelope; }
27
+ get: function () { return chunkBEGOKE7Q_cjs.bpmEnvelope; }
28
28
  });
29
29
  Object.defineProperty(exports, "cameraPath", {
30
30
  enumerable: true,
31
- get: function () { return chunkRN5FWGGM_cjs.cameraPath; }
31
+ get: function () { return chunkBEGOKE7Q_cjs.cameraPath; }
32
32
  });
33
33
  Object.defineProperty(exports, "computeEnvelope", {
34
34
  enumerable: true,
35
- get: function () { return chunkRN5FWGGM_cjs.computeEnvelope; }
35
+ get: function () { return chunkBEGOKE7Q_cjs.computeEnvelope; }
36
36
  });
37
37
  Object.defineProperty(exports, "dismissLoader", {
38
38
  enumerable: true,
39
- get: function () { return chunkRN5FWGGM_cjs.dismissLoader; }
39
+ get: function () { return chunkBEGOKE7Q_cjs.dismissLoader; }
40
40
  });
41
41
  Object.defineProperty(exports, "ease", {
42
42
  enumerable: true,
43
- get: function () { return chunkRN5FWGGM_cjs.parseEase; }
43
+ get: function () { return chunkBEGOKE7Q_cjs.parseEase; }
44
44
  });
45
45
  Object.defineProperty(exports, "failLoader", {
46
46
  enumerable: true,
47
- get: function () { return chunkRN5FWGGM_cjs.failLoader; }
47
+ get: function () { return chunkBEGOKE7Q_cjs.failLoader; }
48
48
  });
49
49
  Object.defineProperty(exports, "followPath", {
50
50
  enumerable: true,
51
- get: function () { return chunkRN5FWGGM_cjs.followPath; }
51
+ get: function () { return chunkBEGOKE7Q_cjs.followPath; }
52
52
  });
53
53
  Object.defineProperty(exports, "kenBurns", {
54
54
  enumerable: true,
55
- get: function () { return chunkRN5FWGGM_cjs.kenBurns; }
55
+ get: function () { return chunkBEGOKE7Q_cjs.kenBurns; }
56
56
  });
57
57
  Object.defineProperty(exports, "measureText", {
58
58
  enumerable: true,
59
- get: function () { return chunkRN5FWGGM_cjs.measureText; }
59
+ get: function () { return chunkBEGOKE7Q_cjs.measureText; }
60
60
  });
61
61
  Object.defineProperty(exports, "musicBuffer", {
62
62
  enumerable: true,
63
- get: function () { return chunkRN5FWGGM_cjs.musicBuffer; }
63
+ get: function () { return chunkBEGOKE7Q_cjs.musicBuffer; }
64
64
  });
65
65
  Object.defineProperty(exports, "musicEnvelope", {
66
66
  enumerable: true,
67
- get: function () { return chunkRN5FWGGM_cjs.musicEnvelope; }
67
+ get: function () { return chunkBEGOKE7Q_cjs.musicEnvelope; }
68
68
  });
69
69
  Object.defineProperty(exports, "musicEvents", {
70
70
  enumerable: true,
71
- get: function () { return chunkRN5FWGGM_cjs.musicEvents; }
71
+ get: function () { return chunkBEGOKE7Q_cjs.musicEvents; }
72
72
  });
73
73
  Object.defineProperty(exports, "orbit", {
74
74
  enumerable: true,
75
- get: function () { return chunkRN5FWGGM_cjs.orbit; }
75
+ get: function () { return chunkBEGOKE7Q_cjs.orbit; }
76
76
  });
77
77
  Object.defineProperty(exports, "particles", {
78
78
  enumerable: true,
79
- get: function () { return chunkRN5FWGGM_cjs.particles; }
79
+ get: function () { return chunkBEGOKE7Q_cjs.particles; }
80
80
  });
81
81
  Object.defineProperty(exports, "react", {
82
82
  enumerable: true,
83
- get: function () { return chunkRN5FWGGM_cjs.react; }
83
+ get: function () { return chunkBEGOKE7Q_cjs.react; }
84
84
  });
85
85
  Object.defineProperty(exports, "resolveLoader", {
86
86
  enumerable: true,
87
- get: function () { return chunkRN5FWGGM_cjs.resolveLoader; }
87
+ get: function () { return chunkBEGOKE7Q_cjs.resolveLoader; }
88
88
  });
89
89
  Object.defineProperty(exports, "samplePath", {
90
90
  enumerable: true,
91
- get: function () { return chunkRN5FWGGM_cjs.samplePath; }
91
+ get: function () { return chunkBEGOKE7Q_cjs.samplePath; }
92
92
  });
93
93
  Object.defineProperty(exports, "splitText", {
94
94
  enumerable: true,
95
- get: function () { return chunkRN5FWGGM_cjs.splitText; }
95
+ get: function () { return chunkBEGOKE7Q_cjs.splitText; }
96
96
  });
97
97
  Object.defineProperty(exports, "stagger", {
98
98
  enumerable: true,
99
- get: function () { return chunkRN5FWGGM_cjs.stagger; }
99
+ get: function () { return chunkBEGOKE7Q_cjs.stagger; }
100
100
  });
101
101
  Object.defineProperty(exports, "wiggle", {
102
102
  enumerable: true,
103
- get: function () { return chunkRN5FWGGM_cjs.wiggle; }
103
+ get: function () { return chunkBEGOKE7Q_cjs.wiggle; }
104
104
  });
105
105
  Object.defineProperty(exports, "withFade", {
106
106
  enumerable: true,
107
- get: function () { return chunkRN5FWGGM_cjs.withFade; }
107
+ get: function () { return chunkBEGOKE7Q_cjs.withFade; }
108
108
  });
109
109
  Object.defineProperty(exports, "Sequence", {
110
110
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-DWtxRiJ2.cjs';
2
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DIh93lFb.cjs';
3
- export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DIh93lFb.cjs';
1
+ export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, H as HoverOptions, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-BdUm2Mc9.cjs';
2
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DiNHtdrS.cjs';
3
+ export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DiNHtdrS.cjs';
4
4
  import { M as MusicEvents } from './soundEntry-DT13DNt8.cjs';
5
5
  export { a as AudioInspectOptions, A as AudioReport, b as AudioSourceReport, c as MusicDrumEvents, d as MusicDrumHit, e as MusicNote, f as MusicSummary, g as MusicTrackEvents, S as SoundMeasure, h as SoundReport, i as inspectSound } from './soundEntry-DT13DNt8.cjs';
6
- import { S as Sequence } from './Base-DQWIJ6bJ.cjs';
6
+ import { S as Sequence } from './Base-lb5Uhaqu.cjs';
7
7
  import 'pixi.js';
8
8
 
9
9
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-CwqRLOzE.js';
2
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DIh93lFb.js';
3
- export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DIh93lFb.js';
1
+ export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, H as HoverOptions, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-B_qQIYV6.js';
2
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DiNHtdrS.js';
3
+ export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DiNHtdrS.js';
4
4
  import { M as MusicEvents } from './soundEntry-DT13DNt8.js';
5
5
  export { a as AudioInspectOptions, A as AudioReport, b as AudioSourceReport, c as MusicDrumEvents, d as MusicDrumHit, e as MusicNote, f as MusicSummary, g as MusicTrackEvents, S as SoundMeasure, h as SoundReport, i as inspectSound } from './soundEntry-DT13DNt8.js';
6
- import { S as Sequence } from './Base-Jgkud1Aw.js';
6
+ import { S as Sequence } from './Base-DKFQtqzW.js';
7
7
  import 'pixi.js';
8
8
 
9
9
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade } from './chunk-Y2N6U3X5.js';
1
+ export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade } from './chunk-6N5ZBUOU.js';
2
2
  import './chunk-ICI6ACHY.js';
3
3
  export { Sequence, noise, noise2, rand, random, registerSequenceType } from './chunk-4QVQ5UJJ.js';
4
4
  export { inspectSound } from './chunk-UHNSL2KJ.js';
package/dist/loader.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * pixi-effects loader: one line of HTML on the page, a few lines of CSS, no JavaScript of your own.
3
3
  *
4
- * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.41.0/dist/loader.css">
4
+ * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.43.0/dist/loader.css">
5
5
  * <div class="stage" style="position: relative"> <!-- any box the canvas sits in, with position: relative -->
6
6
  * <canvas id="stage" width="1280" height="720"></canvas>
7
7
  * <div class="pe-loader" data-label="LOADING"></div> <!-- or class="pe-loader pe-loader--bar" -->
package/dist/present.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-RN5FWGGM.cjs');
3
+ require('./chunk-BEGOKE7Q.cjs');
4
4
  require('./chunk-3HZV3UHU.cjs');
5
5
  require('./chunk-X62H3RBG.cjs');
6
6
  require('./chunk-LQDDDIC4.cjs');
@@ -1,5 +1,5 @@
1
- import { M as Movie, a as MotionBlurSpec } from './Movie-DWtxRiJ2.cjs';
2
- import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.cjs';
1
+ import { M as Movie, a as MotionBlurSpec } from './Movie-BdUm2Mc9.cjs';
2
+ import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DiNHtdrS.cjs';
3
3
  import 'pixi.js';
4
4
  import './soundEntry-DT13DNt8.cjs';
5
5
 
package/dist/present.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Movie, a as MotionBlurSpec } from './Movie-CwqRLOzE.js';
2
- import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.js';
1
+ import { M as Movie, a as MotionBlurSpec } from './Movie-B_qQIYV6.js';
2
+ import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DiNHtdrS.js';
3
3
  import 'pixi.js';
4
4
  import './soundEntry-DT13DNt8.js';
5
5
 
package/dist/present.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-Y2N6U3X5.js';
1
+ import './chunk-6N5ZBUOU.js';
2
2
  import './chunk-ICI6ACHY.js';
3
3
  import './chunk-4QVQ5UJJ.js';
4
4
  import './chunk-UHNSL2KJ.js';
package/dist/three.cjs CHANGED
@@ -161,7 +161,7 @@ function trackThree(kind) {
161
161
  live[kind]++;
162
162
  if (live[kind] > WARN_ABOVE[kind] && !warned.has(kind)) {
163
163
  warned.add(kind);
164
- console.warn(`pixi-effects: ${live[kind]} three layers are alive with renderer: '${kind}', and a browser keeps ${LIMIT[kind]} for the whole page; layers beyond that draw nothing, without an error. Put several objects in one three layer, destroy layers that are over, ` + (kind === "webgl" ? `or use renderer: 'webgpu' for some (its limit is about 32)` : `or use renderer: 'webgl' for some of them (a different pool of contexts)`));
164
+ console.warn(`pixi-effects: ${live[kind]} three layers are alive with renderer: '${kind}', and a browser keeps ${LIMIT[kind]} for the whole page; layers beyond that draw nothing, without an error. Put several objects in one three layer, destroy layers that are over, ` + (kind === "webgl" ? `or use renderer: 'webgpu' for some (in a movie PixiJS draws on WebGPU they share its GPU device and have no limit; otherwise it is about 32)` : `or use renderer: 'webgl' for some of them (a different pool of contexts), or leave shareGpu on in a movie PixiJS draws on WebGPU (the layers then share its device)`));
165
165
  }
166
166
  }
167
167
  function releaseThree(kind) {
@@ -178,6 +178,11 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
178
178
  backend = null;
179
179
  _gpu = false;
180
180
  // renderer: 'webgpu': async init and async render
181
+ /** True when the layer draws on PixiJS's own GPU device into a texture PixiJS samples directly (no canvas of its own, no copy, no share of the page's context cap). */
182
+ sharedGpu = false;
183
+ _rt = null;
184
+ // the texture a shared layer draws into
185
+ _sharedTexture = null;
181
186
  _scene = null;
182
187
  _camera = null;
183
188
  _ctx = null;
@@ -189,6 +194,8 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
189
194
  _fogMirror = null;
190
195
  _warnedSpace = /* @__PURE__ */ new Set();
191
196
  _tracked = false;
197
+ /** Set when this layer lets its renderer go on purpose: the context loss that follows is its own doing, not the browser's. */
198
+ _closing = false;
192
199
  get _threeSpec() {
193
200
  return this.spec;
194
201
  }
@@ -221,31 +228,43 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
221
228
  } catch (err) {
222
229
  throw new Error(`pixi-effects: renderer: 'webgpu' needs three 0.17x or later with "three/webgpu" in the import map (${err instanceof Error ? err.message : err})`);
223
230
  }
224
- renderer = new mod.WebGPURenderer({ canvas, alpha: true, antialias });
225
- this._renderer = renderer;
226
- this._track();
227
- const warn = console.warn;
228
- let noGpu = false;
229
- console.warn = (...args) => {
230
- if (/WebGPU is not available/.test(String(args[0]))) noGpu = true;
231
- else warn.apply(console, args);
232
- };
233
- try {
234
- await renderer.init();
235
- } catch (err) {
236
- this._disposeRenderer();
237
- throw err;
238
- } finally {
239
- console.warn = warn;
231
+ let shared = spec.shareGpu === false ? void 0 : this.root.gpu;
232
+ for (; ; ) {
233
+ renderer = new mod.WebGPURenderer(shared ? { device: shared.device, alpha: true, antialias } : { canvas, alpha: true, antialias });
234
+ this._renderer = renderer;
235
+ if (!shared) this._track();
236
+ const warn = console.warn;
237
+ let noGpu = false;
238
+ console.warn = (...args) => {
239
+ if (/WebGPU is not available/.test(String(args[0]))) noGpu = true;
240
+ else warn.apply(console, args);
241
+ };
242
+ try {
243
+ await renderer.init();
244
+ if (shared) {
245
+ renderer.setSize(Math.round(width * resolution), Math.round(height * resolution), false);
246
+ renderer.setClearColor(0, 0);
247
+ this._prepareShared(renderer, shared, width, height, resolution, antialias);
248
+ }
249
+ this.backend = noGpu ? "webgl2" : "webgpu";
250
+ break;
251
+ } catch (err) {
252
+ this._disposeRenderer();
253
+ if (!shared) throw err;
254
+ console.warn(`pixi-effects: three layer${spec.name ? ` "${spec.name}"` : ""}: could not draw on PixiJS's GPU device (${err instanceof Error ? err.message : err}); it uses a canvas of its own (shareGpu: false does this on purpose)`);
255
+ shared = void 0;
256
+ this._closing = false;
257
+ } finally {
258
+ console.warn = warn;
259
+ }
240
260
  }
241
- this.backend = noGpu ? "webgl2" : "webgpu";
242
261
  } else {
243
262
  renderer = new three$1.WebGLRenderer({ canvas, alpha: true, antialias });
244
263
  this._renderer = renderer;
245
264
  this._track();
246
265
  let said = false;
247
266
  canvas.addEventListener("webglcontextlost", () => {
248
- if (said) return;
267
+ if (said || this._closing) return;
249
268
  said = true;
250
269
  console.warn(`pixi-effects: three layer${spec.name ? ` "${spec.name}"` : ""}: the browser took this layer's WebGL context away (a page keeps about 16 for all its layers, PixiJS and shader layers: too many were alive), so the layer draws nothing. Put several objects in one three layer, or destroy layers that are over`);
251
270
  });
@@ -272,7 +291,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
272
291
  if (!("camera" in this._objects)) this._objects.camera = this._camera;
273
292
  if (this._gpu) this._checkWebGpuMaterials(scene, spec.name);
274
293
  this._draw(0);
275
- const texture = pixi_js.Texture.from(canvas);
294
+ const texture = this._sharedTexture ?? pixi_js.Texture.from(canvas);
276
295
  const sprite = new pixi_js.Sprite({ texture, label: spec.name });
277
296
  sprite.cullable = true;
278
297
  sprite.width = width;
@@ -308,7 +327,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
308
327
  }
309
328
  }
310
329
  this._draw(t);
311
- this.target?.texture.source.update();
330
+ if (!this.sharedGpu) this.target?.texture.source.update();
312
331
  }
313
332
  /**
314
333
  * `movie.pick`: a ray through the point (u, v) of the layer's picture (0..1, v down) from the layer's camera, and what it meets first: the object's name (its own, or its nearest
@@ -336,6 +355,36 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
336
355
  }
337
356
  return null;
338
357
  }
358
+ /**
359
+ * `hit.three.grab(plane)`: drag a grabbed point of the scene. Returns a function of a point (u, v) of the layer's picture (0..1, v down) that gives where the pointer's ray through the layer's
360
+ * camera meets a plane through the grabbed point, and how far that is from the grabbed point (`delta`): move the object by it and it follows the pointer exactly. `plane`: `'screen'` (facing the
361
+ * camera: the default), `'floor'` (horizontal, the three y up), `'wall'` (z constant), or a normal `[x, y, z]`. null where the ray never meets it (a floor seen edge-on, behind the camera).
362
+ */
363
+ dragPlane(point, plane = "screen") {
364
+ const grabbed = new three$1.Vector3(...point);
365
+ let normal;
366
+ if (plane === "floor") normal = new three$1.Vector3(0, 1, 0);
367
+ else if (plane === "wall") normal = new three$1.Vector3(0, 0, 1);
368
+ else if (Array.isArray(plane)) normal = new three$1.Vector3(...plane).normalize();
369
+ else {
370
+ const turn = new three$1.Quaternion();
371
+ this._camera?.updateMatrixWorld();
372
+ this._camera?.getWorldQuaternion(turn);
373
+ normal = new three$1.Vector3(0, 0, 1).applyQuaternion(turn);
374
+ }
375
+ const surface = new three$1.Plane().setFromNormalAndCoplanarPoint(normal, grabbed);
376
+ return (u, v) => {
377
+ const scene = this._scene, camera = this._camera;
378
+ if (!scene || !camera) return null;
379
+ scene.updateMatrixWorld();
380
+ camera.updateMatrixWorld();
381
+ const ray = new three$1.Raycaster();
382
+ ray.setFromCamera(new three$1.Vector2(u * 2 - 1, -(v * 2 - 1)), camera);
383
+ const at = ray.ray.intersectPlane(surface, new three$1.Vector3());
384
+ if (!at) return null;
385
+ return { point: at.toArray(), delta: at.clone().sub(grabbed).toArray() };
386
+ };
387
+ }
339
388
  /**
340
389
  * The determinism check (`check`, `movie.review()`): the scene drawn at a few moments in two orders, with one draw thrown away first, and the pictures compared, as the canvas layer
341
390
  * does. A layer whose same frame is not the same picture (a clock, `Math.random`, a mixer advanced with `update(dt)`, any state that builds up from call to call) is reported.
@@ -368,7 +417,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
368
417
  try {
369
418
  this._followSpace(t);
370
419
  this._threeSpec.update?.(t, ctx);
371
- this._draw(t);
420
+ this._draw(t, true);
372
421
  g.clearRect(0, 0, w, h);
373
422
  g.drawImage(source, 0, 0);
374
423
  } catch {
@@ -471,10 +520,45 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
471
520
  * follow each other in one task (a seek, an export) would all show the lights of the last animation frame: a lamp keyframed with `three.lamp.intensity` would not move.
472
521
  * So before each render the layer advances the node frame itself, and gives `time` the layer's own time (not three's wall clock).
473
522
  */
474
- _draw(t) {
523
+ _draw(t, toCanvas = false) {
475
524
  if (!this._renderer || !this._scene || !this._camera) return;
476
525
  if (this._gpu) this._advanceNodeFrame(t);
477
- this._renderer.render(this._scene, this._camera);
526
+ if (!this._rt || toCanvas) {
527
+ this._renderer.render(this._scene, this._camera);
528
+ return;
529
+ }
530
+ const r = this._renderer;
531
+ r.setOutputRenderTarget(this._rt);
532
+ try {
533
+ this._renderer.render(this._scene, this._camera);
534
+ } finally {
535
+ r.setOutputRenderTarget(null);
536
+ r.setRenderTarget(null);
537
+ }
538
+ }
539
+ /**
540
+ * A shared layer's texture: a render target of the layer's size, drawn into once (the GPU texture exists only after a draw) and adopted by a PixiJS texture source. Throws when something
541
+ * is not as this expects (the build then makes the layer again on a canvas of its own). Done before `setup`, so nothing the author made yet depends on the renderer.
542
+ */
543
+ _prepareShared(renderer, shared, width, height, resolution, antialias) {
544
+ const w = Math.round(width * resolution), h = Math.round(height * resolution);
545
+ const rt = new three$1.RenderTarget(w, h, { depthBuffer: true, samples: antialias ? 4 : 0 });
546
+ this._rt = rt;
547
+ const r = renderer;
548
+ if (typeof r.setOutputRenderTarget !== "function") throw new Error("this three has no setOutputRenderTarget");
549
+ r.setOutputRenderTarget(rt);
550
+ try {
551
+ renderer.render(new three$1.Scene(), new three$1.PerspectiveCamera());
552
+ } finally {
553
+ r.setOutputRenderTarget(null);
554
+ r.setRenderTarget(null);
555
+ }
556
+ const gpuTexture = r.backend?.get?.(rt.texture)?.texture;
557
+ if (!gpuTexture || typeof gpuTexture.createView !== "function") throw new Error("three keeps no GPU texture for a render target");
558
+ const source = new pixi_js.TextureSource({ width: w, height: h, format: gpuTexture.format, label: "three layer (shared GPU)" });
559
+ shared.adopt(source, gpuTexture);
560
+ this._sharedTexture = new pixi_js.Texture({ source });
561
+ this.sharedGpu = true;
478
562
  }
479
563
  /**
480
564
  * The author chose renderer: 'webgpu'. Three's WebGPU renderer turns materials into node materials: a ShaderMaterial / RawShaderMaterial cannot run there (three logs an error on
@@ -557,6 +641,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
557
641
  }
558
642
  _disposeRenderer() {
559
643
  if (!this._renderer) return;
644
+ this._closing = true;
560
645
  if (this._tracked) {
561
646
  this._tracked = false;
562
647
  releaseThree(this._gpu ? "webgpu" : "webgl");
@@ -568,6 +653,11 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
568
653
  console.warn("pixi-effects: three renderer dispose threw \u2014", err);
569
654
  }
570
655
  this._renderer = null;
656
+ try {
657
+ this._rt?.dispose();
658
+ } catch {
659
+ }
660
+ this._rt = null;
571
661
  }
572
662
  destroy() {
573
663
  const spec = this._threeSpec;
@@ -590,6 +680,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
590
680
  this._objects = {};
591
681
  super.destroy();
592
682
  texture?.destroy(true);
683
+ this._sharedTexture = null;
593
684
  }
594
685
  };
595
686
  function resolveDim(v, scope) {