pixi-effects 0.40.0 → 0.42.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.
- package/CHANGELOG.md +17 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/check.mjs +19 -2
- package/dist/Composition-N6BOROJ2.cjs +16 -0
- package/dist/{Composition-C3UEVHQG.cjs.map → Composition-N6BOROJ2.cjs.map} +1 -1
- package/dist/Composition-YGBQX3HZ.js +7 -0
- package/dist/{Composition-KRWH72MA.js.map → Composition-YGBQX3HZ.js.map} +1 -1
- package/dist/Controller.d.cts +1 -1
- package/dist/Controller.d.ts +1 -1
- package/dist/{Movie-CMq4KFmc.d.cts → Movie-BHGhg-fJ.d.cts} +88 -1
- package/dist/{Movie-CG6Jy1tx.d.ts → Movie-CBVFZ1kg.d.ts} +88 -1
- package/dist/{Spans-TWO4VN5H.js → Spans-6L2ZVECX.js} +4 -4
- package/dist/{Spans-TWO4VN5H.js.map → Spans-6L2ZVECX.js.map} +1 -1
- package/dist/{Spans-APNJHCYO.cjs → Spans-XTIWYSNO.cjs} +9 -9
- package/dist/{Spans-APNJHCYO.cjs.map → Spans-XTIWYSNO.cjs.map} +1 -1
- package/dist/{chunk-27PYJ4JY.cjs → chunk-3HZV3UHU.cjs} +67 -63
- package/dist/chunk-3HZV3UHU.cjs.map +1 -0
- package/dist/{chunk-LMWXR5OC.js → chunk-4QVQ5UJJ.js} +4 -4
- package/dist/{chunk-LMWXR5OC.js.map → chunk-4QVQ5UJJ.js.map} +1 -1
- package/dist/{chunk-26Z544SH.js → chunk-ICI6ACHY.js} +7 -3
- package/dist/chunk-ICI6ACHY.js.map +1 -0
- package/dist/{chunk-CT5CZVT5.js → chunk-NFJKBWYO.js} +243 -4
- package/dist/chunk-NFJKBWYO.js.map +1 -0
- package/dist/{chunk-LEL7UNYQ.cjs → chunk-WVZLAIKK.cjs} +278 -39
- package/dist/chunk-WVZLAIKK.cjs.map +1 -0
- package/dist/{chunk-7EI2N7WO.cjs → chunk-X62H3RBG.cjs} +4 -4
- package/dist/{chunk-7EI2N7WO.cjs.map → chunk-X62H3RBG.cjs.map} +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.d.cts +1 -1
- package/dist/present.d.ts +1 -1
- package/dist/present.js +3 -3
- package/dist/three.cjs +86 -7
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +27 -1
- package/dist/three.d.ts +27 -1
- package/dist/three.js +83 -4
- package/dist/three.js.map +1 -1
- package/docs/api.md +37 -0
- package/docs/dsl.md +1 -1
- package/llms-full.txt +173 -3
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +3 -2
- package/skills/pixi-effects/reference/cheatsheet.md +3 -0
- package/skills/pixi-effects/reference/recipes.md +129 -0
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-C3UEVHQG.cjs +0 -16
- package/dist/Composition-KRWH72MA.js +0 -7
- package/dist/chunk-26Z544SH.js.map +0 -1
- package/dist/chunk-27PYJ4JY.cjs.map +0 -1
- package/dist/chunk-CT5CZVT5.js.map +0 -1
- package/dist/chunk-LEL7UNYQ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
var
|
|
3
|
+
var chunkWVZLAIKK_cjs = require('./chunk-WVZLAIKK.cjs');
|
|
4
|
+
require('./chunk-3HZV3UHU.cjs');
|
|
5
|
+
var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
|
|
6
6
|
var chunkLQDDDIC4_cjs = require('./chunk-LQDDDIC4.cjs');
|
|
7
7
|
require('./chunk-JN7JHNZR.cjs');
|
|
8
8
|
require('./chunk-3SAS3ZE5.cjs');
|
|
@@ -12,123 +12,123 @@ var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "Movie", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkWVZLAIKK_cjs.Movie; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "animateText", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkWVZLAIKK_cjs.animateText; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "audioEnvelope", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkWVZLAIKK_cjs.audioEnvelope; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "bpmEnvelope", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkWVZLAIKK_cjs.bpmEnvelope; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "cameraPath", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkWVZLAIKK_cjs.cameraPath; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "computeEnvelope", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkWVZLAIKK_cjs.computeEnvelope; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "dismissLoader", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkWVZLAIKK_cjs.dismissLoader; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "ease", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkWVZLAIKK_cjs.parseEase; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "failLoader", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkWVZLAIKK_cjs.failLoader; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "followPath", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkWVZLAIKK_cjs.followPath; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "kenBurns", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkWVZLAIKK_cjs.kenBurns; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "measureText", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkWVZLAIKK_cjs.measureText; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "musicBuffer", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkWVZLAIKK_cjs.musicBuffer; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "musicEnvelope", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkWVZLAIKK_cjs.musicEnvelope; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "musicEvents", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkWVZLAIKK_cjs.musicEvents; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "orbit", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkWVZLAIKK_cjs.orbit; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "particles", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkWVZLAIKK_cjs.particles; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "react", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkWVZLAIKK_cjs.react; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "resolveLoader", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkWVZLAIKK_cjs.resolveLoader; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "samplePath", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkWVZLAIKK_cjs.samplePath; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "splitText", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkWVZLAIKK_cjs.splitText; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "stagger", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkWVZLAIKK_cjs.stagger; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "wiggle", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkWVZLAIKK_cjs.wiggle; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "withFade", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkWVZLAIKK_cjs.withFade; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "Sequence", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkX62H3RBG_cjs.Sequence; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "noise", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkX62H3RBG_cjs.noise; }
|
|
116
116
|
});
|
|
117
117
|
Object.defineProperty(exports, "noise2", {
|
|
118
118
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkX62H3RBG_cjs.noise2; }
|
|
120
120
|
});
|
|
121
121
|
Object.defineProperty(exports, "rand", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkX62H3RBG_cjs.rand; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "random", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkX62H3RBG_cjs.random; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "registerSequenceType", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkX62H3RBG_cjs.registerSequenceType; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "inspectSound", {
|
|
134
134
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 ProgressEvent, R as RebuildOptions,
|
|
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-BHGhg-fJ.cjs';
|
|
2
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
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';
|
|
4
4
|
import { M as MusicEvents } from './soundEntry-DT13DNt8.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 ProgressEvent, R as RebuildOptions,
|
|
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-CBVFZ1kg.js';
|
|
2
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
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';
|
|
4
4
|
import { M as MusicEvents } from './soundEntry-DT13DNt8.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
import './chunk-
|
|
3
|
-
export { Sequence, noise, noise2, rand, random, registerSequenceType } from './chunk-
|
|
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-NFJKBWYO.js';
|
|
2
|
+
import './chunk-ICI6ACHY.js';
|
|
3
|
+
export { Sequence, noise, noise2, rand, random, registerSequenceType } from './chunk-4QVQ5UJJ.js';
|
|
4
4
|
export { inspectSound } from './chunk-UHNSL2KJ.js';
|
|
5
5
|
import './chunk-VNP7QCJE.js';
|
|
6
6
|
import './chunk-32MMNDDN.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.
|
|
4
|
+
* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.42.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,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-WVZLAIKK.cjs');
|
|
4
|
+
require('./chunk-3HZV3UHU.cjs');
|
|
5
|
+
require('./chunk-X62H3RBG.cjs');
|
|
6
6
|
require('./chunk-LQDDDIC4.cjs');
|
|
7
7
|
require('./chunk-JN7JHNZR.cjs');
|
|
8
8
|
require('./chunk-3SAS3ZE5.cjs');
|
package/dist/present.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Movie, a as MotionBlurSpec } from './Movie-
|
|
1
|
+
import { M as Movie, a as MotionBlurSpec } from './Movie-BHGhg-fJ.cjs';
|
|
2
2
|
import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.cjs';
|
|
3
3
|
import 'pixi.js';
|
|
4
4
|
import './soundEntry-DT13DNt8.cjs';
|
package/dist/present.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Movie, a as MotionBlurSpec } from './Movie-
|
|
1
|
+
import { M as Movie, a as MotionBlurSpec } from './Movie-CBVFZ1kg.js';
|
|
2
2
|
import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.js';
|
|
3
3
|
import 'pixi.js';
|
|
4
4
|
import './soundEntry-DT13DNt8.js';
|
package/dist/present.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import './chunk-NFJKBWYO.js';
|
|
2
|
+
import './chunk-ICI6ACHY.js';
|
|
3
|
+
import './chunk-4QVQ5UJJ.js';
|
|
4
4
|
import './chunk-UHNSL2KJ.js';
|
|
5
5
|
import './chunk-VNP7QCJE.js';
|
|
6
6
|
import './chunk-32MMNDDN.js';
|
package/dist/three.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
|
|
4
4
|
require('./chunk-3SAS3ZE5.cjs');
|
|
5
5
|
require('./chunk-TWZNOUM7.cjs');
|
|
6
6
|
var pixi_js = require('pixi.js');
|
|
@@ -85,8 +85,10 @@ var LightMirror = class {
|
|
|
85
85
|
l.decay = 2;
|
|
86
86
|
intensity *= s.radius * s.radius;
|
|
87
87
|
} else if (s.falloff === "smooth") {
|
|
88
|
-
|
|
88
|
+
const reach = s.radius + Math.max(s.falloffDistance, 1e-3), p = s.radius / reach;
|
|
89
|
+
l.distance = reach * (0.8 + 0.45 * p);
|
|
89
90
|
l.decay = 0;
|
|
91
|
+
intensity *= 0.87 + 0.45 * p;
|
|
90
92
|
} else {
|
|
91
93
|
l.distance = 0;
|
|
92
94
|
l.decay = 0;
|
|
@@ -168,7 +170,7 @@ function releaseThree(kind) {
|
|
|
168
170
|
|
|
169
171
|
// src/three/ThreeSequence.ts
|
|
170
172
|
var NOT_PURE = /\bMath\s*\.\s*random\s*\(|\bDate\s*\.\s*now\s*\(|\bperformance\s*\.\s*now\s*\(|\bnew\s+Date\s*\(/;
|
|
171
|
-
var ThreeSequence = class extends
|
|
173
|
+
var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
172
174
|
_renderer = null;
|
|
173
175
|
/** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */
|
|
174
176
|
renderer = null;
|
|
@@ -187,6 +189,8 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
187
189
|
_fogMirror = null;
|
|
188
190
|
_warnedSpace = /* @__PURE__ */ new Set();
|
|
189
191
|
_tracked = false;
|
|
192
|
+
/** Set when this layer lets its renderer go on purpose: the context loss that follows is its own doing, not the browser's. */
|
|
193
|
+
_closing = false;
|
|
190
194
|
get _threeSpec() {
|
|
191
195
|
return this.spec;
|
|
192
196
|
}
|
|
@@ -201,7 +205,7 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
201
205
|
if (typeof spec.update === "function" && NOT_PURE.test(spec.update.toString())) {
|
|
202
206
|
console.warn(`pixi-effects: three layer${spec.name ? ` "${spec.name}"` : ""}: update calls Math.random, Date.now, performance.now or new Date, so it is not deterministic: the same frame would draw differently in playback, in a seek and in an export. Derive the value from t`);
|
|
203
207
|
}
|
|
204
|
-
const scope =
|
|
208
|
+
const scope = chunkX62H3RBG_cjs.buildScope(this, this.parent, this.root);
|
|
205
209
|
const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;
|
|
206
210
|
const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;
|
|
207
211
|
const resolution = spec.resolution ?? 1;
|
|
@@ -243,7 +247,7 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
243
247
|
this._track();
|
|
244
248
|
let said = false;
|
|
245
249
|
canvas.addEventListener("webglcontextlost", () => {
|
|
246
|
-
if (said) return;
|
|
250
|
+
if (said || this._closing) return;
|
|
247
251
|
said = true;
|
|
248
252
|
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`);
|
|
249
253
|
});
|
|
@@ -308,6 +312,62 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
308
312
|
this._draw(t);
|
|
309
313
|
this.target?.texture.source.update();
|
|
310
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* `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
|
|
317
|
+
* ancestor's that has one), where, and how far from the camera. Invisible objects and groups are not met. null when the ray meets nothing.
|
|
318
|
+
*/
|
|
319
|
+
pickAt(u, v) {
|
|
320
|
+
const scene = this._scene, camera = this._camera;
|
|
321
|
+
if (!scene || !camera) return null;
|
|
322
|
+
scene.updateMatrixWorld();
|
|
323
|
+
camera.updateMatrixWorld();
|
|
324
|
+
const ray = new three$1.Raycaster();
|
|
325
|
+
ray.setFromCamera(new three$1.Vector2(u * 2 - 1, -(v * 2 - 1)), camera);
|
|
326
|
+
const visibleChain = (o) => {
|
|
327
|
+
for (let n = o; n; n = n.parent) if (!n.visible) return false;
|
|
328
|
+
return true;
|
|
329
|
+
};
|
|
330
|
+
for (const hit of ray.intersectObjects(scene.children, true)) {
|
|
331
|
+
if (!visibleChain(hit.object)) continue;
|
|
332
|
+
let name = "";
|
|
333
|
+
for (let n = hit.object; n && n !== scene; n = n.parent) if (n.name) {
|
|
334
|
+
name = n.name;
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
return { object: name, point: hit.point.toArray(), distance: hit.distance, object3d: hit.object };
|
|
338
|
+
}
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* `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
|
|
343
|
+
* 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
|
|
344
|
+
* 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).
|
|
345
|
+
*/
|
|
346
|
+
dragPlane(point, plane = "screen") {
|
|
347
|
+
const grabbed = new three$1.Vector3(...point);
|
|
348
|
+
let normal;
|
|
349
|
+
if (plane === "floor") normal = new three$1.Vector3(0, 1, 0);
|
|
350
|
+
else if (plane === "wall") normal = new three$1.Vector3(0, 0, 1);
|
|
351
|
+
else if (Array.isArray(plane)) normal = new three$1.Vector3(...plane).normalize();
|
|
352
|
+
else {
|
|
353
|
+
const turn = new three$1.Quaternion();
|
|
354
|
+
this._camera?.updateMatrixWorld();
|
|
355
|
+
this._camera?.getWorldQuaternion(turn);
|
|
356
|
+
normal = new three$1.Vector3(0, 0, 1).applyQuaternion(turn);
|
|
357
|
+
}
|
|
358
|
+
const surface = new three$1.Plane().setFromNormalAndCoplanarPoint(normal, grabbed);
|
|
359
|
+
return (u, v) => {
|
|
360
|
+
const scene = this._scene, camera = this._camera;
|
|
361
|
+
if (!scene || !camera) return null;
|
|
362
|
+
scene.updateMatrixWorld();
|
|
363
|
+
camera.updateMatrixWorld();
|
|
364
|
+
const ray = new three$1.Raycaster();
|
|
365
|
+
ray.setFromCamera(new three$1.Vector2(u * 2 - 1, -(v * 2 - 1)), camera);
|
|
366
|
+
const at = ray.ray.intersectPlane(surface, new three$1.Vector3());
|
|
367
|
+
if (!at) return null;
|
|
368
|
+
return { point: at.toArray(), delta: at.clone().sub(grabbed).toArray() };
|
|
369
|
+
};
|
|
370
|
+
}
|
|
311
371
|
/**
|
|
312
372
|
* 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
|
|
313
373
|
* 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.
|
|
@@ -399,6 +459,7 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
399
459
|
if (spec.followLights) {
|
|
400
460
|
const mirror = this._lightMirror ??= new LightMirror(scene, Math.max(ctx.width, ctx.height) * 2);
|
|
401
461
|
mirror.update(space.lights);
|
|
462
|
+
if (!this._warnedSpace.has("inverseSquare")) this._checkInverseSquare(space.lights, scene, spec.name);
|
|
402
463
|
if (mirror.castsShadows && !ctx.renderer.shadowMap.enabled) ctx.renderer.shadowMap.enabled = true;
|
|
403
464
|
}
|
|
404
465
|
if (spec.followFog) {
|
|
@@ -406,6 +467,23 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
406
467
|
(this._fogMirror ??= new FogMirror(scene)).update(space.fog);
|
|
407
468
|
}
|
|
408
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* An inverse-square light is held at full strength inside its `radius` by the composition; three's decay-2 light keeps rising (4x at half the radius, 11x at a third). When the scene has
|
|
472
|
+
* an object closer to such a light than 0.8 of its radius, say so once, with the way out. (The check is the scene's bounding box against the light's place: no object is measured.)
|
|
473
|
+
*/
|
|
474
|
+
_checkInverseSquare(lights, scene, name) {
|
|
475
|
+
const near = lights.filter((l) => l.falloff === "inverseSquare" && (l.kind === "point" || l.kind === "spot"));
|
|
476
|
+
if (!near.length) return;
|
|
477
|
+
const box = new three$1.Box3().setFromObject(scene);
|
|
478
|
+
if (box.isEmpty()) return;
|
|
479
|
+
for (const l of near) {
|
|
480
|
+
const d = box.distanceToPoint(new three$1.Vector3(l.x, -l.y, l.z));
|
|
481
|
+
if (d < 0.8 * l.radius) {
|
|
482
|
+
this._saidOnce("inverseSquare", `followLights: a light with falloff 'inverseSquare' and radius ${l.radius} is only ${Math.round(d)} px from the nearest part of the scene. The composition holds such a light at full strength inside its radius; three's inverse-square light keeps rising there (${Math.pow(l.radius / Math.max(d, 1), 2).toFixed(1)}x at that distance), so those parts come out much brighter. Make the radius smaller than that distance, or use falloff 'smooth' (it is fitted to the composition's curve)`, name);
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
409
487
|
/** followCamera shows the whole composition through the layer's picture: a layer of another shape would show it squeezed or cut. Said once at build. */
|
|
410
488
|
_checkFollowShape(width, height, name) {
|
|
411
489
|
const p = this.parent;
|
|
@@ -511,6 +589,7 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
511
589
|
}
|
|
512
590
|
_disposeRenderer() {
|
|
513
591
|
if (!this._renderer) return;
|
|
592
|
+
this._closing = true;
|
|
514
593
|
if (this._tracked) {
|
|
515
594
|
this._tracked = false;
|
|
516
595
|
releaseThree(this._gpu ? "webgpu" : "webgl");
|
|
@@ -549,7 +628,7 @@ var ThreeSequence = class extends chunk7EI2N7WO_cjs.Sequence {
|
|
|
549
628
|
function resolveDim(v, scope) {
|
|
550
629
|
if (v === void 0) return void 0;
|
|
551
630
|
if (typeof v === "number") return v;
|
|
552
|
-
return
|
|
631
|
+
return chunkX62H3RBG_cjs.evaluateExpr(v, scope);
|
|
553
632
|
}
|
|
554
633
|
async function threeGltf(url, options = {}) {
|
|
555
634
|
const label = "pixi-effects: threeGltf";
|
|
@@ -641,7 +720,7 @@ function registerThree(options = {}) {
|
|
|
641
720
|
const kind = options.renderer ?? "webgl";
|
|
642
721
|
checkRendererKind(kind, "registerThree's renderer");
|
|
643
722
|
setPageRenderer(kind);
|
|
644
|
-
|
|
723
|
+
chunkX62H3RBG_cjs.registerSequenceType("three", ThreeSequence);
|
|
645
724
|
}
|
|
646
725
|
function three(spec) {
|
|
647
726
|
return spec;
|