@clypra-studio/engine 0.1.2 → 1.0.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/dist/TransitionDefinition-CC6oSTYB.d.cts +158 -0
- package/dist/TransitionDefinition-CC6oSTYB.d.ts +158 -0
- package/dist/chunk-4Y7ZSGHJ.js +2990 -0
- package/dist/chunk-4Y7ZSGHJ.js.map +1 -0
- package/dist/chunk-AUMNXFYQ.js +667 -0
- package/dist/chunk-AUMNXFYQ.js.map +1 -0
- package/dist/{chunk-CJRH4PAV.js → chunk-LGW5SSLZ.js} +292 -61
- package/dist/chunk-LGW5SSLZ.js.map +1 -0
- package/dist/{chunk-EVQAI3P3.js → chunk-S24UVNPZ.js} +5 -1
- package/dist/{chunk-EVQAI3P3.js.map → chunk-S24UVNPZ.js.map} +1 -1
- package/dist/{index-BWo6qV_z.d.cts → index-BP1N8Yg7.d.cts} +2 -2
- package/dist/{index-BWo6qV_z.d.ts → index-BP1N8Yg7.d.ts} +2 -2
- package/dist/index.cjs +3882 -1366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +428 -3798
- package/dist/index.d.ts +428 -3798
- package/dist/index.js +1373 -1498
- package/dist/index.js.map +1 -1
- package/dist/textEffects/index.cjs.map +1 -1
- package/dist/textEffects/index.js +1 -1
- package/dist/transitions/index.cjs +2207 -3
- package/dist/transitions/index.cjs.map +1 -1
- package/dist/transitions/index.d.cts +54 -5
- package/dist/transitions/index.d.ts +54 -5
- package/dist/transitions/index.js +53 -3
- package/dist/v2/backends/index.cjs +246 -33
- package/dist/v2/backends/index.cjs.map +1 -1
- package/dist/v2/backends/index.d.cts +1 -1
- package/dist/v2/backends/index.d.ts +1 -1
- package/dist/v2/backends/index.js +1 -1
- package/dist/videoEffects/index.cjs +287 -62
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +31 -134
- package/dist/videoEffects/index.d.ts +31 -134
- package/dist/videoEffects/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-5JOAEDIQ.js +0 -446
- package/dist/chunk-5JOAEDIQ.js.map +0 -1
- package/dist/chunk-CJRH4PAV.js.map +0 -1
- package/dist/chunk-QMRMNH52.js +0 -811
- package/dist/chunk-QMRMNH52.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALL_TRANSITIONS,
|
|
3
|
+
ChromaticPushTransition,
|
|
4
|
+
CrossDissolveTransition,
|
|
5
|
+
DepthPushTransition,
|
|
6
|
+
DirectionalDissolveTransition,
|
|
7
|
+
ElasticSnapCutTransition,
|
|
8
|
+
FilmBurnWipeTransition,
|
|
9
|
+
FoldTurnTransition,
|
|
10
|
+
FrameHoldStutterTransition,
|
|
11
|
+
GlitchTransition,
|
|
12
|
+
GravityDropTransition,
|
|
13
|
+
IrisRevealTransition,
|
|
14
|
+
LightLeakSweepTransition,
|
|
15
|
+
LumaWipeTransition,
|
|
16
|
+
ParallaxLayerSplitTransition,
|
|
17
|
+
PixelateCollapseTransition,
|
|
18
|
+
PushTransition,
|
|
19
|
+
RackFocusBlendTransition,
|
|
20
|
+
RefractionWarpTransition,
|
|
21
|
+
ShatterBurstTransition,
|
|
22
|
+
StrobeCutTransition,
|
|
23
|
+
TRANSITION_CATEGORIES,
|
|
24
|
+
TRANSITION_PRESETS,
|
|
25
|
+
TransitionRenderer,
|
|
26
|
+
ZoomTransition,
|
|
27
|
+
getAllTransitionTags,
|
|
28
|
+
getAllTransitions,
|
|
29
|
+
getRecommendedDuration,
|
|
30
|
+
getTransitionById,
|
|
31
|
+
getTransitionByRenderer,
|
|
32
|
+
getTransitionCategories,
|
|
33
|
+
getTransitionCountByCategory,
|
|
34
|
+
getTransitionEffect,
|
|
35
|
+
getTransitionsByCategory,
|
|
36
|
+
getTransitionsByTags,
|
|
37
|
+
searchTransitions,
|
|
38
|
+
transitionEffects,
|
|
39
|
+
transitionEffectsById
|
|
40
|
+
} from "./chunk-4Y7ZSGHJ.js";
|
|
1
41
|
import {
|
|
2
42
|
COMPOSITION_PRESETS,
|
|
3
43
|
CUSTOM_ENGINE_IDS,
|
|
@@ -71,22 +111,7 @@ import {
|
|
|
71
111
|
syncCompositorFromScene,
|
|
72
112
|
textEffectConfigToScene,
|
|
73
113
|
wrapTextToWidth
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import {
|
|
76
|
-
TRANSITION_CATEGORIES,
|
|
77
|
-
TRANSITION_PRESETS,
|
|
78
|
-
TransitionRenderer,
|
|
79
|
-
getAllTransitionTags,
|
|
80
|
-
getAllTransitions,
|
|
81
|
-
getRecommendedDuration,
|
|
82
|
-
getTransitionById,
|
|
83
|
-
getTransitionByRenderer,
|
|
84
|
-
getTransitionCategories,
|
|
85
|
-
getTransitionCountByCategory,
|
|
86
|
-
getTransitionsByCategory,
|
|
87
|
-
getTransitionsByTags,
|
|
88
|
-
searchTransitions
|
|
89
|
-
} from "./chunk-QMRMNH52.js";
|
|
114
|
+
} from "./chunk-S24UVNPZ.js";
|
|
90
115
|
import {
|
|
91
116
|
EFFECTS_REGISTRY,
|
|
92
117
|
EffectEngine,
|
|
@@ -119,11 +144,12 @@ import {
|
|
|
119
144
|
searchEffects,
|
|
120
145
|
searchEffectsForApi,
|
|
121
146
|
withContext
|
|
122
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-LGW5SSLZ.js";
|
|
123
148
|
import {
|
|
124
149
|
ColorAdjustmentsEffect,
|
|
125
|
-
PixiRenderBackend
|
|
126
|
-
|
|
150
|
+
PixiRenderBackend,
|
|
151
|
+
hexToRgb
|
|
152
|
+
} from "./chunk-AUMNXFYQ.js";
|
|
127
153
|
import "./chunk-PZ5AY32C.js";
|
|
128
154
|
|
|
129
155
|
// src/validation.ts
|
|
@@ -1999,8 +2025,8 @@ function setLayerPos(layer, x, y) {
|
|
|
1999
2025
|
if (clone.ks?.p?.a === 0) clone.ks.p.k = [x, y, 0];
|
|
2000
2026
|
return clone;
|
|
2001
2027
|
}
|
|
2002
|
-
function addRoundedRect(
|
|
2003
|
-
let clone = JSON.parse(JSON.stringify(
|
|
2028
|
+
function addRoundedRect(lottie2, name, cx, cy, w, h, r, color) {
|
|
2029
|
+
let clone = JSON.parse(JSON.stringify(lottie2));
|
|
2004
2030
|
const [cr, cg, cb] = hex2lottie(color);
|
|
2005
2031
|
const shapeLayer = {
|
|
2006
2032
|
ty: 4,
|
|
@@ -4934,6 +4960,120 @@ var NeonGlowEffect = {
|
|
|
4934
4960
|
}
|
|
4935
4961
|
};
|
|
4936
4962
|
|
|
4963
|
+
// src/effects/light/HalationEffect.ts
|
|
4964
|
+
import { Filter as Filter4 } from "pixi.js";
|
|
4965
|
+
var HALATION_VERTEX_SHADER = `
|
|
4966
|
+
in vec2 aPosition;
|
|
4967
|
+
out vec2 vTextureCoord;
|
|
4968
|
+
|
|
4969
|
+
uniform vec4 uInputSize;
|
|
4970
|
+
uniform vec4 uOutputFrame;
|
|
4971
|
+
uniform vec4 uOutputTexture;
|
|
4972
|
+
|
|
4973
|
+
vec4 filterVertexPosition( void )
|
|
4974
|
+
{
|
|
4975
|
+
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
4976
|
+
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
4977
|
+
position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
4978
|
+
return vec4(position, 0.0, 1.0);
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4981
|
+
vec2 filterTextureCoord( void )
|
|
4982
|
+
{
|
|
4983
|
+
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4986
|
+
void main(void)
|
|
4987
|
+
{
|
|
4988
|
+
gl_Position = filterVertexPosition();
|
|
4989
|
+
vTextureCoord = filterTextureCoord();
|
|
4990
|
+
}
|
|
4991
|
+
`;
|
|
4992
|
+
var HALATION_FRAGMENT_SHADER = `
|
|
4993
|
+
in vec2 vTextureCoord;
|
|
4994
|
+
out vec4 finalColor;
|
|
4995
|
+
|
|
4996
|
+
uniform sampler2D uTexture;
|
|
4997
|
+
uniform vec3 uHalationColor; // warm tint, typically amber/orange
|
|
4998
|
+
uniform float uHalationThreshold; // 0.0 to 1.0, brightness above which halation starts
|
|
4999
|
+
uniform float uHalationIntensity; // 0.0 to 1.0
|
|
5000
|
+
|
|
5001
|
+
float brightness(vec3 c) {
|
|
5002
|
+
return dot(c, vec3(0.299, 0.587, 0.114));
|
|
5003
|
+
}
|
|
5004
|
+
|
|
5005
|
+
float glowAt(vec2 uv) {
|
|
5006
|
+
vec3 c = texture(uTexture, uv).rgb;
|
|
5007
|
+
return smoothstep(uHalationThreshold, 1.0, brightness(c));
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
void main() {
|
|
5011
|
+
vec4 color = texture(uTexture, vTextureCoord);
|
|
5012
|
+
|
|
5013
|
+
// Multi-sample approximation of a bloom/blur on bright areas.
|
|
5014
|
+
// 9-tap cross pattern at 4-texel radius avoids a full two-pass blur pipeline.
|
|
5015
|
+
vec2 texel = 1.0 / vec2(textureSize(uTexture, 0));
|
|
5016
|
+
float radius = 4.0;
|
|
5017
|
+
|
|
5018
|
+
float glowSum = glowAt(vTextureCoord);
|
|
5019
|
+
glowSum += glowAt(vTextureCoord + texel * vec2( radius, 0.0));
|
|
5020
|
+
glowSum += glowAt(vTextureCoord + texel * vec2(-radius, 0.0));
|
|
5021
|
+
glowSum += glowAt(vTextureCoord + texel * vec2( 0.0, radius));
|
|
5022
|
+
glowSum += glowAt(vTextureCoord + texel * vec2( 0.0, -radius));
|
|
5023
|
+
glowSum += glowAt(vTextureCoord + texel * vec2( radius, radius) * 0.707);
|
|
5024
|
+
glowSum += glowAt(vTextureCoord + texel * vec2(-radius, radius) * 0.707);
|
|
5025
|
+
glowSum += glowAt(vTextureCoord + texel * vec2( radius, -radius) * 0.707);
|
|
5026
|
+
glowSum += glowAt(vTextureCoord + texel * vec2(-radius, -radius) * 0.707);
|
|
5027
|
+
glowSum /= 9.0;
|
|
5028
|
+
|
|
5029
|
+
// Additively composite the colored glow on top of the base image
|
|
5030
|
+
color.rgb += uHalationColor * glowSum * uHalationIntensity;
|
|
5031
|
+
|
|
5032
|
+
finalColor = color;
|
|
5033
|
+
}
|
|
5034
|
+
`;
|
|
5035
|
+
var HalationEffect = {
|
|
5036
|
+
backend: "pixi",
|
|
5037
|
+
subtype: "filter",
|
|
5038
|
+
id: "halation",
|
|
5039
|
+
name: "Halation",
|
|
5040
|
+
category: "light",
|
|
5041
|
+
description: "Film halation \u2014 colored bloom (typically warm amber) around bright highlight areas. Chain after ColorAdjustmentsEffect. Only add when intensity > 0.",
|
|
5042
|
+
tags: ["halation", "bloom", "film", "glow", "highlight"],
|
|
5043
|
+
thumbnail: "",
|
|
5044
|
+
params: [
|
|
5045
|
+
{ key: "halationR", label: "Halation Color R", type: "range", value: 1, min: 0, max: 1, step: 0.01 },
|
|
5046
|
+
{ key: "halationG", label: "Halation Color G", type: "range", value: 0.53, min: 0, max: 1, step: 0.01 },
|
|
5047
|
+
{ key: "halationB", label: "Halation Color B", type: "range", value: 0.27, min: 0, max: 1, step: 0.01 },
|
|
5048
|
+
{ key: "halationThreshold", label: "Threshold", type: "range", value: 0.75, min: 0, max: 1, step: 0.01 },
|
|
5049
|
+
{ key: "halationIntensity", label: "Intensity", type: "range", value: 0, min: 0, max: 1, step: 0.01 }
|
|
5050
|
+
],
|
|
5051
|
+
filterSpec: {
|
|
5052
|
+
create(params) {
|
|
5053
|
+
return Filter4.from({
|
|
5054
|
+
gl: { vertex: HALATION_VERTEX_SHADER, fragment: HALATION_FRAGMENT_SHADER },
|
|
5055
|
+
clipToViewport: false,
|
|
5056
|
+
resources: {
|
|
5057
|
+
halationUniforms: {
|
|
5058
|
+
uHalationColor: { value: [params.halationR ?? 1, params.halationG ?? 0.53, params.halationB ?? 0.27], type: "vec3<f32>" },
|
|
5059
|
+
uHalationThreshold: { value: params.halationThreshold ?? 0.75, type: "f32" },
|
|
5060
|
+
uHalationIntensity: { value: params.halationIntensity || 0, type: "f32" }
|
|
5061
|
+
}
|
|
5062
|
+
}
|
|
5063
|
+
});
|
|
5064
|
+
},
|
|
5065
|
+
updateUniforms(filter, params) {
|
|
5066
|
+
const group = filter.resources?.halationUniforms;
|
|
5067
|
+
const uniforms = group?.uniforms;
|
|
5068
|
+
if (!uniforms) return;
|
|
5069
|
+
uniforms.uHalationColor = [params.halationR ?? 1, params.halationG ?? 0.53, params.halationB ?? 0.27];
|
|
5070
|
+
uniforms.uHalationThreshold = params.halationThreshold ?? 0.75;
|
|
5071
|
+
uniforms.uHalationIntensity = params.halationIntensity || 0;
|
|
5072
|
+
group?.update?.();
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5075
|
+
};
|
|
5076
|
+
|
|
4937
5077
|
// src/effects/glitch/RGBSplitEffect.ts
|
|
4938
5078
|
import { RGBSplitFilter } from "pixi-filters";
|
|
4939
5079
|
var RGBSplitEffect = {
|
|
@@ -4983,7 +5123,7 @@ var RGBSplitEffect = {
|
|
|
4983
5123
|
};
|
|
4984
5124
|
|
|
4985
5125
|
// src/effects/glitch/VHSEffect.ts
|
|
4986
|
-
import { Filter as
|
|
5126
|
+
import { Filter as Filter5, Graphics } from "pixi.js";
|
|
4987
5127
|
var DEFAULT_VERTEX_SHADER4 = `
|
|
4988
5128
|
in vec2 aPosition;
|
|
4989
5129
|
out vec2 vTextureCoord;
|
|
@@ -5066,7 +5206,7 @@ var VHSEffect = {
|
|
|
5066
5206
|
],
|
|
5067
5207
|
filterSpec: {
|
|
5068
5208
|
create(params) {
|
|
5069
|
-
return
|
|
5209
|
+
return Filter5.from({
|
|
5070
5210
|
gl: { vertex: DEFAULT_VERTEX_SHADER4, fragment: FRAGMENT_SHADER3 },
|
|
5071
5211
|
resources: {
|
|
5072
5212
|
uniforms: {
|
|
@@ -5247,7 +5387,7 @@ var StaticNoiseEffect = {
|
|
|
5247
5387
|
};
|
|
5248
5388
|
|
|
5249
5389
|
// src/effects/cinematic/FilmGrainEffect.ts
|
|
5250
|
-
import { Filter as
|
|
5390
|
+
import { Filter as Filter6 } from "pixi.js";
|
|
5251
5391
|
var DEFAULT_VERTEX_SHADER5 = `
|
|
5252
5392
|
in vec2 aPosition;
|
|
5253
5393
|
out vec2 vTextureCoord;
|
|
@@ -5315,7 +5455,7 @@ var FilmGrainEffect = {
|
|
|
5315
5455
|
],
|
|
5316
5456
|
filterSpec: {
|
|
5317
5457
|
create(params) {
|
|
5318
|
-
return
|
|
5458
|
+
return Filter6.from({
|
|
5319
5459
|
gl: { vertex: DEFAULT_VERTEX_SHADER5, fragment: FRAGMENT_SHADER4 },
|
|
5320
5460
|
resources: {
|
|
5321
5461
|
effectUniforms: {
|
|
@@ -5381,7 +5521,7 @@ var TiltShiftEffect = {
|
|
|
5381
5521
|
};
|
|
5382
5522
|
|
|
5383
5523
|
// src/effects/cinematic/CinematicLUTEffect.ts
|
|
5384
|
-
import { Filter as
|
|
5524
|
+
import { Filter as Filter7, ColorMatrixFilter as ColorMatrixFilter2, Texture } from "pixi.js";
|
|
5385
5525
|
var DEFAULT_VERTEX_SHADER6 = `
|
|
5386
5526
|
in vec2 aPosition;
|
|
5387
5527
|
out vec2 vTextureCoord;
|
|
@@ -5492,7 +5632,7 @@ var CinematicLUTEffect = {
|
|
|
5492
5632
|
matrixFilter.contrast(params.contrast, false);
|
|
5493
5633
|
matrixFilter.saturate(params.saturation, false);
|
|
5494
5634
|
const lutTexture = createCinematicLUTTexture();
|
|
5495
|
-
const lutFilter =
|
|
5635
|
+
const lutFilter = Filter7.from({
|
|
5496
5636
|
gl: { vertex: DEFAULT_VERTEX_SHADER6, fragment: LUT_FRAGMENT_SHADER },
|
|
5497
5637
|
resources: {
|
|
5498
5638
|
uLUT: lutTexture.source,
|
|
@@ -7679,45 +7819,59 @@ function getVideoEffect(id) {
|
|
|
7679
7819
|
return videoEffectsById[id];
|
|
7680
7820
|
}
|
|
7681
7821
|
|
|
7682
|
-
// src/effects/
|
|
7683
|
-
var
|
|
7684
|
-
id: "
|
|
7685
|
-
name: "
|
|
7822
|
+
// src/effects/body/neonOutline.ts
|
|
7823
|
+
var neonOutlineEffect = {
|
|
7824
|
+
id: "body.neon-outline",
|
|
7825
|
+
name: "Neon Outline",
|
|
7686
7826
|
version: "1.0.0",
|
|
7687
|
-
category: "
|
|
7688
|
-
description: "
|
|
7827
|
+
category: "body",
|
|
7828
|
+
description: "Glowing neon outline around the subject",
|
|
7689
7829
|
schema: {
|
|
7690
7830
|
parameters: {
|
|
7691
|
-
|
|
7692
|
-
type: "string",
|
|
7693
|
-
default: "linear",
|
|
7694
|
-
options: ["linear", "easeIn", "easeOut", "easeInOut", "smoothstep"],
|
|
7695
|
-
label: "Easing",
|
|
7696
|
-
description: "Transition timing curve"
|
|
7697
|
-
},
|
|
7698
|
-
fadeColor: {
|
|
7831
|
+
color: {
|
|
7699
7832
|
type: "color",
|
|
7700
|
-
default: "#
|
|
7701
|
-
label: "
|
|
7702
|
-
description: "
|
|
7833
|
+
default: "#00FFFF",
|
|
7834
|
+
label: "Outline Color",
|
|
7835
|
+
description: "Color of the neon glow"
|
|
7703
7836
|
},
|
|
7704
|
-
|
|
7705
|
-
type: "
|
|
7706
|
-
default:
|
|
7707
|
-
|
|
7708
|
-
|
|
7837
|
+
thickness: {
|
|
7838
|
+
type: "number",
|
|
7839
|
+
default: 4,
|
|
7840
|
+
min: 1,
|
|
7841
|
+
max: 20,
|
|
7842
|
+
step: 1,
|
|
7843
|
+
label: "Thickness",
|
|
7844
|
+
description: "Width of the outline in pixels"
|
|
7845
|
+
},
|
|
7846
|
+
intensity: {
|
|
7847
|
+
type: "number",
|
|
7848
|
+
default: 1,
|
|
7849
|
+
min: 0,
|
|
7850
|
+
max: 2,
|
|
7851
|
+
step: 0.1,
|
|
7852
|
+
label: "Glow Intensity",
|
|
7853
|
+
description: "Brightness of the glow effect"
|
|
7854
|
+
},
|
|
7855
|
+
softness: {
|
|
7856
|
+
type: "number",
|
|
7857
|
+
default: 0.5,
|
|
7858
|
+
min: 0,
|
|
7859
|
+
max: 1,
|
|
7860
|
+
step: 0.05,
|
|
7861
|
+
label: "Glow Softness",
|
|
7862
|
+
description: "How soft/blurred the glow appears"
|
|
7709
7863
|
}
|
|
7710
7864
|
},
|
|
7711
7865
|
inputs: {
|
|
7712
|
-
|
|
7866
|
+
source: {
|
|
7713
7867
|
type: "Texture",
|
|
7714
7868
|
required: true,
|
|
7715
|
-
label: "
|
|
7869
|
+
label: "Video Input"
|
|
7716
7870
|
},
|
|
7717
|
-
|
|
7871
|
+
mask: {
|
|
7718
7872
|
type: "Texture",
|
|
7719
7873
|
required: true,
|
|
7720
|
-
label: "
|
|
7874
|
+
label: "Mask (from feature provider)"
|
|
7721
7875
|
}
|
|
7722
7876
|
},
|
|
7723
7877
|
outputs: {
|
|
@@ -7729,1462 +7883,162 @@ var crossDissolveTransition = {
|
|
|
7729
7883
|
},
|
|
7730
7884
|
nodes: [
|
|
7731
7885
|
{
|
|
7732
|
-
id: "
|
|
7886
|
+
id: "input",
|
|
7733
7887
|
type: "Input",
|
|
7734
7888
|
params: {},
|
|
7735
7889
|
outputs: {
|
|
7736
|
-
|
|
7890
|
+
source: { type: "Texture" },
|
|
7891
|
+
mask: { type: "Texture" }
|
|
7737
7892
|
}
|
|
7738
7893
|
},
|
|
7894
|
+
// Edge Detection Pass
|
|
7739
7895
|
{
|
|
7740
|
-
id: "
|
|
7741
|
-
type: "
|
|
7742
|
-
params: {
|
|
7896
|
+
id: "edge-detect",
|
|
7897
|
+
type: "ShaderNode",
|
|
7898
|
+
params: {
|
|
7899
|
+
shader: `
|
|
7900
|
+
precision highp float;
|
|
7901
|
+
|
|
7902
|
+
uniform sampler2D uMask;
|
|
7903
|
+
uniform vec2 uResolution;
|
|
7904
|
+
uniform float uThickness;
|
|
7905
|
+
|
|
7906
|
+
varying vec2 vUv;
|
|
7907
|
+
|
|
7908
|
+
void main() {
|
|
7909
|
+
vec2 texelSize = 1.0 / uResolution;
|
|
7910
|
+
float step = uThickness;
|
|
7911
|
+
|
|
7912
|
+
// Sample mask in 3x3 grid (Sobel-like edge detection)
|
|
7913
|
+
float tl = texture2D(uMask, vUv + vec2(-step, step) * texelSize).a;
|
|
7914
|
+
float t = texture2D(uMask, vUv + vec2(0.0, step) * texelSize).a;
|
|
7915
|
+
float tr = texture2D(uMask, vUv + vec2(step, step) * texelSize).a;
|
|
7916
|
+
float l = texture2D(uMask, vUv + vec2(-step, 0.0) * texelSize).a;
|
|
7917
|
+
float c = texture2D(uMask, vUv).a;
|
|
7918
|
+
float r = texture2D(uMask, vUv + vec2(step, 0.0) * texelSize).a;
|
|
7919
|
+
float bl = texture2D(uMask, vUv + vec2(-step, -step) * texelSize).a;
|
|
7920
|
+
float b = texture2D(uMask, vUv + vec2(0.0, -step) * texelSize).a;
|
|
7921
|
+
float br = texture2D(uMask, vUv + vec2(step, -step) * texelSize).a;
|
|
7922
|
+
|
|
7923
|
+
// Sobel operators
|
|
7924
|
+
float gx = -tl - 2.0 * l - bl + tr + 2.0 * r + br;
|
|
7925
|
+
float gy = -tl - 2.0 * t - tr + bl + 2.0 * b + br;
|
|
7926
|
+
|
|
7927
|
+
// Edge magnitude
|
|
7928
|
+
float edge = sqrt(gx * gx + gy * gy);
|
|
7929
|
+
|
|
7930
|
+
// Threshold and normalize
|
|
7931
|
+
edge = smoothstep(0.1, 0.5, edge);
|
|
7932
|
+
|
|
7933
|
+
gl_FragColor = vec4(edge, edge, edge, edge);
|
|
7934
|
+
}
|
|
7935
|
+
`,
|
|
7936
|
+
uniforms: {
|
|
7937
|
+
uMask: { type: "Texture", value: "@input.mask" },
|
|
7938
|
+
uResolution: { type: "vec2", value: "resolution" },
|
|
7939
|
+
uThickness: { type: "float", value: "@params.thickness" }
|
|
7940
|
+
}
|
|
7941
|
+
},
|
|
7942
|
+
inputs: {
|
|
7943
|
+
mask: { type: "Texture" }
|
|
7944
|
+
},
|
|
7743
7945
|
outputs: {
|
|
7744
|
-
|
|
7946
|
+
edges: { type: "Texture" }
|
|
7745
7947
|
}
|
|
7746
7948
|
},
|
|
7949
|
+
// Horizontal Blur Pass
|
|
7747
7950
|
{
|
|
7748
|
-
id: "
|
|
7951
|
+
id: "blur-h",
|
|
7749
7952
|
type: "ShaderNode",
|
|
7750
7953
|
params: {
|
|
7751
7954
|
shader: `
|
|
7752
7955
|
precision highp float;
|
|
7753
7956
|
|
|
7754
|
-
uniform sampler2D
|
|
7755
|
-
uniform
|
|
7756
|
-
uniform float
|
|
7757
|
-
uniform float uEasing;
|
|
7758
|
-
uniform vec3 uFadeColor;
|
|
7759
|
-
uniform float uUseFadeColor;
|
|
7957
|
+
uniform sampler2D uEdges;
|
|
7958
|
+
uniform vec2 uResolution;
|
|
7959
|
+
uniform float uSoftness;
|
|
7760
7960
|
|
|
7761
7961
|
varying vec2 vUv;
|
|
7762
7962
|
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7963
|
+
void main() {
|
|
7964
|
+
vec2 texelSize = 1.0 / uResolution;
|
|
7965
|
+
float blur = 0.0;
|
|
7966
|
+
|
|
7967
|
+
// Gaussian blur weights
|
|
7968
|
+
float weights[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
|
7969
|
+
float radius = 4.0 * uSoftness;
|
|
7970
|
+
|
|
7971
|
+
blur += texture2D(uEdges, vUv).r * weights[0];
|
|
7972
|
+
|
|
7973
|
+
for (int i = 1; i < 5; i++) {
|
|
7974
|
+
float offset = float(i) * radius;
|
|
7975
|
+
blur += texture2D(uEdges, vUv + vec2(offset * texelSize.x, 0.0)).r * weights[i];
|
|
7976
|
+
blur += texture2D(uEdges, vUv - vec2(offset * texelSize.x, 0.0)).r * weights[i];
|
|
7977
|
+
}
|
|
7978
|
+
|
|
7979
|
+
gl_FragColor = vec4(blur, blur, blur, blur);
|
|
7774
7980
|
}
|
|
7981
|
+
`,
|
|
7982
|
+
uniforms: {
|
|
7983
|
+
uEdges: { type: "Texture", value: "@edge-detect.edges" },
|
|
7984
|
+
uResolution: { type: "vec2", value: "resolution" },
|
|
7985
|
+
uSoftness: { type: "float", value: "@params.softness" }
|
|
7986
|
+
}
|
|
7987
|
+
},
|
|
7988
|
+
inputs: {
|
|
7989
|
+
edges: { type: "Texture" }
|
|
7990
|
+
},
|
|
7991
|
+
outputs: {
|
|
7992
|
+
blurredH: { type: "Texture" }
|
|
7993
|
+
}
|
|
7994
|
+
},
|
|
7995
|
+
// Vertical Blur Pass
|
|
7996
|
+
{
|
|
7997
|
+
id: "blur-v",
|
|
7998
|
+
type: "ShaderNode",
|
|
7999
|
+
params: {
|
|
8000
|
+
shader: `
|
|
8001
|
+
precision highp float;
|
|
7775
8002
|
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
8003
|
+
uniform sampler2D uBlurredH;
|
|
8004
|
+
uniform vec2 uResolution;
|
|
8005
|
+
uniform float uSoftness;
|
|
7779
8006
|
|
|
7780
|
-
|
|
7781
|
-
if (easingType < 0.5) return t; // linear
|
|
7782
|
-
if (easingType < 1.5) return easeIn(t);
|
|
7783
|
-
if (easingType < 2.5) return easeOut(t);
|
|
7784
|
-
if (easingType < 3.5) return easeInOut(t);
|
|
7785
|
-
return smoothstep(t);
|
|
7786
|
-
}
|
|
8007
|
+
varying vec2 vUv;
|
|
7787
8008
|
|
|
7788
8009
|
void main() {
|
|
7789
|
-
|
|
8010
|
+
vec2 texelSize = 1.0 / uResolution;
|
|
8011
|
+
float blur = 0.0;
|
|
7790
8012
|
|
|
7791
|
-
|
|
7792
|
-
|
|
8013
|
+
// Gaussian blur weights
|
|
8014
|
+
float weights[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
|
8015
|
+
float radius = 4.0 * uSoftness;
|
|
7793
8016
|
|
|
7794
|
-
|
|
8017
|
+
blur += texture2D(uBlurredH, vUv).r * weights[0];
|
|
7795
8018
|
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
float fadeOut = t * 2.0;
|
|
7801
|
-
result = mix(colorA, vec4(uFadeColor, 1.0), fadeOut);
|
|
7802
|
-
} else {
|
|
7803
|
-
// Fade color to B
|
|
7804
|
-
float fadeIn = (t - 0.5) * 2.0;
|
|
7805
|
-
result = mix(vec4(uFadeColor, 1.0), colorB, fadeIn);
|
|
7806
|
-
}
|
|
7807
|
-
} else {
|
|
7808
|
-
// Direct blend
|
|
7809
|
-
result = mix(colorA, colorB, t);
|
|
8019
|
+
for (int i = 1; i < 5; i++) {
|
|
8020
|
+
float offset = float(i) * radius;
|
|
8021
|
+
blur += texture2D(uBlurredH, vUv + vec2(0.0, offset * texelSize.y)).r * weights[i];
|
|
8022
|
+
blur += texture2D(uBlurredH, vUv - vec2(0.0, offset * texelSize.y)).r * weights[i];
|
|
7810
8023
|
}
|
|
7811
8024
|
|
|
7812
|
-
gl_FragColor =
|
|
8025
|
+
gl_FragColor = vec4(blur, blur, blur, blur);
|
|
7813
8026
|
}
|
|
7814
8027
|
`,
|
|
7815
8028
|
uniforms: {
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
uEasing: { type: "float", value: "@params.easing === 'easeIn' ? 1.0 : @params.easing === 'easeOut' ? 2.0 : @params.easing === 'easeInOut' ? 3.0 : @params.easing === 'smoothstep' ? 4.0 : 0.0" },
|
|
7820
|
-
uFadeColor: { type: "vec3", value: "@params.fadeColor" },
|
|
7821
|
-
uUseFadeColor: { type: "float", value: "@params.useFadeColor ? 1.0 : 0.0" }
|
|
8029
|
+
uBlurredH: { type: "Texture", value: "@blur-h.blurredH" },
|
|
8030
|
+
uResolution: { type: "vec2", value: "resolution" },
|
|
8031
|
+
uSoftness: { type: "float", value: "@params.softness" }
|
|
7822
8032
|
}
|
|
7823
8033
|
},
|
|
7824
8034
|
inputs: {
|
|
7825
|
-
|
|
7826
|
-
clipB: { type: "Texture" }
|
|
8035
|
+
blurredH: { type: "Texture" }
|
|
7827
8036
|
},
|
|
7828
8037
|
outputs: {
|
|
7829
|
-
|
|
8038
|
+
glow: { type: "Texture" }
|
|
7830
8039
|
}
|
|
7831
8040
|
},
|
|
7832
|
-
|
|
7833
|
-
id: "output",
|
|
7834
|
-
type: "Output",
|
|
7835
|
-
params: {},
|
|
7836
|
-
inputs: {
|
|
7837
|
-
result: { type: "Texture" }
|
|
7838
|
-
}
|
|
7839
|
-
}
|
|
7840
|
-
],
|
|
7841
|
-
edges: [
|
|
7842
|
-
{ from: "inputA", fromPin: "clipA", to: "dissolve", toPin: "clipA" },
|
|
7843
|
-
{ from: "inputB", fromPin: "clipB", to: "dissolve", toPin: "clipB" },
|
|
7844
|
-
{ from: "dissolve", fromPin: "result", to: "output", toPin: "result" }
|
|
7845
|
-
],
|
|
7846
|
-
metadata: {
|
|
7847
|
-
author: "Clypra Studio",
|
|
7848
|
-
tags: ["transition", "blend", "dissolve", "fade", "alpha"],
|
|
7849
|
-
thumbnail: "cross-dissolve-thumb.png",
|
|
7850
|
-
previewVideo: "cross-dissolve-preview.mp4"
|
|
7851
|
-
},
|
|
7852
|
-
capabilities: {
|
|
7853
|
-
temporal: true,
|
|
7854
|
-
stateful: false,
|
|
7855
|
-
spatial: false,
|
|
7856
|
-
geometry: false,
|
|
7857
|
-
inputsCount: 2
|
|
7858
|
-
},
|
|
7859
|
-
requirements: {
|
|
7860
|
-
temporalRadius: 0,
|
|
7861
|
-
preferredPrecision: "fp16",
|
|
7862
|
-
multipass: false,
|
|
7863
|
-
supportsHalfResolution: false
|
|
7864
|
-
},
|
|
7865
|
-
presets: [
|
|
7866
|
-
{
|
|
7867
|
-
id: "linear-dissolve",
|
|
7868
|
-
name: "Linear Dissolve",
|
|
7869
|
-
description: "Constant speed blend",
|
|
7870
|
-
parameters: {
|
|
7871
|
-
easing: "linear",
|
|
7872
|
-
fadeColor: "#000000",
|
|
7873
|
-
useFadeColor: false
|
|
7874
|
-
}
|
|
7875
|
-
},
|
|
7876
|
-
{
|
|
7877
|
-
id: "smooth-dissolve",
|
|
7878
|
-
name: "Smooth Dissolve",
|
|
7879
|
-
description: "Natural eased transition",
|
|
7880
|
-
parameters: {
|
|
7881
|
-
easing: "smoothstep",
|
|
7882
|
-
fadeColor: "#000000",
|
|
7883
|
-
useFadeColor: false
|
|
7884
|
-
}
|
|
7885
|
-
},
|
|
7886
|
-
{
|
|
7887
|
-
id: "fade-to-black",
|
|
7888
|
-
name: "Fade to Black",
|
|
7889
|
-
description: "Classic fade through black",
|
|
7890
|
-
parameters: {
|
|
7891
|
-
easing: "linear",
|
|
7892
|
-
fadeColor: "#000000",
|
|
7893
|
-
useFadeColor: true
|
|
7894
|
-
}
|
|
7895
|
-
},
|
|
7896
|
-
{
|
|
7897
|
-
id: "fade-to-white",
|
|
7898
|
-
name: "Fade to White",
|
|
7899
|
-
description: "Bright transition through white",
|
|
7900
|
-
parameters: {
|
|
7901
|
-
easing: "smoothstep",
|
|
7902
|
-
fadeColor: "#FFFFFF",
|
|
7903
|
-
useFadeColor: true
|
|
7904
|
-
}
|
|
7905
|
-
}
|
|
7906
|
-
]
|
|
7907
|
-
};
|
|
7908
|
-
|
|
7909
|
-
// src/effects/transitions/push.ts
|
|
7910
|
-
var pushTransition = {
|
|
7911
|
-
id: "transition.push",
|
|
7912
|
-
name: "Push",
|
|
7913
|
-
version: "1.0.0",
|
|
7914
|
-
category: "transition",
|
|
7915
|
-
description: "One clip pushes the other off screen",
|
|
7916
|
-
schema: {
|
|
7917
|
-
parameters: {
|
|
7918
|
-
direction: {
|
|
7919
|
-
type: "string",
|
|
7920
|
-
default: "left",
|
|
7921
|
-
options: ["left", "right", "up", "down"],
|
|
7922
|
-
label: "Direction",
|
|
7923
|
-
description: "Direction to push"
|
|
7924
|
-
},
|
|
7925
|
-
easing: {
|
|
7926
|
-
type: "string",
|
|
7927
|
-
default: "easeInOut",
|
|
7928
|
-
options: ["linear", "easeIn", "easeOut", "easeInOut"],
|
|
7929
|
-
label: "Easing",
|
|
7930
|
-
description: "Transition timing curve"
|
|
7931
|
-
}
|
|
7932
|
-
},
|
|
7933
|
-
inputs: {
|
|
7934
|
-
clipA: {
|
|
7935
|
-
type: "Texture",
|
|
7936
|
-
required: true,
|
|
7937
|
-
label: "Clip A (Outgoing)"
|
|
7938
|
-
},
|
|
7939
|
-
clipB: {
|
|
7940
|
-
type: "Texture",
|
|
7941
|
-
required: true,
|
|
7942
|
-
label: "Clip B (Incoming)"
|
|
7943
|
-
}
|
|
7944
|
-
},
|
|
7945
|
-
outputs: {
|
|
7946
|
-
result: {
|
|
7947
|
-
type: "Texture",
|
|
7948
|
-
label: "Output"
|
|
7949
|
-
}
|
|
7950
|
-
}
|
|
7951
|
-
},
|
|
7952
|
-
nodes: [
|
|
7953
|
-
{
|
|
7954
|
-
id: "inputA",
|
|
7955
|
-
type: "Input",
|
|
7956
|
-
params: {},
|
|
7957
|
-
outputs: {
|
|
7958
|
-
clipA: { type: "Texture" }
|
|
7959
|
-
}
|
|
7960
|
-
},
|
|
7961
|
-
{
|
|
7962
|
-
id: "inputB",
|
|
7963
|
-
type: "Input",
|
|
7964
|
-
params: {},
|
|
7965
|
-
outputs: {
|
|
7966
|
-
clipB: { type: "Texture" }
|
|
7967
|
-
}
|
|
7968
|
-
},
|
|
7969
|
-
{
|
|
7970
|
-
id: "push",
|
|
7971
|
-
type: "ShaderNode",
|
|
7972
|
-
params: {
|
|
7973
|
-
shader: `
|
|
7974
|
-
precision highp float;
|
|
7975
|
-
|
|
7976
|
-
uniform sampler2D uClipA;
|
|
7977
|
-
uniform sampler2D uClipB;
|
|
7978
|
-
uniform float uProgress;
|
|
7979
|
-
uniform float uDirection; // 0=left, 1=right, 2=up, 3=down
|
|
7980
|
-
uniform float uEasing;
|
|
7981
|
-
|
|
7982
|
-
varying vec2 vUv;
|
|
7983
|
-
|
|
7984
|
-
// Easing functions
|
|
7985
|
-
float easeIn(float t) {
|
|
7986
|
-
return t * t;
|
|
7987
|
-
}
|
|
7988
|
-
|
|
7989
|
-
float easeOut(float t) {
|
|
7990
|
-
return t * (2.0 - t);
|
|
7991
|
-
}
|
|
7992
|
-
|
|
7993
|
-
float easeInOut(float t) {
|
|
7994
|
-
return t < 0.5 ? 2.0 * t * t : -1.0 + (4.0 - 2.0 * t) * t;
|
|
7995
|
-
}
|
|
7996
|
-
|
|
7997
|
-
float applyEasing(float t, float easingType) {
|
|
7998
|
-
if (easingType < 0.5) return t; // linear
|
|
7999
|
-
if (easingType < 1.5) return easeIn(t);
|
|
8000
|
-
if (easingType < 2.5) return easeOut(t);
|
|
8001
|
-
return easeInOut(t);
|
|
8002
|
-
}
|
|
8003
|
-
|
|
8004
|
-
void main() {
|
|
8005
|
-
float t = applyEasing(uProgress, uEasing);
|
|
8006
|
-
vec2 uv = vUv;
|
|
8007
|
-
|
|
8008
|
-
// Calculate offset based on direction
|
|
8009
|
-
vec2 offsetA = vec2(0.0);
|
|
8010
|
-
vec2 offsetB = vec2(0.0);
|
|
8011
|
-
|
|
8012
|
-
if (uDirection < 0.5) {
|
|
8013
|
-
// Push left
|
|
8014
|
-
offsetA = vec2(-t, 0.0);
|
|
8015
|
-
offsetB = vec2(1.0 - t, 0.0);
|
|
8016
|
-
} else if (uDirection < 1.5) {
|
|
8017
|
-
// Push right
|
|
8018
|
-
offsetA = vec2(t, 0.0);
|
|
8019
|
-
offsetB = vec2(-1.0 + t, 0.0);
|
|
8020
|
-
} else if (uDirection < 2.5) {
|
|
8021
|
-
// Push up
|
|
8022
|
-
offsetA = vec2(0.0, -t);
|
|
8023
|
-
offsetB = vec2(0.0, 1.0 - t);
|
|
8024
|
-
} else {
|
|
8025
|
-
// Push down
|
|
8026
|
-
offsetA = vec2(0.0, t);
|
|
8027
|
-
offsetB = vec2(0.0, -1.0 + t);
|
|
8028
|
-
}
|
|
8029
|
-
|
|
8030
|
-
vec2 uvA = uv + offsetA;
|
|
8031
|
-
vec2 uvB = uv + offsetB;
|
|
8032
|
-
|
|
8033
|
-
vec4 color;
|
|
8034
|
-
|
|
8035
|
-
// Check which clip is visible at this UV coordinate
|
|
8036
|
-
if (uvA.x >= 0.0 && uvA.x <= 1.0 && uvA.y >= 0.0 && uvA.y <= 1.0) {
|
|
8037
|
-
color = texture2D(uClipA, uvA);
|
|
8038
|
-
} else if (uvB.x >= 0.0 && uvB.x <= 1.0 && uvB.y >= 0.0 && uvB.y <= 1.0) {
|
|
8039
|
-
color = texture2D(uClipB, uvB);
|
|
8040
|
-
} else {
|
|
8041
|
-
color = vec4(0.0, 0.0, 0.0, 1.0);
|
|
8042
|
-
}
|
|
8043
|
-
|
|
8044
|
-
gl_FragColor = color;
|
|
8045
|
-
}
|
|
8046
|
-
`,
|
|
8047
|
-
uniforms: {
|
|
8048
|
-
uClipA: { type: "Texture", value: "@inputA.clipA" },
|
|
8049
|
-
uClipB: { type: "Texture", value: "@inputB.clipB" },
|
|
8050
|
-
uProgress: { type: "float", value: "progress" },
|
|
8051
|
-
uDirection: { type: "float", value: "@params.direction === 'left' ? 0.0 : @params.direction === 'right' ? 1.0 : @params.direction === 'up' ? 2.0 : 3.0" },
|
|
8052
|
-
uEasing: { type: "float", value: "@params.easing === 'easeIn' ? 1.0 : @params.easing === 'easeOut' ? 2.0 : @params.easing === 'easeInOut' ? 3.0 : 0.0" }
|
|
8053
|
-
}
|
|
8054
|
-
},
|
|
8055
|
-
inputs: {
|
|
8056
|
-
clipA: { type: "Texture" },
|
|
8057
|
-
clipB: { type: "Texture" }
|
|
8058
|
-
},
|
|
8059
|
-
outputs: {
|
|
8060
|
-
result: { type: "Texture" }
|
|
8061
|
-
}
|
|
8062
|
-
},
|
|
8063
|
-
{
|
|
8064
|
-
id: "output",
|
|
8065
|
-
type: "Output",
|
|
8066
|
-
params: {},
|
|
8067
|
-
inputs: {
|
|
8068
|
-
result: { type: "Texture" }
|
|
8069
|
-
}
|
|
8070
|
-
}
|
|
8071
|
-
],
|
|
8072
|
-
edges: [
|
|
8073
|
-
{ from: "inputA", fromPin: "clipA", to: "push", toPin: "clipA" },
|
|
8074
|
-
{ from: "inputB", fromPin: "clipB", to: "push", toPin: "clipB" },
|
|
8075
|
-
{ from: "push", fromPin: "result", to: "output", toPin: "result" }
|
|
8076
|
-
],
|
|
8077
|
-
metadata: {
|
|
8078
|
-
author: "Clypra Studio",
|
|
8079
|
-
tags: ["transition", "push", "slide", "spatial", "directional"],
|
|
8080
|
-
thumbnail: "push-thumb.png",
|
|
8081
|
-
previewVideo: "push-preview.mp4"
|
|
8082
|
-
},
|
|
8083
|
-
capabilities: {
|
|
8084
|
-
temporal: true,
|
|
8085
|
-
stateful: false,
|
|
8086
|
-
spatial: true,
|
|
8087
|
-
geometry: false,
|
|
8088
|
-
inputsCount: 2
|
|
8089
|
-
},
|
|
8090
|
-
requirements: {
|
|
8091
|
-
temporalRadius: 0,
|
|
8092
|
-
preferredPrecision: "fp16",
|
|
8093
|
-
multipass: false,
|
|
8094
|
-
supportsHalfResolution: false
|
|
8095
|
-
},
|
|
8096
|
-
presets: [
|
|
8097
|
-
{
|
|
8098
|
-
id: "push-left",
|
|
8099
|
-
name: "Push Left",
|
|
8100
|
-
description: "Push old clip to the left",
|
|
8101
|
-
parameters: {
|
|
8102
|
-
direction: "left",
|
|
8103
|
-
easing: "easeInOut"
|
|
8104
|
-
}
|
|
8105
|
-
},
|
|
8106
|
-
{
|
|
8107
|
-
id: "push-right",
|
|
8108
|
-
name: "Push Right",
|
|
8109
|
-
description: "Push old clip to the right",
|
|
8110
|
-
parameters: {
|
|
8111
|
-
direction: "right",
|
|
8112
|
-
easing: "easeInOut"
|
|
8113
|
-
}
|
|
8114
|
-
},
|
|
8115
|
-
{
|
|
8116
|
-
id: "push-up",
|
|
8117
|
-
name: "Push Up",
|
|
8118
|
-
description: "Push old clip upward",
|
|
8119
|
-
parameters: {
|
|
8120
|
-
direction: "up",
|
|
8121
|
-
easing: "easeInOut"
|
|
8122
|
-
}
|
|
8123
|
-
},
|
|
8124
|
-
{
|
|
8125
|
-
id: "push-down",
|
|
8126
|
-
name: "Push Down",
|
|
8127
|
-
description: "Push old clip downward",
|
|
8128
|
-
parameters: {
|
|
8129
|
-
direction: "down",
|
|
8130
|
-
easing: "easeInOut"
|
|
8131
|
-
}
|
|
8132
|
-
}
|
|
8133
|
-
]
|
|
8134
|
-
};
|
|
8135
|
-
|
|
8136
|
-
// src/effects/transitions/zoom.ts
|
|
8137
|
-
var zoomTransition = {
|
|
8138
|
-
id: "transition.zoom",
|
|
8139
|
-
name: "Zoom",
|
|
8140
|
-
version: "1.0.0",
|
|
8141
|
-
category: "transition",
|
|
8142
|
-
description: "Zoom in or out while transitioning between clips",
|
|
8143
|
-
schema: {
|
|
8144
|
-
parameters: {
|
|
8145
|
-
direction: {
|
|
8146
|
-
type: "string",
|
|
8147
|
-
default: "in",
|
|
8148
|
-
options: ["in", "out"],
|
|
8149
|
-
label: "Direction",
|
|
8150
|
-
description: "Zoom direction"
|
|
8151
|
-
},
|
|
8152
|
-
intensity: {
|
|
8153
|
-
type: "number",
|
|
8154
|
-
default: 0.5,
|
|
8155
|
-
min: 0,
|
|
8156
|
-
max: 2,
|
|
8157
|
-
step: 0.1,
|
|
8158
|
-
label: "Intensity",
|
|
8159
|
-
description: "Zoom amount"
|
|
8160
|
-
},
|
|
8161
|
-
easing: {
|
|
8162
|
-
type: "string",
|
|
8163
|
-
default: "easeInOut",
|
|
8164
|
-
options: ["linear", "easeIn", "easeOut", "easeInOut"],
|
|
8165
|
-
label: "Easing",
|
|
8166
|
-
description: "Transition timing curve"
|
|
8167
|
-
},
|
|
8168
|
-
blur: {
|
|
8169
|
-
type: "boolean",
|
|
8170
|
-
default: true,
|
|
8171
|
-
label: "Motion Blur",
|
|
8172
|
-
description: "Add blur during zoom"
|
|
8173
|
-
}
|
|
8174
|
-
},
|
|
8175
|
-
inputs: {
|
|
8176
|
-
clipA: {
|
|
8177
|
-
type: "Texture",
|
|
8178
|
-
required: true,
|
|
8179
|
-
label: "Clip A (Outgoing)"
|
|
8180
|
-
},
|
|
8181
|
-
clipB: {
|
|
8182
|
-
type: "Texture",
|
|
8183
|
-
required: true,
|
|
8184
|
-
label: "Clip B (Incoming)"
|
|
8185
|
-
}
|
|
8186
|
-
},
|
|
8187
|
-
outputs: {
|
|
8188
|
-
result: {
|
|
8189
|
-
type: "Texture",
|
|
8190
|
-
label: "Output"
|
|
8191
|
-
}
|
|
8192
|
-
}
|
|
8193
|
-
},
|
|
8194
|
-
nodes: [
|
|
8195
|
-
{
|
|
8196
|
-
id: "inputA",
|
|
8197
|
-
type: "Input",
|
|
8198
|
-
params: {},
|
|
8199
|
-
outputs: {
|
|
8200
|
-
clipA: { type: "Texture" }
|
|
8201
|
-
}
|
|
8202
|
-
},
|
|
8203
|
-
{
|
|
8204
|
-
id: "inputB",
|
|
8205
|
-
type: "Input",
|
|
8206
|
-
params: {},
|
|
8207
|
-
outputs: {
|
|
8208
|
-
clipB: { type: "Texture" }
|
|
8209
|
-
}
|
|
8210
|
-
},
|
|
8211
|
-
{
|
|
8212
|
-
id: "zoom",
|
|
8213
|
-
type: "ShaderNode",
|
|
8214
|
-
params: {
|
|
8215
|
-
shader: `
|
|
8216
|
-
precision highp float;
|
|
8217
|
-
|
|
8218
|
-
uniform sampler2D uClipA;
|
|
8219
|
-
uniform sampler2D uClipB;
|
|
8220
|
-
uniform float uProgress;
|
|
8221
|
-
uniform float uDirection; // 0=in, 1=out
|
|
8222
|
-
uniform float uIntensity;
|
|
8223
|
-
uniform float uEasing;
|
|
8224
|
-
uniform float uBlur;
|
|
8225
|
-
|
|
8226
|
-
varying vec2 vUv;
|
|
8227
|
-
|
|
8228
|
-
// Easing functions
|
|
8229
|
-
float easeIn(float t) {
|
|
8230
|
-
return t * t;
|
|
8231
|
-
}
|
|
8232
|
-
|
|
8233
|
-
float easeOut(float t) {
|
|
8234
|
-
return t * (2.0 - t);
|
|
8235
|
-
}
|
|
8236
|
-
|
|
8237
|
-
float easeInOut(float t) {
|
|
8238
|
-
return t < 0.5 ? 2.0 * t * t : -1.0 + (4.0 - 2.0 * t) * t;
|
|
8239
|
-
}
|
|
8240
|
-
|
|
8241
|
-
float applyEasing(float t, float easingType) {
|
|
8242
|
-
if (easingType < 0.5) return t; // linear
|
|
8243
|
-
if (easingType < 1.5) return easeIn(t);
|
|
8244
|
-
if (easingType < 2.5) return easeOut(t);
|
|
8245
|
-
return easeInOut(t);
|
|
8246
|
-
}
|
|
8247
|
-
|
|
8248
|
-
vec4 sampleWithBlur(sampler2D tex, vec2 uv, float blurAmount) {
|
|
8249
|
-
if (uBlur < 0.5 || blurAmount < 0.01) {
|
|
8250
|
-
return texture2D(tex, uv);
|
|
8251
|
-
}
|
|
8252
|
-
|
|
8253
|
-
// Simple 5-tap blur
|
|
8254
|
-
vec4 color = vec4(0.0);
|
|
8255
|
-
float offset = blurAmount * 0.01;
|
|
8256
|
-
|
|
8257
|
-
color += texture2D(tex, uv) * 0.4;
|
|
8258
|
-
color += texture2D(tex, uv + vec2(offset, 0.0)) * 0.15;
|
|
8259
|
-
color += texture2D(tex, uv - vec2(offset, 0.0)) * 0.15;
|
|
8260
|
-
color += texture2D(tex, uv + vec2(0.0, offset)) * 0.15;
|
|
8261
|
-
color += texture2D(tex, uv - vec2(0.0, offset)) * 0.15;
|
|
8262
|
-
|
|
8263
|
-
return color;
|
|
8264
|
-
}
|
|
8265
|
-
|
|
8266
|
-
void main() {
|
|
8267
|
-
float t = applyEasing(uProgress, uEasing);
|
|
8268
|
-
vec2 center = vec2(0.5, 0.5);
|
|
8269
|
-
|
|
8270
|
-
// Calculate zoom scales
|
|
8271
|
-
float scaleA, scaleB;
|
|
8272
|
-
|
|
8273
|
-
if (uDirection < 0.5) {
|
|
8274
|
-
// Zoom in: A shrinks, B grows from small
|
|
8275
|
-
scaleA = 1.0 + t * uIntensity;
|
|
8276
|
-
scaleB = 1.0 - (1.0 - t) * uIntensity;
|
|
8277
|
-
} else {
|
|
8278
|
-
// Zoom out: A grows, B shrinks to small
|
|
8279
|
-
scaleA = 1.0 - t * uIntensity * 0.5;
|
|
8280
|
-
scaleB = 1.0 + (1.0 - t) * uIntensity;
|
|
8281
|
-
}
|
|
8282
|
-
|
|
8283
|
-
// Apply zoom
|
|
8284
|
-
vec2 uvA = (vUv - center) / scaleA + center;
|
|
8285
|
-
vec2 uvB = (vUv - center) / scaleB + center;
|
|
8286
|
-
|
|
8287
|
-
// Blur amount based on zoom speed
|
|
8288
|
-
float blurAmountA = abs(scaleA - 1.0) * 2.0;
|
|
8289
|
-
float blurAmountB = abs(scaleB - 1.0) * 2.0;
|
|
8290
|
-
|
|
8291
|
-
// Sample with optional blur
|
|
8292
|
-
vec4 colorA = sampleWithBlur(uClipA, uvA, blurAmountA);
|
|
8293
|
-
vec4 colorB = sampleWithBlur(uClipB, uvB, blurAmountB);
|
|
8294
|
-
|
|
8295
|
-
// Handle out-of-bounds UVs
|
|
8296
|
-
if (uvA.x < 0.0 || uvA.x > 1.0 || uvA.y < 0.0 || uvA.y > 1.0) {
|
|
8297
|
-
colorA = vec4(0.0);
|
|
8298
|
-
}
|
|
8299
|
-
if (uvB.x < 0.0 || uvB.x > 1.0 || uvB.y < 0.0 || uvB.y > 1.0) {
|
|
8300
|
-
colorB = vec4(0.0);
|
|
8301
|
-
}
|
|
8302
|
-
|
|
8303
|
-
// Blend
|
|
8304
|
-
vec4 color = mix(colorA, colorB, t);
|
|
8305
|
-
|
|
8306
|
-
gl_FragColor = color;
|
|
8307
|
-
}
|
|
8308
|
-
`,
|
|
8309
|
-
uniforms: {
|
|
8310
|
-
uClipA: { type: "Texture", value: "@inputA.clipA" },
|
|
8311
|
-
uClipB: { type: "Texture", value: "@inputB.clipB" },
|
|
8312
|
-
uProgress: { type: "float", value: "progress" },
|
|
8313
|
-
uDirection: { type: "float", value: "@params.direction === 'in' ? 0.0 : 1.0" },
|
|
8314
|
-
uIntensity: { type: "float", value: "@params.intensity" },
|
|
8315
|
-
uEasing: { type: "float", value: "@params.easing === 'easeIn' ? 1.0 : @params.easing === 'easeOut' ? 2.0 : @params.easing === 'easeInOut' ? 3.0 : 0.0" },
|
|
8316
|
-
uBlur: { type: "float", value: "@params.blur ? 1.0 : 0.0" }
|
|
8317
|
-
}
|
|
8318
|
-
},
|
|
8319
|
-
inputs: {
|
|
8320
|
-
clipA: { type: "Texture" },
|
|
8321
|
-
clipB: { type: "Texture" }
|
|
8322
|
-
},
|
|
8323
|
-
outputs: {
|
|
8324
|
-
result: { type: "Texture" }
|
|
8325
|
-
}
|
|
8326
|
-
},
|
|
8327
|
-
{
|
|
8328
|
-
id: "output",
|
|
8329
|
-
type: "Output",
|
|
8330
|
-
params: {},
|
|
8331
|
-
inputs: {
|
|
8332
|
-
result: { type: "Texture" }
|
|
8333
|
-
}
|
|
8334
|
-
}
|
|
8335
|
-
],
|
|
8336
|
-
edges: [
|
|
8337
|
-
{ from: "inputA", fromPin: "clipA", to: "zoom", toPin: "clipA" },
|
|
8338
|
-
{ from: "inputB", fromPin: "clipB", to: "zoom", toPin: "clipB" },
|
|
8339
|
-
{ from: "zoom", fromPin: "result", to: "output", toPin: "result" }
|
|
8340
|
-
],
|
|
8341
|
-
metadata: {
|
|
8342
|
-
author: "Clypra Studio",
|
|
8343
|
-
tags: ["transition", "zoom", "scale", "dynamic", "motion"],
|
|
8344
|
-
thumbnail: "zoom-thumb.png",
|
|
8345
|
-
previewVideo: "zoom-preview.mp4"
|
|
8346
|
-
},
|
|
8347
|
-
capabilities: {
|
|
8348
|
-
temporal: true,
|
|
8349
|
-
stateful: false,
|
|
8350
|
-
spatial: true,
|
|
8351
|
-
geometry: false,
|
|
8352
|
-
inputsCount: 2
|
|
8353
|
-
},
|
|
8354
|
-
requirements: {
|
|
8355
|
-
temporalRadius: 0,
|
|
8356
|
-
preferredPrecision: "fp16",
|
|
8357
|
-
multipass: false,
|
|
8358
|
-
supportsHalfResolution: false
|
|
8359
|
-
},
|
|
8360
|
-
presets: [
|
|
8361
|
-
{
|
|
8362
|
-
id: "zoom-in",
|
|
8363
|
-
name: "Zoom In",
|
|
8364
|
-
description: "Zoom into next clip",
|
|
8365
|
-
parameters: {
|
|
8366
|
-
direction: "in",
|
|
8367
|
-
intensity: 0.5,
|
|
8368
|
-
easing: "easeInOut",
|
|
8369
|
-
blur: true
|
|
8370
|
-
}
|
|
8371
|
-
},
|
|
8372
|
-
{
|
|
8373
|
-
id: "zoom-out",
|
|
8374
|
-
name: "Zoom Out",
|
|
8375
|
-
description: "Zoom out to next clip",
|
|
8376
|
-
parameters: {
|
|
8377
|
-
direction: "out",
|
|
8378
|
-
intensity: 0.5,
|
|
8379
|
-
easing: "easeInOut",
|
|
8380
|
-
blur: true
|
|
8381
|
-
}
|
|
8382
|
-
},
|
|
8383
|
-
{
|
|
8384
|
-
id: "dramatic-zoom-in",
|
|
8385
|
-
name: "Dramatic Zoom In",
|
|
8386
|
-
description: "Strong zoom effect",
|
|
8387
|
-
parameters: {
|
|
8388
|
-
direction: "in",
|
|
8389
|
-
intensity: 1.2,
|
|
8390
|
-
easing: "easeIn",
|
|
8391
|
-
blur: true
|
|
8392
|
-
}
|
|
8393
|
-
},
|
|
8394
|
-
{
|
|
8395
|
-
id: "subtle-zoom",
|
|
8396
|
-
name: "Subtle Zoom",
|
|
8397
|
-
description: "Gentle zoom transition",
|
|
8398
|
-
parameters: {
|
|
8399
|
-
direction: "in",
|
|
8400
|
-
intensity: 0.2,
|
|
8401
|
-
easing: "easeInOut",
|
|
8402
|
-
blur: false
|
|
8403
|
-
}
|
|
8404
|
-
}
|
|
8405
|
-
]
|
|
8406
|
-
};
|
|
8407
|
-
|
|
8408
|
-
// src/effects/transitions/lumaWipe.ts
|
|
8409
|
-
var lumaWipeTransition = {
|
|
8410
|
-
id: "transition.luma-wipe",
|
|
8411
|
-
name: "Luma Wipe",
|
|
8412
|
-
version: "1.0.0",
|
|
8413
|
-
category: "transition",
|
|
8414
|
-
description: "Brightness-based reveal with gradient wipe",
|
|
8415
|
-
schema: {
|
|
8416
|
-
parameters: {
|
|
8417
|
-
softness: {
|
|
8418
|
-
type: "number",
|
|
8419
|
-
default: 0.1,
|
|
8420
|
-
min: 0,
|
|
8421
|
-
max: 0.5,
|
|
8422
|
-
step: 0.01,
|
|
8423
|
-
label: "Softness",
|
|
8424
|
-
description: "Edge softness of the wipe"
|
|
8425
|
-
},
|
|
8426
|
-
invert: {
|
|
8427
|
-
type: "boolean",
|
|
8428
|
-
default: false,
|
|
8429
|
-
label: "Invert",
|
|
8430
|
-
description: "Reverse the wipe direction"
|
|
8431
|
-
},
|
|
8432
|
-
gradient: {
|
|
8433
|
-
type: "string",
|
|
8434
|
-
default: "diagonal",
|
|
8435
|
-
options: ["horizontal", "vertical", "diagonal", "radial", "noise"],
|
|
8436
|
-
label: "Gradient Type",
|
|
8437
|
-
description: "Pattern for the wipe"
|
|
8438
|
-
},
|
|
8439
|
-
easing: {
|
|
8440
|
-
type: "string",
|
|
8441
|
-
default: "linear",
|
|
8442
|
-
options: ["linear", "easeIn", "easeOut", "easeInOut"],
|
|
8443
|
-
label: "Easing",
|
|
8444
|
-
description: "Transition timing curve"
|
|
8445
|
-
}
|
|
8446
|
-
},
|
|
8447
|
-
inputs: {
|
|
8448
|
-
clipA: {
|
|
8449
|
-
type: "Texture",
|
|
8450
|
-
required: true,
|
|
8451
|
-
label: "Clip A (Outgoing)"
|
|
8452
|
-
},
|
|
8453
|
-
clipB: {
|
|
8454
|
-
type: "Texture",
|
|
8455
|
-
required: true,
|
|
8456
|
-
label: "Clip B (Incoming)"
|
|
8457
|
-
}
|
|
8458
|
-
},
|
|
8459
|
-
outputs: {
|
|
8460
|
-
result: {
|
|
8461
|
-
type: "Texture",
|
|
8462
|
-
label: "Output"
|
|
8463
|
-
}
|
|
8464
|
-
}
|
|
8465
|
-
},
|
|
8466
|
-
nodes: [
|
|
8467
|
-
{
|
|
8468
|
-
id: "inputA",
|
|
8469
|
-
type: "Input",
|
|
8470
|
-
params: {},
|
|
8471
|
-
outputs: {
|
|
8472
|
-
clipA: { type: "Texture" }
|
|
8473
|
-
}
|
|
8474
|
-
},
|
|
8475
|
-
{
|
|
8476
|
-
id: "inputB",
|
|
8477
|
-
type: "Input",
|
|
8478
|
-
params: {},
|
|
8479
|
-
outputs: {
|
|
8480
|
-
clipB: { type: "Texture" }
|
|
8481
|
-
}
|
|
8482
|
-
},
|
|
8483
|
-
{
|
|
8484
|
-
id: "luma-wipe",
|
|
8485
|
-
type: "ShaderNode",
|
|
8486
|
-
params: {
|
|
8487
|
-
shader: `
|
|
8488
|
-
precision highp float;
|
|
8489
|
-
|
|
8490
|
-
uniform sampler2D uClipA;
|
|
8491
|
-
uniform sampler2D uClipB;
|
|
8492
|
-
uniform float uProgress;
|
|
8493
|
-
uniform float uSoftness;
|
|
8494
|
-
uniform float uInvert;
|
|
8495
|
-
uniform float uGradient; // 0=horizontal, 1=vertical, 2=diagonal, 3=radial, 4=noise
|
|
8496
|
-
uniform float uEasing;
|
|
8497
|
-
|
|
8498
|
-
varying vec2 vUv;
|
|
8499
|
-
|
|
8500
|
-
// Easing functions
|
|
8501
|
-
float easeIn(float t) {
|
|
8502
|
-
return t * t;
|
|
8503
|
-
}
|
|
8504
|
-
|
|
8505
|
-
float easeOut(float t) {
|
|
8506
|
-
return t * (2.0 - t);
|
|
8507
|
-
}
|
|
8508
|
-
|
|
8509
|
-
float easeInOut(float t) {
|
|
8510
|
-
return t < 0.5 ? 2.0 * t * t : -1.0 + (4.0 - 2.0 * t) * t;
|
|
8511
|
-
}
|
|
8512
|
-
|
|
8513
|
-
float applyEasing(float t, float easingType) {
|
|
8514
|
-
if (easingType < 0.5) return t; // linear
|
|
8515
|
-
if (easingType < 1.5) return easeIn(t);
|
|
8516
|
-
if (easingType < 2.5) return easeOut(t);
|
|
8517
|
-
return easeInOut(t);
|
|
8518
|
-
}
|
|
8519
|
-
|
|
8520
|
-
// Random function for noise gradient
|
|
8521
|
-
float rand(vec2 co) {
|
|
8522
|
-
return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
|
|
8523
|
-
}
|
|
8524
|
-
|
|
8525
|
-
// Generate gradient value based on type
|
|
8526
|
-
float getGradient(vec2 uv, float gradientType) {
|
|
8527
|
-
if (gradientType < 0.5) {
|
|
8528
|
-
// Horizontal
|
|
8529
|
-
return uv.x;
|
|
8530
|
-
} else if (gradientType < 1.5) {
|
|
8531
|
-
// Vertical
|
|
8532
|
-
return uv.y;
|
|
8533
|
-
} else if (gradientType < 2.5) {
|
|
8534
|
-
// Diagonal
|
|
8535
|
-
return (uv.x + uv.y) * 0.5;
|
|
8536
|
-
} else if (gradientType < 3.5) {
|
|
8537
|
-
// Radial
|
|
8538
|
-
vec2 center = vec2(0.5, 0.5);
|
|
8539
|
-
return length(uv - center) * 1.414; // normalize to 0-1
|
|
8540
|
-
} else {
|
|
8541
|
-
// Noise
|
|
8542
|
-
return rand(floor(uv * 20.0) / 20.0);
|
|
8543
|
-
}
|
|
8544
|
-
}
|
|
8545
|
-
|
|
8546
|
-
void main() {
|
|
8547
|
-
float t = applyEasing(uProgress, uEasing);
|
|
8548
|
-
|
|
8549
|
-
// Get gradient value
|
|
8550
|
-
float gradient = getGradient(vUv, uGradient);
|
|
8551
|
-
|
|
8552
|
-
// Invert if needed
|
|
8553
|
-
if (uInvert > 0.5) {
|
|
8554
|
-
gradient = 1.0 - gradient;
|
|
8555
|
-
}
|
|
8556
|
-
|
|
8557
|
-
// Calculate threshold with softness
|
|
8558
|
-
float threshold = t;
|
|
8559
|
-
float lower = threshold - uSoftness;
|
|
8560
|
-
float upper = threshold + uSoftness;
|
|
8561
|
-
|
|
8562
|
-
// Smooth transition at threshold
|
|
8563
|
-
float mask = smoothstep(lower, upper, gradient);
|
|
8564
|
-
|
|
8565
|
-
// Sample both clips
|
|
8566
|
-
vec4 colorA = texture2D(uClipA, vUv);
|
|
8567
|
-
vec4 colorB = texture2D(uClipB, vUv);
|
|
8568
|
-
|
|
8569
|
-
// Blend based on mask
|
|
8570
|
-
vec4 color = mix(colorA, colorB, mask);
|
|
8571
|
-
|
|
8572
|
-
gl_FragColor = color;
|
|
8573
|
-
}
|
|
8574
|
-
`,
|
|
8575
|
-
uniforms: {
|
|
8576
|
-
uClipA: { type: "Texture", value: "@inputA.clipA" },
|
|
8577
|
-
uClipB: { type: "Texture", value: "@inputB.clipB" },
|
|
8578
|
-
uProgress: { type: "float", value: "progress" },
|
|
8579
|
-
uSoftness: { type: "float", value: "@params.softness" },
|
|
8580
|
-
uInvert: { type: "float", value: "@params.invert ? 1.0 : 0.0" },
|
|
8581
|
-
uGradient: { type: "float", value: "@params.gradient === 'horizontal' ? 0.0 : @params.gradient === 'vertical' ? 1.0 : @params.gradient === 'diagonal' ? 2.0 : @params.gradient === 'radial' ? 3.0 : 4.0" },
|
|
8582
|
-
uEasing: { type: "float", value: "@params.easing === 'easeIn' ? 1.0 : @params.easing === 'easeOut' ? 2.0 : @params.easing === 'easeInOut' ? 3.0 : 0.0" }
|
|
8583
|
-
}
|
|
8584
|
-
},
|
|
8585
|
-
inputs: {
|
|
8586
|
-
clipA: { type: "Texture" },
|
|
8587
|
-
clipB: { type: "Texture" }
|
|
8588
|
-
},
|
|
8589
|
-
outputs: {
|
|
8590
|
-
result: { type: "Texture" }
|
|
8591
|
-
}
|
|
8592
|
-
},
|
|
8593
|
-
{
|
|
8594
|
-
id: "output",
|
|
8595
|
-
type: "Output",
|
|
8596
|
-
params: {},
|
|
8597
|
-
inputs: {
|
|
8598
|
-
result: { type: "Texture" }
|
|
8599
|
-
}
|
|
8600
|
-
}
|
|
8601
|
-
],
|
|
8602
|
-
edges: [
|
|
8603
|
-
{ from: "inputA", fromPin: "clipA", to: "luma-wipe", toPin: "clipA" },
|
|
8604
|
-
{ from: "inputB", fromPin: "clipB", to: "luma-wipe", toPin: "clipB" },
|
|
8605
|
-
{ from: "luma-wipe", fromPin: "result", to: "output", toPin: "result" }
|
|
8606
|
-
],
|
|
8607
|
-
metadata: {
|
|
8608
|
-
author: "Clypra Studio",
|
|
8609
|
-
tags: ["transition", "wipe", "luma", "mask", "reveal"],
|
|
8610
|
-
thumbnail: "luma-wipe-thumb.png",
|
|
8611
|
-
previewVideo: "luma-wipe-preview.mp4"
|
|
8612
|
-
},
|
|
8613
|
-
capabilities: {
|
|
8614
|
-
temporal: true,
|
|
8615
|
-
stateful: false,
|
|
8616
|
-
spatial: true,
|
|
8617
|
-
geometry: false,
|
|
8618
|
-
inputsCount: 2
|
|
8619
|
-
},
|
|
8620
|
-
requirements: {
|
|
8621
|
-
temporalRadius: 0,
|
|
8622
|
-
preferredPrecision: "fp16",
|
|
8623
|
-
multipass: false,
|
|
8624
|
-
supportsHalfResolution: false
|
|
8625
|
-
},
|
|
8626
|
-
presets: [
|
|
8627
|
-
{
|
|
8628
|
-
id: "diagonal-wipe",
|
|
8629
|
-
name: "Diagonal Wipe",
|
|
8630
|
-
description: "Classic diagonal reveal",
|
|
8631
|
-
parameters: {
|
|
8632
|
-
softness: 0.1,
|
|
8633
|
-
invert: false,
|
|
8634
|
-
gradient: "diagonal",
|
|
8635
|
-
easing: "linear"
|
|
8636
|
-
}
|
|
8637
|
-
},
|
|
8638
|
-
{
|
|
8639
|
-
id: "radial-wipe",
|
|
8640
|
-
name: "Radial Wipe",
|
|
8641
|
-
description: "Circular reveal from center",
|
|
8642
|
-
parameters: {
|
|
8643
|
-
softness: 0.15,
|
|
8644
|
-
invert: false,
|
|
8645
|
-
gradient: "radial",
|
|
8646
|
-
easing: "easeInOut"
|
|
8647
|
-
}
|
|
8648
|
-
},
|
|
8649
|
-
{
|
|
8650
|
-
id: "horizontal-wipe",
|
|
8651
|
-
name: "Horizontal Wipe",
|
|
8652
|
-
description: "Left to right reveal",
|
|
8653
|
-
parameters: {
|
|
8654
|
-
softness: 0.05,
|
|
8655
|
-
invert: false,
|
|
8656
|
-
gradient: "horizontal",
|
|
8657
|
-
easing: "linear"
|
|
8658
|
-
}
|
|
8659
|
-
},
|
|
8660
|
-
{
|
|
8661
|
-
id: "noise-dissolve",
|
|
8662
|
-
name: "Noise Dissolve",
|
|
8663
|
-
description: "Random pixelated reveal",
|
|
8664
|
-
parameters: {
|
|
8665
|
-
softness: 0.2,
|
|
8666
|
-
invert: false,
|
|
8667
|
-
gradient: "noise",
|
|
8668
|
-
easing: "linear"
|
|
8669
|
-
}
|
|
8670
|
-
}
|
|
8671
|
-
]
|
|
8672
|
-
};
|
|
8673
|
-
|
|
8674
|
-
// src/effects/transitions/glitch.ts
|
|
8675
|
-
var glitchTransition = {
|
|
8676
|
-
id: "transition.glitch",
|
|
8677
|
-
name: "Glitch",
|
|
8678
|
-
version: "1.0.0",
|
|
8679
|
-
category: "transition",
|
|
8680
|
-
description: "Chaotic digital glitch with displacement and artifacts",
|
|
8681
|
-
schema: {
|
|
8682
|
-
parameters: {
|
|
8683
|
-
intensity: {
|
|
8684
|
-
type: "number",
|
|
8685
|
-
default: 0.5,
|
|
8686
|
-
min: 0,
|
|
8687
|
-
max: 1,
|
|
8688
|
-
step: 0.01,
|
|
8689
|
-
label: "Intensity",
|
|
8690
|
-
description: "Glitch effect strength"
|
|
8691
|
-
},
|
|
8692
|
-
blockSize: {
|
|
8693
|
-
type: "number",
|
|
8694
|
-
default: 10,
|
|
8695
|
-
min: 1,
|
|
8696
|
-
max: 50,
|
|
8697
|
-
step: 1,
|
|
8698
|
-
label: "Block Size",
|
|
8699
|
-
description: "Size of glitch blocks"
|
|
8700
|
-
},
|
|
8701
|
-
rgbShift: {
|
|
8702
|
-
type: "boolean",
|
|
8703
|
-
default: true,
|
|
8704
|
-
label: "RGB Shift",
|
|
8705
|
-
description: "Add chromatic aberration"
|
|
8706
|
-
},
|
|
8707
|
-
noise: {
|
|
8708
|
-
type: "boolean",
|
|
8709
|
-
default: true,
|
|
8710
|
-
label: "Noise",
|
|
8711
|
-
description: "Add random noise artifacts"
|
|
8712
|
-
}
|
|
8713
|
-
},
|
|
8714
|
-
inputs: {
|
|
8715
|
-
clipA: {
|
|
8716
|
-
type: "Texture",
|
|
8717
|
-
required: true,
|
|
8718
|
-
label: "Clip A (Outgoing)"
|
|
8719
|
-
},
|
|
8720
|
-
clipB: {
|
|
8721
|
-
type: "Texture",
|
|
8722
|
-
required: true,
|
|
8723
|
-
label: "Clip B (Incoming)"
|
|
8724
|
-
}
|
|
8725
|
-
},
|
|
8726
|
-
outputs: {
|
|
8727
|
-
result: {
|
|
8728
|
-
type: "Texture",
|
|
8729
|
-
label: "Output"
|
|
8730
|
-
}
|
|
8731
|
-
}
|
|
8732
|
-
},
|
|
8733
|
-
nodes: [
|
|
8734
|
-
{
|
|
8735
|
-
id: "inputA",
|
|
8736
|
-
type: "Input",
|
|
8737
|
-
params: {},
|
|
8738
|
-
outputs: {
|
|
8739
|
-
clipA: { type: "Texture" }
|
|
8740
|
-
}
|
|
8741
|
-
},
|
|
8742
|
-
{
|
|
8743
|
-
id: "inputB",
|
|
8744
|
-
type: "Input",
|
|
8745
|
-
params: {},
|
|
8746
|
-
outputs: {
|
|
8747
|
-
clipB: { type: "Texture" }
|
|
8748
|
-
}
|
|
8749
|
-
},
|
|
8750
|
-
{
|
|
8751
|
-
id: "glitch",
|
|
8752
|
-
type: "ShaderNode",
|
|
8753
|
-
params: {
|
|
8754
|
-
shader: `
|
|
8755
|
-
precision highp float;
|
|
8756
|
-
|
|
8757
|
-
uniform sampler2D uClipA;
|
|
8758
|
-
uniform sampler2D uClipB;
|
|
8759
|
-
uniform float uProgress;
|
|
8760
|
-
uniform float uIntensity;
|
|
8761
|
-
uniform float uBlockSize;
|
|
8762
|
-
uniform float uRgbShift;
|
|
8763
|
-
uniform float uNoise;
|
|
8764
|
-
uniform vec2 uResolution;
|
|
8765
|
-
|
|
8766
|
-
varying vec2 vUv;
|
|
8767
|
-
|
|
8768
|
-
// Random function
|
|
8769
|
-
float rand(vec2 co) {
|
|
8770
|
-
return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
|
|
8771
|
-
}
|
|
8772
|
-
|
|
8773
|
-
// Block-based random
|
|
8774
|
-
float blockRand(vec2 uv, float blockSize) {
|
|
8775
|
-
vec2 block = floor(uv * uResolution / blockSize);
|
|
8776
|
-
return rand(block + vec2(uProgress * 10.0));
|
|
8777
|
-
}
|
|
8778
|
-
|
|
8779
|
-
void main() {
|
|
8780
|
-
vec2 uv = vUv;
|
|
8781
|
-
float t = uProgress;
|
|
8782
|
-
|
|
8783
|
-
// Glitch intensity peaks at mid-transition
|
|
8784
|
-
float glitchAmount = uIntensity * (1.0 - abs(t * 2.0 - 1.0));
|
|
8785
|
-
|
|
8786
|
-
// Block-based displacement
|
|
8787
|
-
float blockR = blockRand(uv, uBlockSize);
|
|
8788
|
-
|
|
8789
|
-
if (blockR < glitchAmount) {
|
|
8790
|
-
// Random horizontal displacement
|
|
8791
|
-
float displacement = (rand(vec2(blockR, t)) - 0.5) * glitchAmount * 0.3;
|
|
8792
|
-
uv.x += displacement;
|
|
8793
|
-
|
|
8794
|
-
// Random vertical jitter (smaller)
|
|
8795
|
-
float jitter = (rand(vec2(blockR + 1.0, t)) - 0.5) * glitchAmount * 0.1;
|
|
8796
|
-
uv.y += jitter;
|
|
8797
|
-
}
|
|
8798
|
-
|
|
8799
|
-
// Clamp UVs
|
|
8800
|
-
uv = clamp(uv, 0.0, 1.0);
|
|
8801
|
-
|
|
8802
|
-
// RGB shift during glitch
|
|
8803
|
-
vec4 colorA, colorB;
|
|
8804
|
-
|
|
8805
|
-
if (uRgbShift > 0.5 && glitchAmount > 0.1) {
|
|
8806
|
-
float shiftAmount = glitchAmount * 0.01;
|
|
8807
|
-
|
|
8808
|
-
// Clip A with RGB shift
|
|
8809
|
-
float rA = texture2D(uClipA, uv + vec2(shiftAmount, 0.0)).r;
|
|
8810
|
-
float gA = texture2D(uClipA, uv).g;
|
|
8811
|
-
float bA = texture2D(uClipA, uv - vec2(shiftAmount, 0.0)).b;
|
|
8812
|
-
colorA = vec4(rA, gA, bA, 1.0);
|
|
8813
|
-
|
|
8814
|
-
// Clip B with RGB shift
|
|
8815
|
-
float rB = texture2D(uClipB, uv + vec2(shiftAmount, 0.0)).r;
|
|
8816
|
-
float gB = texture2D(uClipB, uv).g;
|
|
8817
|
-
float bB = texture2D(uClipB, uv - vec2(shiftAmount, 0.0)).b;
|
|
8818
|
-
colorB = vec4(rB, gB, bB, 1.0);
|
|
8819
|
-
} else {
|
|
8820
|
-
colorA = texture2D(uClipA, uv);
|
|
8821
|
-
colorB = texture2D(uClipB, uv);
|
|
8822
|
-
}
|
|
8823
|
-
|
|
8824
|
-
// Random block switching during glitch
|
|
8825
|
-
float blockSwitch = blockRand(vUv, uBlockSize * 0.5);
|
|
8826
|
-
float threshold = mix(t, 0.5, glitchAmount);
|
|
8827
|
-
|
|
8828
|
-
vec4 color;
|
|
8829
|
-
if (blockSwitch < threshold) {
|
|
8830
|
-
color = colorB;
|
|
8831
|
-
} else {
|
|
8832
|
-
color = mix(colorA, colorB, t);
|
|
8833
|
-
}
|
|
8834
|
-
|
|
8835
|
-
// Add noise artifacts during glitch
|
|
8836
|
-
if (uNoise > 0.5 && glitchAmount > 0.2) {
|
|
8837
|
-
float noiseVal = rand(vUv * 500.0 + vec2(t * 100.0));
|
|
8838
|
-
if (noiseVal > 0.95) {
|
|
8839
|
-
color.rgb = vec3(noiseVal);
|
|
8840
|
-
}
|
|
8841
|
-
}
|
|
8842
|
-
|
|
8843
|
-
// Occasional full-frame corruption
|
|
8844
|
-
if (glitchAmount > 0.4) {
|
|
8845
|
-
float corruptionChance = rand(vec2(floor(t * 60.0)));
|
|
8846
|
-
if (corruptionChance < glitchAmount * 0.1) {
|
|
8847
|
-
// Invert colors briefly
|
|
8848
|
-
color.rgb = 1.0 - color.rgb;
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
|
|
8852
|
-
gl_FragColor = color;
|
|
8853
|
-
}
|
|
8854
|
-
`,
|
|
8855
|
-
uniforms: {
|
|
8856
|
-
uClipA: { type: "Texture", value: "@inputA.clipA" },
|
|
8857
|
-
uClipB: { type: "Texture", value: "@inputB.clipB" },
|
|
8858
|
-
uProgress: { type: "float", value: "progress" },
|
|
8859
|
-
uIntensity: { type: "float", value: "@params.intensity" },
|
|
8860
|
-
uBlockSize: { type: "float", value: "@params.blockSize" },
|
|
8861
|
-
uRgbShift: { type: "float", value: "@params.rgbShift ? 1.0 : 0.0" },
|
|
8862
|
-
uNoise: { type: "float", value: "@params.noise ? 1.0 : 0.0" },
|
|
8863
|
-
uResolution: { type: "vec2", value: "resolution" }
|
|
8864
|
-
}
|
|
8865
|
-
},
|
|
8866
|
-
inputs: {
|
|
8867
|
-
clipA: { type: "Texture" },
|
|
8868
|
-
clipB: { type: "Texture" }
|
|
8869
|
-
},
|
|
8870
|
-
outputs: {
|
|
8871
|
-
result: { type: "Texture" }
|
|
8872
|
-
}
|
|
8873
|
-
},
|
|
8874
|
-
{
|
|
8875
|
-
id: "output",
|
|
8876
|
-
type: "Output",
|
|
8877
|
-
params: {},
|
|
8878
|
-
inputs: {
|
|
8879
|
-
result: { type: "Texture" }
|
|
8880
|
-
}
|
|
8881
|
-
}
|
|
8882
|
-
],
|
|
8883
|
-
edges: [
|
|
8884
|
-
{ from: "inputA", fromPin: "clipA", to: "glitch", toPin: "clipA" },
|
|
8885
|
-
{ from: "inputB", fromPin: "clipB", to: "glitch", toPin: "clipB" },
|
|
8886
|
-
{ from: "glitch", fromPin: "result", to: "output", toPin: "result" }
|
|
8887
|
-
],
|
|
8888
|
-
metadata: {
|
|
8889
|
-
author: "Clypra Studio",
|
|
8890
|
-
tags: ["transition", "glitch", "digital", "chaos", "corruption", "artifacts"],
|
|
8891
|
-
thumbnail: "glitch-thumb.png",
|
|
8892
|
-
previewVideo: "glitch-preview.mp4"
|
|
8893
|
-
},
|
|
8894
|
-
capabilities: {
|
|
8895
|
-
temporal: true,
|
|
8896
|
-
stateful: false,
|
|
8897
|
-
spatial: true,
|
|
8898
|
-
geometry: false,
|
|
8899
|
-
inputsCount: 2
|
|
8900
|
-
},
|
|
8901
|
-
requirements: {
|
|
8902
|
-
temporalRadius: 0,
|
|
8903
|
-
preferredPrecision: "fp16",
|
|
8904
|
-
multipass: false,
|
|
8905
|
-
supportsHalfResolution: false
|
|
8906
|
-
},
|
|
8907
|
-
presets: [
|
|
8908
|
-
{
|
|
8909
|
-
id: "subtle-glitch",
|
|
8910
|
-
name: "Subtle Glitch",
|
|
8911
|
-
description: "Light digital artifacts",
|
|
8912
|
-
parameters: {
|
|
8913
|
-
intensity: 0.3,
|
|
8914
|
-
blockSize: 20,
|
|
8915
|
-
rgbShift: true,
|
|
8916
|
-
noise: false
|
|
8917
|
-
}
|
|
8918
|
-
},
|
|
8919
|
-
{
|
|
8920
|
-
id: "medium-glitch",
|
|
8921
|
-
name: "Medium Glitch",
|
|
8922
|
-
description: "Balanced glitch effect",
|
|
8923
|
-
parameters: {
|
|
8924
|
-
intensity: 0.5,
|
|
8925
|
-
blockSize: 10,
|
|
8926
|
-
rgbShift: true,
|
|
8927
|
-
noise: true
|
|
8928
|
-
}
|
|
8929
|
-
},
|
|
8930
|
-
{
|
|
8931
|
-
id: "heavy-corruption",
|
|
8932
|
-
name: "Heavy Corruption",
|
|
8933
|
-
description: "Chaotic digital breakdown",
|
|
8934
|
-
parameters: {
|
|
8935
|
-
intensity: 0.8,
|
|
8936
|
-
blockSize: 5,
|
|
8937
|
-
rgbShift: true,
|
|
8938
|
-
noise: true
|
|
8939
|
-
}
|
|
8940
|
-
},
|
|
8941
|
-
{
|
|
8942
|
-
id: "clean-switch",
|
|
8943
|
-
name: "Clean Block Switch",
|
|
8944
|
-
description: "Block-based without artifacts",
|
|
8945
|
-
parameters: {
|
|
8946
|
-
intensity: 0.4,
|
|
8947
|
-
blockSize: 15,
|
|
8948
|
-
rgbShift: false,
|
|
8949
|
-
noise: false
|
|
8950
|
-
}
|
|
8951
|
-
}
|
|
8952
|
-
]
|
|
8953
|
-
};
|
|
8954
|
-
|
|
8955
|
-
// src/effects/transitions/index.ts
|
|
8956
|
-
var transitionEffects = [crossDissolveTransition, pushTransition, zoomTransition, lumaWipeTransition, glitchTransition];
|
|
8957
|
-
var transitionEffectsById = {
|
|
8958
|
-
"transition.cross-dissolve": crossDissolveTransition,
|
|
8959
|
-
"transition.push": pushTransition,
|
|
8960
|
-
"transition.zoom": zoomTransition,
|
|
8961
|
-
"transition.luma-wipe": lumaWipeTransition,
|
|
8962
|
-
"transition.glitch": glitchTransition
|
|
8963
|
-
};
|
|
8964
|
-
function getTransitionEffect(id) {
|
|
8965
|
-
return transitionEffectsById[id];
|
|
8966
|
-
}
|
|
8967
|
-
|
|
8968
|
-
// src/effects/body/neonOutline.ts
|
|
8969
|
-
var neonOutlineEffect = {
|
|
8970
|
-
id: "body.neon-outline",
|
|
8971
|
-
name: "Neon Outline",
|
|
8972
|
-
version: "1.0.0",
|
|
8973
|
-
category: "body",
|
|
8974
|
-
description: "Glowing neon outline around the subject",
|
|
8975
|
-
schema: {
|
|
8976
|
-
parameters: {
|
|
8977
|
-
color: {
|
|
8978
|
-
type: "color",
|
|
8979
|
-
default: "#00FFFF",
|
|
8980
|
-
label: "Outline Color",
|
|
8981
|
-
description: "Color of the neon glow"
|
|
8982
|
-
},
|
|
8983
|
-
thickness: {
|
|
8984
|
-
type: "number",
|
|
8985
|
-
default: 4,
|
|
8986
|
-
min: 1,
|
|
8987
|
-
max: 20,
|
|
8988
|
-
step: 1,
|
|
8989
|
-
label: "Thickness",
|
|
8990
|
-
description: "Width of the outline in pixels"
|
|
8991
|
-
},
|
|
8992
|
-
intensity: {
|
|
8993
|
-
type: "number",
|
|
8994
|
-
default: 1,
|
|
8995
|
-
min: 0,
|
|
8996
|
-
max: 2,
|
|
8997
|
-
step: 0.1,
|
|
8998
|
-
label: "Glow Intensity",
|
|
8999
|
-
description: "Brightness of the glow effect"
|
|
9000
|
-
},
|
|
9001
|
-
softness: {
|
|
9002
|
-
type: "number",
|
|
9003
|
-
default: 0.5,
|
|
9004
|
-
min: 0,
|
|
9005
|
-
max: 1,
|
|
9006
|
-
step: 0.05,
|
|
9007
|
-
label: "Glow Softness",
|
|
9008
|
-
description: "How soft/blurred the glow appears"
|
|
9009
|
-
}
|
|
9010
|
-
},
|
|
9011
|
-
inputs: {
|
|
9012
|
-
source: {
|
|
9013
|
-
type: "Texture",
|
|
9014
|
-
required: true,
|
|
9015
|
-
label: "Video Input"
|
|
9016
|
-
},
|
|
9017
|
-
mask: {
|
|
9018
|
-
type: "Texture",
|
|
9019
|
-
required: true,
|
|
9020
|
-
label: "Mask (from feature provider)"
|
|
9021
|
-
}
|
|
9022
|
-
},
|
|
9023
|
-
outputs: {
|
|
9024
|
-
result: {
|
|
9025
|
-
type: "Texture",
|
|
9026
|
-
label: "Output"
|
|
9027
|
-
}
|
|
9028
|
-
}
|
|
9029
|
-
},
|
|
9030
|
-
nodes: [
|
|
9031
|
-
{
|
|
9032
|
-
id: "input",
|
|
9033
|
-
type: "Input",
|
|
9034
|
-
params: {},
|
|
9035
|
-
outputs: {
|
|
9036
|
-
source: { type: "Texture" },
|
|
9037
|
-
mask: { type: "Texture" }
|
|
9038
|
-
}
|
|
9039
|
-
},
|
|
9040
|
-
// Edge Detection Pass
|
|
9041
|
-
{
|
|
9042
|
-
id: "edge-detect",
|
|
9043
|
-
type: "ShaderNode",
|
|
9044
|
-
params: {
|
|
9045
|
-
shader: `
|
|
9046
|
-
precision highp float;
|
|
9047
|
-
|
|
9048
|
-
uniform sampler2D uMask;
|
|
9049
|
-
uniform vec2 uResolution;
|
|
9050
|
-
uniform float uThickness;
|
|
9051
|
-
|
|
9052
|
-
varying vec2 vUv;
|
|
9053
|
-
|
|
9054
|
-
void main() {
|
|
9055
|
-
vec2 texelSize = 1.0 / uResolution;
|
|
9056
|
-
float step = uThickness;
|
|
9057
|
-
|
|
9058
|
-
// Sample mask in 3x3 grid (Sobel-like edge detection)
|
|
9059
|
-
float tl = texture2D(uMask, vUv + vec2(-step, step) * texelSize).a;
|
|
9060
|
-
float t = texture2D(uMask, vUv + vec2(0.0, step) * texelSize).a;
|
|
9061
|
-
float tr = texture2D(uMask, vUv + vec2(step, step) * texelSize).a;
|
|
9062
|
-
float l = texture2D(uMask, vUv + vec2(-step, 0.0) * texelSize).a;
|
|
9063
|
-
float c = texture2D(uMask, vUv).a;
|
|
9064
|
-
float r = texture2D(uMask, vUv + vec2(step, 0.0) * texelSize).a;
|
|
9065
|
-
float bl = texture2D(uMask, vUv + vec2(-step, -step) * texelSize).a;
|
|
9066
|
-
float b = texture2D(uMask, vUv + vec2(0.0, -step) * texelSize).a;
|
|
9067
|
-
float br = texture2D(uMask, vUv + vec2(step, -step) * texelSize).a;
|
|
9068
|
-
|
|
9069
|
-
// Sobel operators
|
|
9070
|
-
float gx = -tl - 2.0 * l - bl + tr + 2.0 * r + br;
|
|
9071
|
-
float gy = -tl - 2.0 * t - tr + bl + 2.0 * b + br;
|
|
9072
|
-
|
|
9073
|
-
// Edge magnitude
|
|
9074
|
-
float edge = sqrt(gx * gx + gy * gy);
|
|
9075
|
-
|
|
9076
|
-
// Threshold and normalize
|
|
9077
|
-
edge = smoothstep(0.1, 0.5, edge);
|
|
9078
|
-
|
|
9079
|
-
gl_FragColor = vec4(edge, edge, edge, edge);
|
|
9080
|
-
}
|
|
9081
|
-
`,
|
|
9082
|
-
uniforms: {
|
|
9083
|
-
uMask: { type: "Texture", value: "@input.mask" },
|
|
9084
|
-
uResolution: { type: "vec2", value: "resolution" },
|
|
9085
|
-
uThickness: { type: "float", value: "@params.thickness" }
|
|
9086
|
-
}
|
|
9087
|
-
},
|
|
9088
|
-
inputs: {
|
|
9089
|
-
mask: { type: "Texture" }
|
|
9090
|
-
},
|
|
9091
|
-
outputs: {
|
|
9092
|
-
edges: { type: "Texture" }
|
|
9093
|
-
}
|
|
9094
|
-
},
|
|
9095
|
-
// Horizontal Blur Pass
|
|
9096
|
-
{
|
|
9097
|
-
id: "blur-h",
|
|
9098
|
-
type: "ShaderNode",
|
|
9099
|
-
params: {
|
|
9100
|
-
shader: `
|
|
9101
|
-
precision highp float;
|
|
9102
|
-
|
|
9103
|
-
uniform sampler2D uEdges;
|
|
9104
|
-
uniform vec2 uResolution;
|
|
9105
|
-
uniform float uSoftness;
|
|
9106
|
-
|
|
9107
|
-
varying vec2 vUv;
|
|
9108
|
-
|
|
9109
|
-
void main() {
|
|
9110
|
-
vec2 texelSize = 1.0 / uResolution;
|
|
9111
|
-
float blur = 0.0;
|
|
9112
|
-
|
|
9113
|
-
// Gaussian blur weights
|
|
9114
|
-
float weights[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
|
9115
|
-
float radius = 4.0 * uSoftness;
|
|
9116
|
-
|
|
9117
|
-
blur += texture2D(uEdges, vUv).r * weights[0];
|
|
9118
|
-
|
|
9119
|
-
for (int i = 1; i < 5; i++) {
|
|
9120
|
-
float offset = float(i) * radius;
|
|
9121
|
-
blur += texture2D(uEdges, vUv + vec2(offset * texelSize.x, 0.0)).r * weights[i];
|
|
9122
|
-
blur += texture2D(uEdges, vUv - vec2(offset * texelSize.x, 0.0)).r * weights[i];
|
|
9123
|
-
}
|
|
9124
|
-
|
|
9125
|
-
gl_FragColor = vec4(blur, blur, blur, blur);
|
|
9126
|
-
}
|
|
9127
|
-
`,
|
|
9128
|
-
uniforms: {
|
|
9129
|
-
uEdges: { type: "Texture", value: "@edge-detect.edges" },
|
|
9130
|
-
uResolution: { type: "vec2", value: "resolution" },
|
|
9131
|
-
uSoftness: { type: "float", value: "@params.softness" }
|
|
9132
|
-
}
|
|
9133
|
-
},
|
|
9134
|
-
inputs: {
|
|
9135
|
-
edges: { type: "Texture" }
|
|
9136
|
-
},
|
|
9137
|
-
outputs: {
|
|
9138
|
-
blurredH: { type: "Texture" }
|
|
9139
|
-
}
|
|
9140
|
-
},
|
|
9141
|
-
// Vertical Blur Pass
|
|
9142
|
-
{
|
|
9143
|
-
id: "blur-v",
|
|
9144
|
-
type: "ShaderNode",
|
|
9145
|
-
params: {
|
|
9146
|
-
shader: `
|
|
9147
|
-
precision highp float;
|
|
9148
|
-
|
|
9149
|
-
uniform sampler2D uBlurredH;
|
|
9150
|
-
uniform vec2 uResolution;
|
|
9151
|
-
uniform float uSoftness;
|
|
9152
|
-
|
|
9153
|
-
varying vec2 vUv;
|
|
9154
|
-
|
|
9155
|
-
void main() {
|
|
9156
|
-
vec2 texelSize = 1.0 / uResolution;
|
|
9157
|
-
float blur = 0.0;
|
|
9158
|
-
|
|
9159
|
-
// Gaussian blur weights
|
|
9160
|
-
float weights[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
|
9161
|
-
float radius = 4.0 * uSoftness;
|
|
9162
|
-
|
|
9163
|
-
blur += texture2D(uBlurredH, vUv).r * weights[0];
|
|
9164
|
-
|
|
9165
|
-
for (int i = 1; i < 5; i++) {
|
|
9166
|
-
float offset = float(i) * radius;
|
|
9167
|
-
blur += texture2D(uBlurredH, vUv + vec2(0.0, offset * texelSize.y)).r * weights[i];
|
|
9168
|
-
blur += texture2D(uBlurredH, vUv - vec2(0.0, offset * texelSize.y)).r * weights[i];
|
|
9169
|
-
}
|
|
9170
|
-
|
|
9171
|
-
gl_FragColor = vec4(blur, blur, blur, blur);
|
|
9172
|
-
}
|
|
9173
|
-
`,
|
|
9174
|
-
uniforms: {
|
|
9175
|
-
uBlurredH: { type: "Texture", value: "@blur-h.blurredH" },
|
|
9176
|
-
uResolution: { type: "vec2", value: "resolution" },
|
|
9177
|
-
uSoftness: { type: "float", value: "@params.softness" }
|
|
9178
|
-
}
|
|
9179
|
-
},
|
|
9180
|
-
inputs: {
|
|
9181
|
-
blurredH: { type: "Texture" }
|
|
9182
|
-
},
|
|
9183
|
-
outputs: {
|
|
9184
|
-
glow: { type: "Texture" }
|
|
9185
|
-
}
|
|
9186
|
-
},
|
|
9187
|
-
// Composite Pass
|
|
8041
|
+
// Composite Pass
|
|
9188
8042
|
{
|
|
9189
8043
|
id: "composite",
|
|
9190
8044
|
type: "ShaderNode",
|
|
@@ -10751,8 +9605,8 @@ function interpolateValue(from, to, t) {
|
|
|
10751
9605
|
return t < 0.5 ? from : to;
|
|
10752
9606
|
}
|
|
10753
9607
|
function interpolateColor(from, to, t) {
|
|
10754
|
-
const fromRgb =
|
|
10755
|
-
const toRgb =
|
|
9608
|
+
const fromRgb = hexToRgb2(from);
|
|
9609
|
+
const toRgb = hexToRgb2(to);
|
|
10756
9610
|
if (!fromRgb || !toRgb) {
|
|
10757
9611
|
return t < 0.5 ? from : to;
|
|
10758
9612
|
}
|
|
@@ -10761,7 +9615,7 @@ function interpolateColor(from, to, t) {
|
|
|
10761
9615
|
const b = Math.round(fromRgb.b + (toRgb.b - fromRgb.b) * t);
|
|
10762
9616
|
return rgbToHex(r, g, b);
|
|
10763
9617
|
}
|
|
10764
|
-
function
|
|
9618
|
+
function hexToRgb2(hex) {
|
|
10765
9619
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
10766
9620
|
return result ? {
|
|
10767
9621
|
r: parseInt(result[1], 16),
|
|
@@ -11710,8 +10564,8 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11710
10564
|
* Creates a default registry with built-in node types pre-registered.
|
|
11711
10565
|
*/
|
|
11712
10566
|
static createDefault() {
|
|
11713
|
-
const
|
|
11714
|
-
|
|
10567
|
+
const registry2 = new _NodeRegistry();
|
|
10568
|
+
registry2.register(
|
|
11715
10569
|
{
|
|
11716
10570
|
type: "TrackSourceManager",
|
|
11717
10571
|
name: "Track Source Manager",
|
|
@@ -11748,7 +10602,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11748
10602
|
}
|
|
11749
10603
|
}
|
|
11750
10604
|
);
|
|
11751
|
-
|
|
10605
|
+
registry2.register(
|
|
11752
10606
|
{
|
|
11753
10607
|
type: "OutputNode",
|
|
11754
10608
|
name: "Output Node",
|
|
@@ -11785,7 +10639,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11785
10639
|
}
|
|
11786
10640
|
}
|
|
11787
10641
|
);
|
|
11788
|
-
|
|
10642
|
+
registry2.register(
|
|
11789
10643
|
{
|
|
11790
10644
|
type: "GaussianBlur",
|
|
11791
10645
|
name: "Gaussian Blur",
|
|
@@ -11843,7 +10697,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11843
10697
|
}
|
|
11844
10698
|
}
|
|
11845
10699
|
);
|
|
11846
|
-
|
|
10700
|
+
registry2.register(
|
|
11847
10701
|
{
|
|
11848
10702
|
type: "Brightness",
|
|
11849
10703
|
name: "Brightness",
|
|
@@ -11883,7 +10737,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11883
10737
|
}
|
|
11884
10738
|
}
|
|
11885
10739
|
);
|
|
11886
|
-
|
|
10740
|
+
registry2.register(
|
|
11887
10741
|
{
|
|
11888
10742
|
type: "Contrast",
|
|
11889
10743
|
name: "Contrast",
|
|
@@ -11939,7 +10793,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11939
10793
|
supportsHalfResolution: true
|
|
11940
10794
|
};
|
|
11941
10795
|
const registerColorNode = (type, name, description, paramKey, defaultVal, min, max) => {
|
|
11942
|
-
|
|
10796
|
+
registry2.register(
|
|
11943
10797
|
{
|
|
11944
10798
|
type,
|
|
11945
10799
|
name,
|
|
@@ -11976,7 +10830,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
11976
10830
|
registerColorNode("Sepia", "Sepia", "Warm vintage sepia tone", "sepia", 0, 0, 1);
|
|
11977
10831
|
registerColorNode("Grayscale", "Grayscale", "Desaturate to monochrome", "grayscale", 0, 0, 1);
|
|
11978
10832
|
registerColorNode("HueRotate", "Hue Rotate", "Rotate hue in radians", "hueRotate", 0, 0, 6.28318);
|
|
11979
|
-
|
|
10833
|
+
registry2.register(
|
|
11980
10834
|
{
|
|
11981
10835
|
type: "AlphaBlend",
|
|
11982
10836
|
name: "Alpha Blend",
|
|
@@ -12019,7 +10873,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
12019
10873
|
}
|
|
12020
10874
|
}
|
|
12021
10875
|
);
|
|
12022
|
-
|
|
10876
|
+
registry2.register(
|
|
12023
10877
|
{
|
|
12024
10878
|
type: "MotionBlur",
|
|
12025
10879
|
name: "Motion Blur",
|
|
@@ -12060,7 +10914,7 @@ var NodeRegistry = class _NodeRegistry {
|
|
|
12060
10914
|
}
|
|
12061
10915
|
}
|
|
12062
10916
|
);
|
|
12063
|
-
return
|
|
10917
|
+
return registry2;
|
|
12064
10918
|
}
|
|
12065
10919
|
};
|
|
12066
10920
|
|
|
@@ -12302,8 +11156,8 @@ var ProjectCompiler = class {
|
|
|
12302
11156
|
* @param manifest - The project manifest to compile
|
|
12303
11157
|
* @param registry - Optional NodeRegistry instance. If not provided, uses default registry.
|
|
12304
11158
|
*/
|
|
12305
|
-
static compile(manifest,
|
|
12306
|
-
const nodeRegistry =
|
|
11159
|
+
static compile(manifest, registry2) {
|
|
11160
|
+
const nodeRegistry = registry2 || NodeRegistry.createDefault();
|
|
12307
11161
|
let graph = GraphHelper.create(`compiled-graph-${manifest.id}`);
|
|
12308
11162
|
let trackOutPins = [];
|
|
12309
11163
|
for (const track of manifest.tracks) {
|
|
@@ -12439,7 +11293,7 @@ var FrameGraphBuilder = class _FrameGraphBuilder {
|
|
|
12439
11293
|
/**
|
|
12440
11294
|
* Builds the FrameGraph for a specific timeline time point.
|
|
12441
11295
|
*/
|
|
12442
|
-
static build(compiledGraph, timelineTimeMs, frameNumber, viewportWidth, viewportHeight,
|
|
11296
|
+
static build(compiledGraph, timelineTimeMs, frameNumber, viewportWidth, viewportHeight, registry2 = NodeRegistry.createDefault()) {
|
|
12443
11297
|
const activeNodeIds = /* @__PURE__ */ new Set();
|
|
12444
11298
|
const nodeById = /* @__PURE__ */ new Map();
|
|
12445
11299
|
for (const node of compiledGraph.nodes) {
|
|
@@ -12517,7 +11371,7 @@ var FrameGraphBuilder = class _FrameGraphBuilder {
|
|
|
12517
11371
|
const nodeOutputResourceMap = /* @__PURE__ */ new Map();
|
|
12518
11372
|
nodeOutputResourceMap.set("composite-output", "res-final-frame");
|
|
12519
11373
|
for (const node of activeNodesList) {
|
|
12520
|
-
_FrameGraphBuilder.planNodePasses(node, activeEdgesList, nodeOutputResourceMap, resourceRequests, renderPasses,
|
|
11374
|
+
_FrameGraphBuilder.planNodePasses(node, activeEdgesList, nodeOutputResourceMap, resourceRequests, renderPasses, registry2, timelineTimeMs, viewportWidth, viewportHeight);
|
|
12521
11375
|
}
|
|
12522
11376
|
return {
|
|
12523
11377
|
frameNumber,
|
|
@@ -12528,8 +11382,8 @@ var FrameGraphBuilder = class _FrameGraphBuilder {
|
|
|
12528
11382
|
passes: renderPasses
|
|
12529
11383
|
};
|
|
12530
11384
|
}
|
|
12531
|
-
static planNodePasses(node, activeEdgesList, nodeOutputResourceMap, resourceRequests, renderPasses,
|
|
12532
|
-
const planner =
|
|
11385
|
+
static planNodePasses(node, activeEdgesList, nodeOutputResourceMap, resourceRequests, renderPasses, registry2, timelineTimeMs, viewportWidth, viewportHeight) {
|
|
11386
|
+
const planner = registry2.getPlanner(node.type);
|
|
12533
11387
|
if (node.type === "TrackSourceManager") {
|
|
12534
11388
|
const resourceId = `res-${node.id}`;
|
|
12535
11389
|
resourceRequests.push({
|
|
@@ -12648,8 +11502,8 @@ var FrameGraphBuilder = class _FrameGraphBuilder {
|
|
|
12648
11502
|
|
|
12649
11503
|
// src/v2/validation/GraphValidator.ts
|
|
12650
11504
|
var GraphValidator = class {
|
|
12651
|
-
constructor(
|
|
12652
|
-
this.registry =
|
|
11505
|
+
constructor(registry2) {
|
|
11506
|
+
this.registry = registry2;
|
|
12653
11507
|
}
|
|
12654
11508
|
registry;
|
|
12655
11509
|
/**
|
|
@@ -12978,9 +11832,977 @@ var MPGFrameRenderer = class _MPGFrameRenderer {
|
|
|
12978
11832
|
}
|
|
12979
11833
|
};
|
|
12980
11834
|
|
|
11835
|
+
// src/text/textBridge.ts
|
|
11836
|
+
import { Sprite as Sprite2, Texture as Texture3 } from "pixi.js";
|
|
11837
|
+
var bridges = /* @__PURE__ */ new Map();
|
|
11838
|
+
function mapPixiBlendMode(blendMode) {
|
|
11839
|
+
const map = {
|
|
11840
|
+
normal: "normal",
|
|
11841
|
+
multiply: "multiply",
|
|
11842
|
+
screen: "screen",
|
|
11843
|
+
overlay: "overlay",
|
|
11844
|
+
darken: "darken",
|
|
11845
|
+
lighten: "lighten",
|
|
11846
|
+
add: "add"
|
|
11847
|
+
};
|
|
11848
|
+
return map[blendMode] || "normal";
|
|
11849
|
+
}
|
|
11850
|
+
function beginTextFrame(container) {
|
|
11851
|
+
container.sortableChildren = true;
|
|
11852
|
+
for (const child of container.children) {
|
|
11853
|
+
child.visible = false;
|
|
11854
|
+
}
|
|
11855
|
+
}
|
|
11856
|
+
async function renderTextLayerBridged(layer, frameId, container, viewport, renderOrder, bleed, rasterizeTextCallback, cacheKey) {
|
|
11857
|
+
const { scale, offsetX, offsetY, pixelRatio } = viewport;
|
|
11858
|
+
const width = layer.width * scale;
|
|
11859
|
+
const height = layer.height * scale;
|
|
11860
|
+
const effectPaddingX = bleed.x * scale;
|
|
11861
|
+
const effectPaddingY = bleed.y * scale;
|
|
11862
|
+
const offW = Math.max(1, Math.ceil(width + effectPaddingX * 2));
|
|
11863
|
+
const offH = Math.max(1, Math.ceil(height + effectPaddingY * 2));
|
|
11864
|
+
const physOffW = Math.ceil(offW * pixelRatio);
|
|
11865
|
+
const physOffH = Math.ceil(offH * pixelRatio);
|
|
11866
|
+
let bridge = bridges.get(layer.layerId);
|
|
11867
|
+
if (!bridge) {
|
|
11868
|
+
const canvas = document.createElement("canvas");
|
|
11869
|
+
canvas.width = physOffW;
|
|
11870
|
+
canvas.height = physOffH;
|
|
11871
|
+
const ctx = canvas.getContext("2d");
|
|
11872
|
+
const texture = Texture3.from(canvas);
|
|
11873
|
+
const sprite2 = new Sprite2(texture);
|
|
11874
|
+
container.addChild(sprite2);
|
|
11875
|
+
bridge = {
|
|
11876
|
+
sprite: sprite2,
|
|
11877
|
+
canvas,
|
|
11878
|
+
ctx,
|
|
11879
|
+
lastCacheKey: "",
|
|
11880
|
+
lastSeenFrame: frameId
|
|
11881
|
+
};
|
|
11882
|
+
bridges.set(layer.layerId, bridge);
|
|
11883
|
+
} else {
|
|
11884
|
+
if (bridge.canvas.width !== physOffW || bridge.canvas.height !== physOffH) {
|
|
11885
|
+
bridge.canvas.width = physOffW;
|
|
11886
|
+
bridge.canvas.height = physOffH;
|
|
11887
|
+
if (bridge.sprite.texture) {
|
|
11888
|
+
bridge.sprite.texture.destroy(false);
|
|
11889
|
+
}
|
|
11890
|
+
bridge.sprite.texture = Texture3.from(bridge.canvas);
|
|
11891
|
+
}
|
|
11892
|
+
if (bridge.sprite.parent !== container) {
|
|
11893
|
+
container.addChild(bridge.sprite);
|
|
11894
|
+
}
|
|
11895
|
+
}
|
|
11896
|
+
bridge.lastSeenFrame = frameId;
|
|
11897
|
+
if (bridge.lastCacheKey !== cacheKey) {
|
|
11898
|
+
const ctx = bridge.ctx;
|
|
11899
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
11900
|
+
ctx.clearRect(0, 0, bridge.canvas.width, bridge.canvas.height);
|
|
11901
|
+
ctx.save();
|
|
11902
|
+
ctx.scale(pixelRatio, pixelRatio);
|
|
11903
|
+
ctx.translate(width / 2 + effectPaddingX, height / 2 + effectPaddingY);
|
|
11904
|
+
await rasterizeTextCallback(ctx);
|
|
11905
|
+
ctx.restore();
|
|
11906
|
+
bridge.lastCacheKey = cacheKey;
|
|
11907
|
+
bridge.sprite.texture.source.update();
|
|
11908
|
+
}
|
|
11909
|
+
const centerX = layer.x + layer.width / 2;
|
|
11910
|
+
const centerY = layer.y + layer.height / 2;
|
|
11911
|
+
const physCenterX = (centerX * scale + offsetX) * pixelRatio;
|
|
11912
|
+
const physCenterY = (centerY * scale + offsetY) * pixelRatio;
|
|
11913
|
+
const sprite = bridge.sprite;
|
|
11914
|
+
sprite.anchor.set(0.5);
|
|
11915
|
+
sprite.position.set(physCenterX, physCenterY);
|
|
11916
|
+
sprite.rotation = layer.rotation * Math.PI / 180;
|
|
11917
|
+
sprite.alpha = layer.opacity;
|
|
11918
|
+
sprite.width = offW * pixelRatio;
|
|
11919
|
+
sprite.height = offH * pixelRatio;
|
|
11920
|
+
sprite.blendMode = mapPixiBlendMode(layer.blendMode);
|
|
11921
|
+
sprite.zIndex = renderOrder;
|
|
11922
|
+
sprite.visible = true;
|
|
11923
|
+
return sprite;
|
|
11924
|
+
}
|
|
11925
|
+
function unmountTextLayerBridge(layerId, container) {
|
|
11926
|
+
const bridge = bridges.get(layerId);
|
|
11927
|
+
if (bridge) {
|
|
11928
|
+
container.removeChild(bridge.sprite);
|
|
11929
|
+
if (bridge.sprite.texture) {
|
|
11930
|
+
bridge.sprite.texture.destroy(false);
|
|
11931
|
+
}
|
|
11932
|
+
bridge.sprite.destroy();
|
|
11933
|
+
bridges.delete(layerId);
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11936
|
+
function endTextFrame(frameId, container) {
|
|
11937
|
+
for (const [layerId, bridge] of bridges.entries()) {
|
|
11938
|
+
if (bridge.lastSeenFrame !== frameId) {
|
|
11939
|
+
bridge.sprite.visible = false;
|
|
11940
|
+
}
|
|
11941
|
+
if (frameId - bridge.lastSeenFrame > 180) {
|
|
11942
|
+
unmountTextLayerBridge(layerId, container);
|
|
11943
|
+
}
|
|
11944
|
+
}
|
|
11945
|
+
}
|
|
11946
|
+
function clearAllTextBridges(container) {
|
|
11947
|
+
for (const [layerId, bridge] of bridges.entries()) {
|
|
11948
|
+
if (container && bridge.sprite.parent === container) {
|
|
11949
|
+
container.removeChild(bridge.sprite);
|
|
11950
|
+
}
|
|
11951
|
+
if (bridge.sprite.texture) {
|
|
11952
|
+
bridge.sprite.texture.destroy(false);
|
|
11953
|
+
}
|
|
11954
|
+
bridge.sprite.destroy();
|
|
11955
|
+
}
|
|
11956
|
+
bridges.clear();
|
|
11957
|
+
}
|
|
11958
|
+
|
|
11959
|
+
// src/stickers/stickerBridge.ts
|
|
11960
|
+
import { Sprite as Sprite3, Texture as Texture4 } from "pixi.js";
|
|
11961
|
+
import lottie from "lottie-web";
|
|
11962
|
+
var bridges2 = /* @__PURE__ */ new Map();
|
|
11963
|
+
function mapPixiBlendMode2(blendMode) {
|
|
11964
|
+
const map = {
|
|
11965
|
+
normal: "normal",
|
|
11966
|
+
multiply: "multiply",
|
|
11967
|
+
screen: "screen",
|
|
11968
|
+
overlay: "overlay",
|
|
11969
|
+
darken: "darken",
|
|
11970
|
+
lighten: "lighten",
|
|
11971
|
+
add: "add"
|
|
11972
|
+
};
|
|
11973
|
+
return map[blendMode] || "normal";
|
|
11974
|
+
}
|
|
11975
|
+
function beginStickerFrame(container) {
|
|
11976
|
+
container.sortableChildren = true;
|
|
11977
|
+
}
|
|
11978
|
+
async function renderStickerLayerBridged(layer, lottieData, frameId, container, viewport, renderOrder, stickerId) {
|
|
11979
|
+
const { scale, offsetX, offsetY, pixelRatio } = viewport;
|
|
11980
|
+
const width = layer.width * scale;
|
|
11981
|
+
const height = layer.height * scale;
|
|
11982
|
+
const physW = Math.max(1, Math.ceil(width * pixelRatio));
|
|
11983
|
+
const physH = Math.max(1, Math.ceil(height * pixelRatio));
|
|
11984
|
+
let bridge = bridges2.get(layer.layerId);
|
|
11985
|
+
if (!bridge || bridge.stickerId !== stickerId) {
|
|
11986
|
+
if (bridge) {
|
|
11987
|
+
unmountStickerLayerBridge(layer.layerId, container);
|
|
11988
|
+
}
|
|
11989
|
+
try {
|
|
11990
|
+
const dpr = window.devicePixelRatio || 1;
|
|
11991
|
+
const htmlContainer = document.createElement("div");
|
|
11992
|
+
htmlContainer.style.width = `${physW / dpr}px`;
|
|
11993
|
+
htmlContainer.style.height = `${physH / dpr}px`;
|
|
11994
|
+
htmlContainer.style.position = "absolute";
|
|
11995
|
+
htmlContainer.style.left = "-9999px";
|
|
11996
|
+
htmlContainer.style.top = "-9999px";
|
|
11997
|
+
document.body.appendChild(htmlContainer);
|
|
11998
|
+
const anim = lottie.loadAnimation({
|
|
11999
|
+
container: htmlContainer,
|
|
12000
|
+
renderer: "canvas",
|
|
12001
|
+
autoplay: false,
|
|
12002
|
+
loop: true,
|
|
12003
|
+
animationData: JSON.parse(JSON.stringify(lottieData))
|
|
12004
|
+
});
|
|
12005
|
+
anim.goToAndStop(0, true);
|
|
12006
|
+
await Promise.resolve();
|
|
12007
|
+
const canvas = htmlContainer.querySelector("canvas");
|
|
12008
|
+
if (!canvas) {
|
|
12009
|
+
anim.destroy();
|
|
12010
|
+
htmlContainer.remove();
|
|
12011
|
+
return null;
|
|
12012
|
+
}
|
|
12013
|
+
const texture = Texture4.from(canvas);
|
|
12014
|
+
const sprite2 = new Sprite3(texture);
|
|
12015
|
+
container.addChild(sprite2);
|
|
12016
|
+
bridge = {
|
|
12017
|
+
sprite: sprite2,
|
|
12018
|
+
canvas,
|
|
12019
|
+
container: htmlContainer,
|
|
12020
|
+
anim,
|
|
12021
|
+
stickerId,
|
|
12022
|
+
lastCacheKey: "",
|
|
12023
|
+
lastSeenFrame: frameId
|
|
12024
|
+
};
|
|
12025
|
+
bridges2.set(layer.layerId, bridge);
|
|
12026
|
+
} catch (err) {
|
|
12027
|
+
console.error("[StickerBridge] Failed to initialize sticker animation:", err);
|
|
12028
|
+
return null;
|
|
12029
|
+
}
|
|
12030
|
+
} else {
|
|
12031
|
+
if (bridge.canvas.width !== physW || bridge.canvas.height !== physH) {
|
|
12032
|
+
const dpr = window.devicePixelRatio || 1;
|
|
12033
|
+
bridge.container.style.width = `${physW / dpr}px`;
|
|
12034
|
+
bridge.container.style.height = `${physH / dpr}px`;
|
|
12035
|
+
bridge.anim.resize();
|
|
12036
|
+
if (bridge.sprite.texture) {
|
|
12037
|
+
bridge.sprite.texture.destroy(false);
|
|
12038
|
+
}
|
|
12039
|
+
bridge.sprite.texture = Texture4.from(bridge.canvas);
|
|
12040
|
+
}
|
|
12041
|
+
if (bridge.sprite.parent !== container) {
|
|
12042
|
+
container.addChild(bridge.sprite);
|
|
12043
|
+
}
|
|
12044
|
+
}
|
|
12045
|
+
bridge.lastSeenFrame = frameId;
|
|
12046
|
+
const totalFrames = bridge.anim.totalFrames;
|
|
12047
|
+
const frameRate = bridge.anim.frameRate || 30;
|
|
12048
|
+
const speed = layer.stickerSettings?.speed ?? 1;
|
|
12049
|
+
const loop = layer.stickerSettings?.loop ?? true;
|
|
12050
|
+
let animFrame = Math.floor(layer.sourceTime * speed * frameRate);
|
|
12051
|
+
if (loop) {
|
|
12052
|
+
animFrame = animFrame % totalFrames;
|
|
12053
|
+
} else {
|
|
12054
|
+
animFrame = Math.min(animFrame, totalFrames - 1);
|
|
12055
|
+
}
|
|
12056
|
+
const cacheKey = `${layer.layerId}_${physW}_${physH}_${animFrame}_${layer.opacity}_${layer.blendMode}`;
|
|
12057
|
+
if (bridge.lastCacheKey !== cacheKey) {
|
|
12058
|
+
bridge.anim.goToAndStop(animFrame, true);
|
|
12059
|
+
await Promise.resolve();
|
|
12060
|
+
bridge.lastCacheKey = cacheKey;
|
|
12061
|
+
bridge.sprite.texture.source.update();
|
|
12062
|
+
}
|
|
12063
|
+
const centerX = layer.x + layer.width / 2;
|
|
12064
|
+
const centerY = layer.y + layer.height / 2;
|
|
12065
|
+
const physCenterX = (centerX * scale + offsetX) * pixelRatio;
|
|
12066
|
+
const physCenterY = (centerY * scale + offsetY) * pixelRatio;
|
|
12067
|
+
const sprite = bridge.sprite;
|
|
12068
|
+
sprite.anchor.set(0.5);
|
|
12069
|
+
sprite.position.set(physCenterX, physCenterY);
|
|
12070
|
+
sprite.rotation = layer.rotation * Math.PI / 180;
|
|
12071
|
+
sprite.alpha = layer.opacity;
|
|
12072
|
+
sprite.width = width * pixelRatio;
|
|
12073
|
+
sprite.height = height * pixelRatio;
|
|
12074
|
+
sprite.blendMode = mapPixiBlendMode2(layer.blendMode);
|
|
12075
|
+
sprite.zIndex = renderOrder;
|
|
12076
|
+
sprite.visible = true;
|
|
12077
|
+
return sprite;
|
|
12078
|
+
}
|
|
12079
|
+
function unmountStickerLayerBridge(layerId, container) {
|
|
12080
|
+
const bridge = bridges2.get(layerId);
|
|
12081
|
+
if (bridge) {
|
|
12082
|
+
container.removeChild(bridge.sprite);
|
|
12083
|
+
if (bridge.sprite.texture) {
|
|
12084
|
+
bridge.sprite.texture.destroy(false);
|
|
12085
|
+
}
|
|
12086
|
+
bridge.sprite.destroy();
|
|
12087
|
+
try {
|
|
12088
|
+
bridge.anim.destroy();
|
|
12089
|
+
} catch {
|
|
12090
|
+
}
|
|
12091
|
+
bridge.container.remove();
|
|
12092
|
+
bridges2.delete(layerId);
|
|
12093
|
+
}
|
|
12094
|
+
}
|
|
12095
|
+
function endStickerFrame(frameId, container) {
|
|
12096
|
+
for (const [layerId, bridge] of bridges2.entries()) {
|
|
12097
|
+
if (bridge.lastSeenFrame !== frameId) {
|
|
12098
|
+
bridge.sprite.visible = false;
|
|
12099
|
+
}
|
|
12100
|
+
if (frameId - bridge.lastSeenFrame > 180) {
|
|
12101
|
+
unmountStickerLayerBridge(layerId, container);
|
|
12102
|
+
}
|
|
12103
|
+
}
|
|
12104
|
+
}
|
|
12105
|
+
function clearAllStickerBridges(container) {
|
|
12106
|
+
for (const [layerId, bridge] of bridges2.entries()) {
|
|
12107
|
+
if (container && bridge.sprite.parent === container) {
|
|
12108
|
+
container.removeChild(bridge.sprite);
|
|
12109
|
+
}
|
|
12110
|
+
if (bridge.sprite.texture) {
|
|
12111
|
+
bridge.sprite.texture.destroy(false);
|
|
12112
|
+
}
|
|
12113
|
+
bridge.sprite.destroy();
|
|
12114
|
+
try {
|
|
12115
|
+
bridge.anim.destroy();
|
|
12116
|
+
} catch {
|
|
12117
|
+
}
|
|
12118
|
+
bridge.container.remove();
|
|
12119
|
+
}
|
|
12120
|
+
bridges2.clear();
|
|
12121
|
+
}
|
|
12122
|
+
|
|
12123
|
+
// src/renderer/sharedPixiRenderer.ts
|
|
12124
|
+
var registry = /* @__PURE__ */ new WeakMap();
|
|
12125
|
+
function getSharedPixiRenderer(canvas, width, height) {
|
|
12126
|
+
let entry = registry.get(canvas);
|
|
12127
|
+
if (!entry) {
|
|
12128
|
+
const renderer = new PixiRenderer();
|
|
12129
|
+
entry = { renderer, generation: 1 };
|
|
12130
|
+
registry.set(canvas, entry);
|
|
12131
|
+
void renderer.init(canvas, width, height);
|
|
12132
|
+
} else {
|
|
12133
|
+
const app = entry.renderer.getApp();
|
|
12134
|
+
if (app && (app.screen.width !== width || app.screen.height !== height)) {
|
|
12135
|
+
entry.renderer.resize(width, height);
|
|
12136
|
+
}
|
|
12137
|
+
}
|
|
12138
|
+
return entry.renderer;
|
|
12139
|
+
}
|
|
12140
|
+
function releaseSharedPixiRenderer(canvas) {
|
|
12141
|
+
const entry = registry.get(canvas);
|
|
12142
|
+
if (entry) {
|
|
12143
|
+
registry.delete(canvas);
|
|
12144
|
+
const overlayContainer = entry.renderer.getOverlayContainer();
|
|
12145
|
+
if (overlayContainer) {
|
|
12146
|
+
clearAllTextBridges(overlayContainer);
|
|
12147
|
+
clearAllStickerBridges(overlayContainer);
|
|
12148
|
+
}
|
|
12149
|
+
entry.renderer.destroy();
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
12152
|
+
|
|
12153
|
+
// src/media/mediaLayout.ts
|
|
12154
|
+
function calculateMediaFit(source, target, mode) {
|
|
12155
|
+
if (source.width <= 0 || source.height <= 0 || target.width <= 0 || target.height <= 0) {
|
|
12156
|
+
return {
|
|
12157
|
+
scaleX: 1,
|
|
12158
|
+
scaleY: 1,
|
|
12159
|
+
width: target.width,
|
|
12160
|
+
height: target.height,
|
|
12161
|
+
x: 0,
|
|
12162
|
+
y: 0
|
|
12163
|
+
};
|
|
12164
|
+
}
|
|
12165
|
+
if (mode === "stretch") {
|
|
12166
|
+
const scaleX2 = target.width / source.width;
|
|
12167
|
+
const scaleY2 = target.height / source.height;
|
|
12168
|
+
return {
|
|
12169
|
+
scaleX: scaleX2,
|
|
12170
|
+
scaleY: scaleY2,
|
|
12171
|
+
width: target.width,
|
|
12172
|
+
height: target.height,
|
|
12173
|
+
x: 0,
|
|
12174
|
+
y: 0
|
|
12175
|
+
};
|
|
12176
|
+
}
|
|
12177
|
+
if (mode === "original") {
|
|
12178
|
+
return {
|
|
12179
|
+
scaleX: 1,
|
|
12180
|
+
scaleY: 1,
|
|
12181
|
+
width: source.width,
|
|
12182
|
+
height: source.height,
|
|
12183
|
+
x: (target.width - source.width) / 2,
|
|
12184
|
+
y: (target.height - source.height) / 2
|
|
12185
|
+
};
|
|
12186
|
+
}
|
|
12187
|
+
const scaleX = target.width / source.width;
|
|
12188
|
+
const scaleY = target.height / source.height;
|
|
12189
|
+
const scale = mode === "cover" ? Math.max(scaleX, scaleY) : Math.min(scaleX, scaleY);
|
|
12190
|
+
const width = source.width * scale;
|
|
12191
|
+
const height = source.height * scale;
|
|
12192
|
+
return {
|
|
12193
|
+
scaleX: scale,
|
|
12194
|
+
scaleY: scale,
|
|
12195
|
+
width,
|
|
12196
|
+
height,
|
|
12197
|
+
x: (target.width - width) / 2,
|
|
12198
|
+
y: (target.height - height) / 2
|
|
12199
|
+
};
|
|
12200
|
+
}
|
|
12201
|
+
function calculateDefaultCoverCrop(source, target) {
|
|
12202
|
+
if (source.width <= 0 || source.height <= 0 || target.width <= 0 || target.height <= 0) {
|
|
12203
|
+
return { left: 0, top: 0, right: 0, bottom: 0 };
|
|
12204
|
+
}
|
|
12205
|
+
const scaleX = target.width / source.width;
|
|
12206
|
+
const scaleY = target.height / source.height;
|
|
12207
|
+
const scale = Math.max(scaleX, scaleY);
|
|
12208
|
+
const visibleWidthFraction = Math.min(1, target.width / (source.width * scale));
|
|
12209
|
+
const visibleHeightFraction = Math.min(1, target.height / (source.height * scale));
|
|
12210
|
+
const cropX = 1 - visibleWidthFraction;
|
|
12211
|
+
const cropY = 1 - visibleHeightFraction;
|
|
12212
|
+
return {
|
|
12213
|
+
left: cropX / 2,
|
|
12214
|
+
top: cropY / 2,
|
|
12215
|
+
right: cropX / 2,
|
|
12216
|
+
bottom: cropY / 2
|
|
12217
|
+
};
|
|
12218
|
+
}
|
|
12219
|
+
function getSourceCropRect(source, crop) {
|
|
12220
|
+
if (!crop) {
|
|
12221
|
+
return { x: 0, y: 0, width: source.width, height: source.height };
|
|
12222
|
+
}
|
|
12223
|
+
const left = Math.max(0, Math.min(1, crop.left));
|
|
12224
|
+
const top = Math.max(0, Math.min(1, crop.top));
|
|
12225
|
+
const right = Math.max(0, Math.min(1, crop.right));
|
|
12226
|
+
const bottom = Math.max(0, Math.min(1, crop.bottom));
|
|
12227
|
+
if (left + right >= 1 || top + bottom >= 1) {
|
|
12228
|
+
return { x: 0, y: 0, width: source.width, height: source.height };
|
|
12229
|
+
}
|
|
12230
|
+
const x = left * source.width;
|
|
12231
|
+
const y = top * source.height;
|
|
12232
|
+
const width = (1 - left - right) * source.width;
|
|
12233
|
+
const height = (1 - top - bottom) * source.height;
|
|
12234
|
+
return { x, y, width, height };
|
|
12235
|
+
}
|
|
12236
|
+
function rotateCrop(crop, rotation) {
|
|
12237
|
+
if (!rotation || rotation === 0) return crop;
|
|
12238
|
+
const rot = (rotation + 360) % 360;
|
|
12239
|
+
if (rot === 90) {
|
|
12240
|
+
return {
|
|
12241
|
+
left: crop.bottom,
|
|
12242
|
+
top: crop.left,
|
|
12243
|
+
right: crop.top,
|
|
12244
|
+
bottom: crop.right
|
|
12245
|
+
};
|
|
12246
|
+
}
|
|
12247
|
+
if (rot === 180) {
|
|
12248
|
+
return {
|
|
12249
|
+
left: crop.right,
|
|
12250
|
+
top: crop.bottom,
|
|
12251
|
+
right: crop.left,
|
|
12252
|
+
bottom: crop.top
|
|
12253
|
+
};
|
|
12254
|
+
}
|
|
12255
|
+
if (rot === 270) {
|
|
12256
|
+
return {
|
|
12257
|
+
left: crop.top,
|
|
12258
|
+
top: crop.right,
|
|
12259
|
+
right: crop.bottom,
|
|
12260
|
+
bottom: crop.left
|
|
12261
|
+
};
|
|
12262
|
+
}
|
|
12263
|
+
return crop;
|
|
12264
|
+
}
|
|
12265
|
+
function calculateCropFromFocalPoint(source, target, focalPoint) {
|
|
12266
|
+
if (source.width <= 0 || source.height <= 0 || target.width <= 0 || target.height <= 0) {
|
|
12267
|
+
return { left: 0, top: 0, right: 0, bottom: 0 };
|
|
12268
|
+
}
|
|
12269
|
+
const scaleX = target.width / source.width;
|
|
12270
|
+
const scaleY = target.height / source.height;
|
|
12271
|
+
const scale = Math.max(scaleX, scaleY);
|
|
12272
|
+
const visibleWidthFraction = Math.min(1, target.width / (source.width * scale));
|
|
12273
|
+
const visibleHeightFraction = Math.min(1, target.height / (source.height * scale));
|
|
12274
|
+
const fx = Math.max(0, Math.min(1, focalPoint.x));
|
|
12275
|
+
const fy = Math.max(0, Math.min(1, focalPoint.y));
|
|
12276
|
+
let left = fx - visibleWidthFraction / 2;
|
|
12277
|
+
let top = fy - visibleHeightFraction / 2;
|
|
12278
|
+
left = Math.max(0, Math.min(left, 1 - visibleWidthFraction));
|
|
12279
|
+
top = Math.max(0, Math.min(top, 1 - visibleHeightFraction));
|
|
12280
|
+
const right = Math.max(0, 1 - left - visibleWidthFraction);
|
|
12281
|
+
const bottom = Math.max(0, 1 - top - visibleHeightFraction);
|
|
12282
|
+
return {
|
|
12283
|
+
left,
|
|
12284
|
+
top,
|
|
12285
|
+
right,
|
|
12286
|
+
bottom
|
|
12287
|
+
};
|
|
12288
|
+
}
|
|
12289
|
+
function resolveMediaLayout(params) {
|
|
12290
|
+
const { sourceSize, projectFrame, layout } = params;
|
|
12291
|
+
const fit = layout?.fit ?? "cover";
|
|
12292
|
+
const focalPoint = layout?.focalPoint ?? { x: 0.5, y: 0.5 };
|
|
12293
|
+
const transform = layout?.transform ?? {
|
|
12294
|
+
x: projectFrame.width / 2,
|
|
12295
|
+
y: projectFrame.height / 2,
|
|
12296
|
+
scaleX: 1,
|
|
12297
|
+
scaleY: 1,
|
|
12298
|
+
rotation: 0
|
|
12299
|
+
};
|
|
12300
|
+
let crop = layout?.crop;
|
|
12301
|
+
if (!crop && fit === "cover") {
|
|
12302
|
+
crop = calculateCropFromFocalPoint(sourceSize, projectFrame, focalPoint);
|
|
12303
|
+
}
|
|
12304
|
+
const sourceRect = getSourceCropRect(sourceSize, crop);
|
|
12305
|
+
const fitResult = calculateMediaFit({ width: sourceRect.width, height: sourceRect.height }, projectFrame, fit);
|
|
12306
|
+
const scaleX = fitResult.scaleX * transform.scaleX;
|
|
12307
|
+
const scaleY = fitResult.scaleY * transform.scaleY;
|
|
12308
|
+
const rotation = transform.rotation;
|
|
12309
|
+
return {
|
|
12310
|
+
fit,
|
|
12311
|
+
focalPoint,
|
|
12312
|
+
sourceRect,
|
|
12313
|
+
width: sourceRect.width * fitResult.scaleX,
|
|
12314
|
+
height: sourceRect.height * fitResult.scaleY,
|
|
12315
|
+
x: transform.x,
|
|
12316
|
+
y: transform.y,
|
|
12317
|
+
scaleX,
|
|
12318
|
+
scaleY,
|
|
12319
|
+
rotation
|
|
12320
|
+
};
|
|
12321
|
+
}
|
|
12322
|
+
function getClipLayout(clip, sourceSize, projectFrame) {
|
|
12323
|
+
const fitMode = clip.fitMode ?? "cover";
|
|
12324
|
+
const fitModeClean = fitMode === "fill" ? "cover" : fitMode;
|
|
12325
|
+
const fitResult = calculateMediaFit(sourceSize, projectFrame, fitModeClean);
|
|
12326
|
+
const fitW = fitResult.width || projectFrame.width || 1;
|
|
12327
|
+
const fitH = fitResult.height || projectFrame.height || 1;
|
|
12328
|
+
return {
|
|
12329
|
+
fit: fitModeClean,
|
|
12330
|
+
focalPoint: clip.layout?.focalPoint ?? { x: 0.5, y: 0.5 },
|
|
12331
|
+
transform: {
|
|
12332
|
+
x: clip.x + clip.width / 2,
|
|
12333
|
+
y: clip.y + clip.height / 2,
|
|
12334
|
+
scaleX: clip.width / fitW,
|
|
12335
|
+
scaleY: clip.height / fitH,
|
|
12336
|
+
rotation: clip.rotation
|
|
12337
|
+
},
|
|
12338
|
+
crop: clip.layout?.crop
|
|
12339
|
+
};
|
|
12340
|
+
}
|
|
12341
|
+
|
|
12342
|
+
// src/media/mediaSpriteFactory.ts
|
|
12343
|
+
import { Sprite as Sprite4, Texture as Texture5, VideoSource } from "pixi.js";
|
|
12344
|
+
|
|
12345
|
+
// src/media/conform.ts
|
|
12346
|
+
function resolveConform(conform, canvasWidth, canvasHeight) {
|
|
12347
|
+
const { mode, sourceWidth: sw, sourceHeight: sh, userScale, userOffsetX, userOffsetY } = conform;
|
|
12348
|
+
if (!sw || !sh) {
|
|
12349
|
+
return { x: 0, y: 0, width: canvasWidth, height: canvasHeight };
|
|
12350
|
+
}
|
|
12351
|
+
let baseScale;
|
|
12352
|
+
switch (mode) {
|
|
12353
|
+
case "fit":
|
|
12354
|
+
baseScale = Math.min(canvasWidth / sw, canvasHeight / sh);
|
|
12355
|
+
break;
|
|
12356
|
+
case "fill":
|
|
12357
|
+
case "smart":
|
|
12358
|
+
baseScale = Math.max(canvasWidth / sw, canvasHeight / sh);
|
|
12359
|
+
break;
|
|
12360
|
+
case "none":
|
|
12361
|
+
baseScale = 1;
|
|
12362
|
+
break;
|
|
12363
|
+
default:
|
|
12364
|
+
baseScale = Math.min(canvasWidth / sw, canvasHeight / sh);
|
|
12365
|
+
}
|
|
12366
|
+
const finalScale = baseScale * userScale;
|
|
12367
|
+
const width = sw * finalScale;
|
|
12368
|
+
const height = sh * finalScale;
|
|
12369
|
+
const x = (canvasWidth - width) / 2 + userOffsetX;
|
|
12370
|
+
const y = (canvasHeight - height) / 2 + userOffsetY;
|
|
12371
|
+
return { x, y, width, height };
|
|
12372
|
+
}
|
|
12373
|
+
|
|
12374
|
+
// src/media/mediaSpriteFactory.ts
|
|
12375
|
+
function canCreateVideoTexture(video) {
|
|
12376
|
+
return video.readyState >= HTMLMediaElement.HAVE_METADATA && video.videoWidth > 0 && video.videoHeight > 0;
|
|
12377
|
+
}
|
|
12378
|
+
var pendingVideoLayers = /* @__PURE__ */ new Map();
|
|
12379
|
+
function clearPendingVideoLayers() {
|
|
12380
|
+
pendingVideoLayers.clear();
|
|
12381
|
+
}
|
|
12382
|
+
var mediaRegistry = /* @__PURE__ */ new Map();
|
|
12383
|
+
function getActiveMediaSpriteKeys() {
|
|
12384
|
+
return Array.from(mediaRegistry.keys());
|
|
12385
|
+
}
|
|
12386
|
+
function getMediaSpriteRecord(clipId) {
|
|
12387
|
+
return mediaRegistry.get(clipId);
|
|
12388
|
+
}
|
|
12389
|
+
function applyMediaTransform(sprite, layer, viewport) {
|
|
12390
|
+
const { projectWidth, projectHeight } = viewport;
|
|
12391
|
+
const conform = layer.conform || {
|
|
12392
|
+
mode: "fit",
|
|
12393
|
+
sourceWidth: layer.width || 0,
|
|
12394
|
+
sourceHeight: layer.height || 0,
|
|
12395
|
+
userScale: 1,
|
|
12396
|
+
userOffsetX: 0,
|
|
12397
|
+
userOffsetY: 0
|
|
12398
|
+
};
|
|
12399
|
+
const { x, y, width, height } = resolveConform(conform, projectWidth || 1920, projectHeight || 1080);
|
|
12400
|
+
const isTransposed = layer.sourceRotation === 90 || layer.sourceRotation === 270;
|
|
12401
|
+
sprite.anchor.set(0, 0);
|
|
12402
|
+
sprite.position.set(x, y);
|
|
12403
|
+
sprite.width = isTransposed ? height : width;
|
|
12404
|
+
sprite.height = isTransposed ? width : height;
|
|
12405
|
+
const sw = sprite.texture.source.width;
|
|
12406
|
+
const sh = sprite.texture.source.height;
|
|
12407
|
+
if (sw && sh) {
|
|
12408
|
+
const currFrame = sprite.texture.frame;
|
|
12409
|
+
if (currFrame && (currFrame.x !== 0 || currFrame.y !== 0 || currFrame.width !== sw || currFrame.height !== sh)) {
|
|
12410
|
+
sprite.texture.frame.x = 0;
|
|
12411
|
+
sprite.texture.frame.y = 0;
|
|
12412
|
+
sprite.texture.frame.width = sw;
|
|
12413
|
+
sprite.texture.frame.height = sh;
|
|
12414
|
+
sprite.texture.orig.x = 0;
|
|
12415
|
+
sprite.texture.orig.y = 0;
|
|
12416
|
+
sprite.texture.orig.width = sw;
|
|
12417
|
+
sprite.texture.orig.height = sh;
|
|
12418
|
+
if (typeof sprite.texture.updateUvs === "function") {
|
|
12419
|
+
sprite.texture.updateUvs();
|
|
12420
|
+
}
|
|
12421
|
+
if (typeof sprite.onViewUpdate === "function") {
|
|
12422
|
+
sprite.onViewUpdate();
|
|
12423
|
+
}
|
|
12424
|
+
}
|
|
12425
|
+
}
|
|
12426
|
+
sprite.rotation = ((layer.rotation || 0) + (layer.sourceRotation || 0)) * Math.PI / 180;
|
|
12427
|
+
sprite.alpha = layer.opacity;
|
|
12428
|
+
}
|
|
12429
|
+
function releaseMediaSprite(clipId, container) {
|
|
12430
|
+
const record = mediaRegistry.get(clipId);
|
|
12431
|
+
if (record) {
|
|
12432
|
+
container.removeChild(record.sprite);
|
|
12433
|
+
record.sprite.destroy();
|
|
12434
|
+
record.texture.destroy(false);
|
|
12435
|
+
record.destroyed = true;
|
|
12436
|
+
mediaRegistry.delete(clipId);
|
|
12437
|
+
}
|
|
12438
|
+
}
|
|
12439
|
+
function getOrCreateMediaSprite(clipId, kind, sourceElement, container) {
|
|
12440
|
+
let record = mediaRegistry.get(clipId);
|
|
12441
|
+
if (record) {
|
|
12442
|
+
const isVideo = kind === "video";
|
|
12443
|
+
const videoEl = sourceElement;
|
|
12444
|
+
const dimensionsMismatch = isVideo && videoEl.videoWidth > 0 && (record.texture.source.width !== videoEl.videoWidth || record.texture.source.height !== videoEl.videoHeight);
|
|
12445
|
+
if (record.sourceIdentity !== sourceElement || dimensionsMismatch) {
|
|
12446
|
+
releaseMediaSprite(clipId, container);
|
|
12447
|
+
record = void 0;
|
|
12448
|
+
}
|
|
12449
|
+
}
|
|
12450
|
+
if (!record) {
|
|
12451
|
+
let source;
|
|
12452
|
+
let texture;
|
|
12453
|
+
if (kind === "video") {
|
|
12454
|
+
const video = sourceElement;
|
|
12455
|
+
if (!canCreateVideoTexture(video)) {
|
|
12456
|
+
const pending = pendingVideoLayers.get(clipId);
|
|
12457
|
+
if (!pending || pending.video !== video) {
|
|
12458
|
+
pendingVideoLayers.set(clipId, { video, container, setupListeners: false });
|
|
12459
|
+
}
|
|
12460
|
+
if (!pending?.setupListeners) {
|
|
12461
|
+
const onMetadataReady = () => {
|
|
12462
|
+
pendingVideoLayers.delete(clipId);
|
|
12463
|
+
};
|
|
12464
|
+
video.addEventListener("loadedmetadata", onMetadataReady, { once: true });
|
|
12465
|
+
video.addEventListener("loadeddata", onMetadataReady, { once: true });
|
|
12466
|
+
if (pending) {
|
|
12467
|
+
pending.setupListeners = true;
|
|
12468
|
+
}
|
|
12469
|
+
}
|
|
12470
|
+
return null;
|
|
12471
|
+
}
|
|
12472
|
+
source = new VideoSource({ resource: video, autoPlay: false });
|
|
12473
|
+
texture = new Texture5({ source });
|
|
12474
|
+
pendingVideoLayers.delete(clipId);
|
|
12475
|
+
} else {
|
|
12476
|
+
source = null;
|
|
12477
|
+
const baseTexture = Texture5.from(sourceElement);
|
|
12478
|
+
texture = new Texture5({ source: baseTexture.source });
|
|
12479
|
+
}
|
|
12480
|
+
const sprite = new Sprite4(texture);
|
|
12481
|
+
container.addChild(sprite);
|
|
12482
|
+
record = {
|
|
12483
|
+
clipId,
|
|
12484
|
+
kind,
|
|
12485
|
+
sprite,
|
|
12486
|
+
texture,
|
|
12487
|
+
source,
|
|
12488
|
+
sourceIdentity: sourceElement,
|
|
12489
|
+
lastSeenFrame: 0,
|
|
12490
|
+
width: sprite.width,
|
|
12491
|
+
height: sprite.height,
|
|
12492
|
+
destroyed: false
|
|
12493
|
+
};
|
|
12494
|
+
mediaRegistry.set(clipId, record);
|
|
12495
|
+
} else {
|
|
12496
|
+
if (record.sprite.parent !== container) {
|
|
12497
|
+
container.addChild(record.sprite);
|
|
12498
|
+
}
|
|
12499
|
+
}
|
|
12500
|
+
return record;
|
|
12501
|
+
}
|
|
12502
|
+
function clearAllMediaSprites(container) {
|
|
12503
|
+
for (const [clipId, record] of mediaRegistry.entries()) {
|
|
12504
|
+
if (container && record.sprite.parent === container) {
|
|
12505
|
+
container.removeChild(record.sprite);
|
|
12506
|
+
}
|
|
12507
|
+
record.sprite.destroy();
|
|
12508
|
+
record.texture.destroy(false);
|
|
12509
|
+
}
|
|
12510
|
+
mediaRegistry.clear();
|
|
12511
|
+
}
|
|
12512
|
+
|
|
12513
|
+
// src/media/sourceCapture.ts
|
|
12514
|
+
function captureVideoSourceDimensions(videoEl, onCaptured) {
|
|
12515
|
+
if (videoEl.readyState >= 1 && videoEl.videoWidth && videoEl.videoHeight) {
|
|
12516
|
+
onCaptured(videoEl.videoWidth, videoEl.videoHeight);
|
|
12517
|
+
return;
|
|
12518
|
+
}
|
|
12519
|
+
videoEl.addEventListener(
|
|
12520
|
+
"loadedmetadata",
|
|
12521
|
+
() => onCaptured(videoEl.videoWidth, videoEl.videoHeight),
|
|
12522
|
+
{ once: true }
|
|
12523
|
+
);
|
|
12524
|
+
}
|
|
12525
|
+
function captureImageSourceDimensions(imageEl) {
|
|
12526
|
+
return { width: imageEl.naturalWidth || imageEl.width, height: imageEl.naturalHeight || imageEl.height };
|
|
12527
|
+
}
|
|
12528
|
+
|
|
12529
|
+
// src/effects/body/bodyEffectFilters.ts
|
|
12530
|
+
import { Filter as Filter8 } from "pixi.js";
|
|
12531
|
+
var VERTEX_SHADER = `
|
|
12532
|
+
in vec2 aPosition;
|
|
12533
|
+
out vec2 vTextureCoord;
|
|
12534
|
+
|
|
12535
|
+
uniform vec4 uInputSize;
|
|
12536
|
+
uniform vec4 uOutputFrame;
|
|
12537
|
+
uniform vec4 uOutputTexture;
|
|
12538
|
+
|
|
12539
|
+
vec4 filterVertexPosition(void) {
|
|
12540
|
+
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
12541
|
+
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
12542
|
+
position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
12543
|
+
return vec4(position, 0.0, 1.0);
|
|
12544
|
+
}
|
|
12545
|
+
|
|
12546
|
+
vec2 filterTextureCoord(void) {
|
|
12547
|
+
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
12548
|
+
}
|
|
12549
|
+
|
|
12550
|
+
void main(void) {
|
|
12551
|
+
gl_Position = filterVertexPosition();
|
|
12552
|
+
vTextureCoord = filterTextureCoord();
|
|
12553
|
+
}
|
|
12554
|
+
`;
|
|
12555
|
+
function hexToRgbNormalized(hex) {
|
|
12556
|
+
let clean = hex.replace("#", "");
|
|
12557
|
+
if (clean.length === 3) {
|
|
12558
|
+
clean = clean[0] + clean[0] + clean[1] + clean[1] + clean[2] + clean[2];
|
|
12559
|
+
}
|
|
12560
|
+
const num = parseInt(clean, 16);
|
|
12561
|
+
return [
|
|
12562
|
+
(num >> 16 & 255) / 255,
|
|
12563
|
+
(num >> 8 & 255) / 255,
|
|
12564
|
+
(num & 255) / 255
|
|
12565
|
+
];
|
|
12566
|
+
}
|
|
12567
|
+
function createGPUBodyOutlineFilter(maskTexture, colorHex, thickness) {
|
|
12568
|
+
const fragmentShader = `
|
|
12569
|
+
precision mediump float;
|
|
12570
|
+
in vec2 vTextureCoord;
|
|
12571
|
+
out vec4 fragColor;
|
|
12572
|
+
uniform sampler2D uSampler;
|
|
12573
|
+
uniform sampler2D uMask;
|
|
12574
|
+
uniform vec4 uOutlineColor;
|
|
12575
|
+
uniform float uThickness;
|
|
12576
|
+
uniform vec4 uInputSize;
|
|
12577
|
+
|
|
12578
|
+
void main(void) {
|
|
12579
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12580
|
+
float maskAlpha = texture(uMask, vTextureCoord).a;
|
|
12581
|
+
if (maskAlpha > 0.1) {
|
|
12582
|
+
fragColor = base;
|
|
12583
|
+
return;
|
|
12584
|
+
}
|
|
12585
|
+
float border = 0.0;
|
|
12586
|
+
vec2 texelSize = vec2(uThickness) * uInputSize.zw;
|
|
12587
|
+
for (float x = -1.0; x <= 1.0; x += 1.0) {
|
|
12588
|
+
for (float y = -1.0; y <= 1.0; y += 1.0) {
|
|
12589
|
+
if (x == 0.0 && y == 0.0) continue;
|
|
12590
|
+
float a = texture(uMask, vTextureCoord + vec2(x, y) * texelSize).a;
|
|
12591
|
+
if (a > 0.1) {
|
|
12592
|
+
border = 1.0;
|
|
12593
|
+
break;
|
|
12594
|
+
}
|
|
12595
|
+
}
|
|
12596
|
+
}
|
|
12597
|
+
if (border > 0.0) {
|
|
12598
|
+
fragColor = uOutlineColor;
|
|
12599
|
+
} else {
|
|
12600
|
+
fragColor = base;
|
|
12601
|
+
}
|
|
12602
|
+
}
|
|
12603
|
+
`;
|
|
12604
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12605
|
+
const originalFilterFrom = Filter8.from;
|
|
12606
|
+
Filter8.from = function(options) {
|
|
12607
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12608
|
+
options.resources.uMask = maskTexture.source;
|
|
12609
|
+
}
|
|
12610
|
+
return originalFilterFrom.call(this, options);
|
|
12611
|
+
};
|
|
12612
|
+
try {
|
|
12613
|
+
const filter = Filter8.from({
|
|
12614
|
+
gl: {
|
|
12615
|
+
vertex: VERTEX_SHADER,
|
|
12616
|
+
fragment: fragmentShader
|
|
12617
|
+
},
|
|
12618
|
+
resources: {
|
|
12619
|
+
customUniforms: {
|
|
12620
|
+
uOutlineColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12621
|
+
uThickness: { value: thickness, type: "f32" }
|
|
12622
|
+
}
|
|
12623
|
+
}
|
|
12624
|
+
});
|
|
12625
|
+
filter.resources.uMask = maskTexture.source;
|
|
12626
|
+
return filter;
|
|
12627
|
+
} finally {
|
|
12628
|
+
Filter8.from = originalFilterFrom;
|
|
12629
|
+
}
|
|
12630
|
+
}
|
|
12631
|
+
function createGPUBodyGlowFilter(maskTexture, colorHex, radius, intensity) {
|
|
12632
|
+
const fragmentShader = `
|
|
12633
|
+
precision mediump float;
|
|
12634
|
+
in vec2 vTextureCoord;
|
|
12635
|
+
out vec4 fragColor;
|
|
12636
|
+
uniform sampler2D uSampler;
|
|
12637
|
+
uniform sampler2D uMask;
|
|
12638
|
+
uniform vec4 uGlowColor;
|
|
12639
|
+
uniform float uGlowRadius;
|
|
12640
|
+
uniform float uGlowIntensity;
|
|
12641
|
+
uniform vec4 uInputSize;
|
|
12642
|
+
|
|
12643
|
+
void main(void) {
|
|
12644
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12645
|
+
float maskAlpha = texture(uMask, vTextureCoord).a;
|
|
12646
|
+
|
|
12647
|
+
float blur = 0.0;
|
|
12648
|
+
float total = 0.0;
|
|
12649
|
+
vec2 texelSize = vec2(uGlowRadius) * uInputSize.zw;
|
|
12650
|
+
|
|
12651
|
+
for (float x = -2.0; x <= 2.0; x += 1.0) {
|
|
12652
|
+
for (float y = -2.0; y <= 2.0; y += 1.0) {
|
|
12653
|
+
float weight = (3.0 - abs(x)) * (3.0 - abs(y));
|
|
12654
|
+
float a = texture(uMask, vTextureCoord + vec2(x, y) * texelSize * 0.5).a;
|
|
12655
|
+
blur += a * weight;
|
|
12656
|
+
total += weight;
|
|
12657
|
+
}
|
|
12658
|
+
}
|
|
12659
|
+
|
|
12660
|
+
float glow = (blur / total) * uGlowIntensity;
|
|
12661
|
+
|
|
12662
|
+
if (maskAlpha > 0.1) {
|
|
12663
|
+
fragColor = vec4(mix(base.rgb, uGlowColor.rgb, 0.15 * uGlowIntensity), base.a);
|
|
12664
|
+
} else {
|
|
12665
|
+
fragColor = vec4(mix(base.rgb, uGlowColor.rgb, glow), max(base.a, glow * uGlowColor.a));
|
|
12666
|
+
}
|
|
12667
|
+
}
|
|
12668
|
+
`;
|
|
12669
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12670
|
+
const originalFilterFrom = Filter8.from;
|
|
12671
|
+
Filter8.from = function(options) {
|
|
12672
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12673
|
+
options.resources.uMask = maskTexture.source;
|
|
12674
|
+
}
|
|
12675
|
+
return originalFilterFrom.call(this, options);
|
|
12676
|
+
};
|
|
12677
|
+
try {
|
|
12678
|
+
const filter = Filter8.from({
|
|
12679
|
+
gl: {
|
|
12680
|
+
vertex: VERTEX_SHADER,
|
|
12681
|
+
fragment: fragmentShader
|
|
12682
|
+
},
|
|
12683
|
+
resources: {
|
|
12684
|
+
customUniforms: {
|
|
12685
|
+
uGlowColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12686
|
+
uGlowRadius: { value: radius, type: "f32" },
|
|
12687
|
+
uGlowIntensity: { value: intensity, type: "f32" }
|
|
12688
|
+
}
|
|
12689
|
+
}
|
|
12690
|
+
});
|
|
12691
|
+
filter.resources.uMask = maskTexture.source;
|
|
12692
|
+
return filter;
|
|
12693
|
+
} finally {
|
|
12694
|
+
Filter8.from = originalFilterFrom;
|
|
12695
|
+
}
|
|
12696
|
+
}
|
|
12697
|
+
function createGPUBodyParticlesFilter(maskTexture, colorHex, particleCount, intensity, time) {
|
|
12698
|
+
const fragmentShader = `
|
|
12699
|
+
precision mediump float;
|
|
12700
|
+
in vec2 vTextureCoord;
|
|
12701
|
+
out vec4 fragColor;
|
|
12702
|
+
uniform sampler2D uSampler;
|
|
12703
|
+
uniform sampler2D uMask;
|
|
12704
|
+
uniform vec4 uParticleColor;
|
|
12705
|
+
uniform float uTime;
|
|
12706
|
+
uniform float uIntensity;
|
|
12707
|
+
uniform float uCount;
|
|
12708
|
+
|
|
12709
|
+
float rand(float n) { return fract(sin(n) * 43758.5453123); }
|
|
12710
|
+
|
|
12711
|
+
void main(void) {
|
|
12712
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12713
|
+
vec4 maskVal = texture(uMask, vTextureCoord);
|
|
12714
|
+
|
|
12715
|
+
float particleOverlay = 0.0;
|
|
12716
|
+
|
|
12717
|
+
for (float i = 0.0; i < 40.0; i += 1.0) {
|
|
12718
|
+
if (i >= uCount) break;
|
|
12719
|
+
float seedX = i * 37.0;
|
|
12720
|
+
float seedY = i * 43.0;
|
|
12721
|
+
|
|
12722
|
+
vec2 pPos = vec2(rand(seedX), rand(seedY));
|
|
12723
|
+
pPos.y -= fract(uTime * 0.1 + rand(i * 17.0)) * 0.4 * uIntensity;
|
|
12724
|
+
pPos.x += sin(uTime * 2.0 + i) * 0.015 * uIntensity;
|
|
12725
|
+
|
|
12726
|
+
float d = distance(vTextureCoord, pPos);
|
|
12727
|
+
float size = 0.001 + rand(i * 53.0) * 0.003;
|
|
12728
|
+
|
|
12729
|
+
if (d < size) {
|
|
12730
|
+
float maskAtParticle = texture(uMask, pPos).a;
|
|
12731
|
+
if (maskAtParticle > 0.1) {
|
|
12732
|
+
float alpha = smoothstep(size, size - 0.001, d);
|
|
12733
|
+
particleOverlay = max(particleOverlay, alpha);
|
|
12734
|
+
}
|
|
12735
|
+
}
|
|
12736
|
+
}
|
|
12737
|
+
|
|
12738
|
+
if (particleOverlay > 0.0) {
|
|
12739
|
+
fragColor = vec4(mix(base.rgb, uParticleColor.rgb, particleOverlay), base.a);
|
|
12740
|
+
} else {
|
|
12741
|
+
fragColor = base;
|
|
12742
|
+
}
|
|
12743
|
+
}
|
|
12744
|
+
`;
|
|
12745
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12746
|
+
const originalFilterFrom = Filter8.from;
|
|
12747
|
+
Filter8.from = function(options) {
|
|
12748
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12749
|
+
options.resources.uMask = maskTexture.source;
|
|
12750
|
+
}
|
|
12751
|
+
return originalFilterFrom.call(this, options);
|
|
12752
|
+
};
|
|
12753
|
+
try {
|
|
12754
|
+
const filter = Filter8.from({
|
|
12755
|
+
gl: {
|
|
12756
|
+
vertex: VERTEX_SHADER,
|
|
12757
|
+
fragment: fragmentShader
|
|
12758
|
+
},
|
|
12759
|
+
resources: {
|
|
12760
|
+
customUniforms: {
|
|
12761
|
+
uParticleColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12762
|
+
uTime: { value: time, type: "f32" },
|
|
12763
|
+
uIntensity: { value: intensity, type: "f32" },
|
|
12764
|
+
uCount: { value: Math.min(40, particleCount), type: "f32" }
|
|
12765
|
+
}
|
|
12766
|
+
}
|
|
12767
|
+
});
|
|
12768
|
+
filter.resources.uMask = maskTexture.source;
|
|
12769
|
+
return filter;
|
|
12770
|
+
} finally {
|
|
12771
|
+
Filter8.from = originalFilterFrom;
|
|
12772
|
+
}
|
|
12773
|
+
}
|
|
12774
|
+
|
|
12775
|
+
// src/effects/body/bodyEffectMask.ts
|
|
12776
|
+
import { Texture as Texture7 } from "pixi.js";
|
|
12777
|
+
var maskTextures = /* @__PURE__ */ new Map();
|
|
12778
|
+
function applyBodyEffectMask(clipId, maskData) {
|
|
12779
|
+
let maskTexture = maskTextures.get(clipId);
|
|
12780
|
+
if (!maskTexture) {
|
|
12781
|
+
maskTexture = Texture7.from(maskData);
|
|
12782
|
+
maskTextures.set(clipId, maskTexture);
|
|
12783
|
+
} else {
|
|
12784
|
+
maskTexture.source.update();
|
|
12785
|
+
}
|
|
12786
|
+
return maskTexture;
|
|
12787
|
+
}
|
|
12788
|
+
function clearBodyEffectMask(clipId) {
|
|
12789
|
+
const maskTexture = maskTextures.get(clipId);
|
|
12790
|
+
if (maskTexture) {
|
|
12791
|
+
maskTexture.destroy(true);
|
|
12792
|
+
maskTextures.delete(clipId);
|
|
12793
|
+
}
|
|
12794
|
+
}
|
|
12795
|
+
function clearAllBodyEffectMasks() {
|
|
12796
|
+
for (const [clipId, texture] of maskTextures.entries()) {
|
|
12797
|
+
texture.destroy(true);
|
|
12798
|
+
}
|
|
12799
|
+
maskTextures.clear();
|
|
12800
|
+
}
|
|
12801
|
+
|
|
12981
12802
|
// src/index.ts
|
|
12982
12803
|
var VERSION = "0.1.0";
|
|
12983
12804
|
export {
|
|
12805
|
+
ALL_TRANSITIONS,
|
|
12984
12806
|
AlphaEffect,
|
|
12985
12807
|
AnimationPresetSchema,
|
|
12986
12808
|
AnimationSchema,
|
|
@@ -12993,12 +12815,14 @@ export {
|
|
|
12993
12815
|
CUSTOM_ENGINE_IDS,
|
|
12994
12816
|
camera_exports as CameraEffects,
|
|
12995
12817
|
CanvasDevice,
|
|
12818
|
+
ChromaticPushTransition,
|
|
12996
12819
|
CinematicLUTEffect,
|
|
12997
12820
|
ColorAdjustmentsEffect,
|
|
12998
12821
|
ColorGradientEffect,
|
|
12999
12822
|
ColorMatrixEffect,
|
|
13000
12823
|
ColorOverlayEffect,
|
|
13001
12824
|
CommandBufferBuilder,
|
|
12825
|
+
CrossDissolveTransition,
|
|
13002
12826
|
CrossHatchEffect,
|
|
13003
12827
|
DEFAULT_CANVAS_HEIGHT,
|
|
13004
12828
|
DEFAULT_CANVAS_WIDTH,
|
|
@@ -13006,6 +12830,8 @@ export {
|
|
|
13006
12830
|
DEFAULT_FONT_SIZE,
|
|
13007
12831
|
DEFAULT_FPS,
|
|
13008
12832
|
DEFAULT_TEXT_STYLE,
|
|
12833
|
+
DepthPushTransition,
|
|
12834
|
+
DirectionalDissolveTransition,
|
|
13009
12835
|
DisplacementEffect,
|
|
13010
12836
|
DotEffect,
|
|
13011
12837
|
DropShadowEffect,
|
|
@@ -13026,23 +12852,31 @@ export {
|
|
|
13026
12852
|
EffectShadowSchema,
|
|
13027
12853
|
EffectStackSchema,
|
|
13028
12854
|
EffectStrokeSchema,
|
|
12855
|
+
ElasticSnapCutTransition,
|
|
13029
12856
|
EmbossEffect,
|
|
13030
12857
|
example_exports as ExamplePixiEffects,
|
|
13031
12858
|
FONT_WEIGHT_OPTIONS,
|
|
12859
|
+
FilmBurnWipeTransition,
|
|
13032
12860
|
FilmGrainEffect,
|
|
12861
|
+
FoldTurnTransition,
|
|
13033
12862
|
FontLoader,
|
|
13034
12863
|
FontSchema,
|
|
13035
12864
|
FrameGraphBuilder,
|
|
12865
|
+
FrameHoldStutterTransition,
|
|
13036
12866
|
GaussianBlurEffect,
|
|
13037
12867
|
GlitchBandEffect,
|
|
12868
|
+
GlitchTransition,
|
|
13038
12869
|
GlowEffect,
|
|
13039
12870
|
GradientStopSchema,
|
|
13040
12871
|
GraphHelper,
|
|
13041
12872
|
GraphValidator,
|
|
12873
|
+
GravityDropTransition,
|
|
13042
12874
|
GrayscaleEffect,
|
|
12875
|
+
HalationEffect,
|
|
13043
12876
|
HslAdjustmentEffect,
|
|
13044
12877
|
ImageLayerSchema,
|
|
13045
12878
|
InkBrushEngine,
|
|
12879
|
+
IrisRevealTransition,
|
|
13046
12880
|
KawaseBlurEffect,
|
|
13047
12881
|
LEGACY_RENDERER_MAP,
|
|
13048
12882
|
LOOP_PRESETS,
|
|
@@ -13052,6 +12886,8 @@ export {
|
|
|
13052
12886
|
LensFlareEffect,
|
|
13053
12887
|
light_exports as LightEffects,
|
|
13054
12888
|
LightLeakEffect,
|
|
12889
|
+
LightLeakSweepTransition,
|
|
12890
|
+
LumaWipeTransition,
|
|
13055
12891
|
MPGFrameRenderer,
|
|
13056
12892
|
MotionBlurEffect,
|
|
13057
12893
|
NeonGlowEffect,
|
|
@@ -13059,19 +12895,26 @@ export {
|
|
|
13059
12895
|
NullBackend,
|
|
13060
12896
|
OldFilmEffect,
|
|
13061
12897
|
OutlineEffect,
|
|
12898
|
+
ParallaxLayerSplitTransition,
|
|
12899
|
+
PixelateCollapseTransition,
|
|
13062
12900
|
PixelateEffect,
|
|
13063
12901
|
PixiRenderBackend,
|
|
13064
12902
|
PixiRenderer,
|
|
13065
12903
|
ProjectCompiler,
|
|
13066
12904
|
ProjectHelper,
|
|
12905
|
+
PushTransition,
|
|
13067
12906
|
RGBSplitEffect,
|
|
12907
|
+
RackFocusBlendTransition,
|
|
13068
12908
|
RadialBlurEffect,
|
|
13069
12909
|
ReflectionEffect,
|
|
12910
|
+
RefractionWarpTransition,
|
|
13070
12911
|
SCENE_VERSION,
|
|
13071
12912
|
SUPPORTED_FONT_FAMILIES,
|
|
13072
12913
|
ShapeLayerSchema,
|
|
12914
|
+
ShatterBurstTransition,
|
|
13073
12915
|
ShockwaveEffect,
|
|
13074
12916
|
StaticNoiseEffect,
|
|
12917
|
+
StrobeCutTransition,
|
|
13075
12918
|
TEMPLATE_CATEGORIES,
|
|
13076
12919
|
TRANSITION_CATEGORIES,
|
|
13077
12920
|
TRANSITION_PRESETS,
|
|
@@ -13092,6 +12935,7 @@ export {
|
|
|
13092
12935
|
WEBM_EXPORT_MAX_FRAMES,
|
|
13093
12936
|
WebGLCompositor,
|
|
13094
12937
|
ZoomBlurEffect,
|
|
12938
|
+
ZoomTransition,
|
|
13095
12939
|
_buildConfig,
|
|
13096
12940
|
_resetPlatformCache,
|
|
13097
12941
|
addImageLayer,
|
|
@@ -13106,15 +12950,19 @@ export {
|
|
|
13106
12950
|
addVectorShape,
|
|
13107
12951
|
advanceSceneTime,
|
|
13108
12952
|
alignToLottieJ,
|
|
12953
|
+
applyBodyEffectMask,
|
|
13109
12954
|
applyFillColorToAll,
|
|
13110
12955
|
applyLetterSpacing,
|
|
13111
12956
|
applyMaskReveal,
|
|
12957
|
+
applyMediaTransform,
|
|
13112
12958
|
applyRecipeToScene,
|
|
13113
12959
|
applyStyleToLottie,
|
|
13114
12960
|
applyStyleToLottieLayer,
|
|
13115
12961
|
applyTimelineAtTime,
|
|
13116
12962
|
backgroundBlurEffect,
|
|
13117
12963
|
bakeAnimationIntoLayer,
|
|
12964
|
+
beginStickerFrame,
|
|
12965
|
+
beginTextFrame,
|
|
13118
12966
|
blendColors,
|
|
13119
12967
|
blendConfigs,
|
|
13120
12968
|
blendScenes,
|
|
@@ -13126,12 +12974,23 @@ export {
|
|
|
13126
12974
|
buildPngSequenceZip,
|
|
13127
12975
|
builtInPresets,
|
|
13128
12976
|
builtInRecipes,
|
|
12977
|
+
calculateCropFromFocalPoint,
|
|
12978
|
+
calculateDefaultCoverCrop,
|
|
12979
|
+
calculateMediaFit,
|
|
12980
|
+
captureImageSourceDimensions,
|
|
13129
12981
|
captureLottieFrames,
|
|
12982
|
+
captureVideoSourceDimensions,
|
|
13130
12983
|
checkFontVariant,
|
|
13131
12984
|
chromaticAberrationEffect,
|
|
12985
|
+
clearAllBodyEffectMasks,
|
|
12986
|
+
clearAllMediaSprites,
|
|
12987
|
+
clearAllStickerBridges,
|
|
12988
|
+
clearAllTextBridges,
|
|
13132
12989
|
clearAnimationFromLayer,
|
|
12990
|
+
clearBodyEffectMask,
|
|
13133
12991
|
clearCanvas,
|
|
13134
12992
|
clearFontCache,
|
|
12993
|
+
clearPendingVideoLayers,
|
|
13135
12994
|
clearRecipeCache,
|
|
13136
12995
|
cloneSceneWithNewIds,
|
|
13137
12996
|
colorIsolationEffect,
|
|
@@ -13143,9 +13002,11 @@ export {
|
|
|
13143
13002
|
createCanvas,
|
|
13144
13003
|
createDefaultRevealTrack,
|
|
13145
13004
|
createEmptyScene,
|
|
13005
|
+
createGPUBodyGlowFilter,
|
|
13006
|
+
createGPUBodyOutlineFilter,
|
|
13007
|
+
createGPUBodyParticlesFilter,
|
|
13146
13008
|
createKeyframed,
|
|
13147
13009
|
createPulseOpacityTrack,
|
|
13148
|
-
crossDissolveTransition,
|
|
13149
13010
|
cubicBezier,
|
|
13150
13011
|
defaultConfig,
|
|
13151
13012
|
deleteKeyframe,
|
|
@@ -13162,6 +13023,8 @@ export {
|
|
|
13162
13023
|
effectMetadataToApi,
|
|
13163
13024
|
enableKeyframing,
|
|
13164
13025
|
encodeGif,
|
|
13026
|
+
endStickerFrame,
|
|
13027
|
+
endTextFrame,
|
|
13165
13028
|
ensureDefaultTimeline,
|
|
13166
13029
|
ensureFontInLottie,
|
|
13167
13030
|
ensureFontsLoaded,
|
|
@@ -13173,6 +13036,7 @@ export {
|
|
|
13173
13036
|
findTrackIndex,
|
|
13174
13037
|
formatValidationErrors,
|
|
13175
13038
|
generateEffectsManifest,
|
|
13039
|
+
getActiveMediaSpriteKeys,
|
|
13176
13040
|
getAllEffectsForApi,
|
|
13177
13041
|
getAllTransitionTags,
|
|
13178
13042
|
getAllTransitions,
|
|
@@ -13181,6 +13045,7 @@ export {
|
|
|
13181
13045
|
getAnimatableParamsForLayer,
|
|
13182
13046
|
getCanvasTemplatePreset,
|
|
13183
13047
|
getCanvasTemplatesByCategory,
|
|
13048
|
+
getClipLayout,
|
|
13184
13049
|
getDefaultText,
|
|
13185
13050
|
getEffectByIdForApi,
|
|
13186
13051
|
getEffectCategoriesSummary,
|
|
@@ -13191,9 +13056,13 @@ export {
|
|
|
13191
13056
|
getEffectsByCategoryForApi,
|
|
13192
13057
|
getFontLoader,
|
|
13193
13058
|
getLayerById,
|
|
13059
|
+
getMediaSpriteRecord,
|
|
13060
|
+
getOrCreateMediaSprite,
|
|
13194
13061
|
getPresetScene,
|
|
13195
13062
|
getRecommendedDuration,
|
|
13196
13063
|
getSceneTime,
|
|
13064
|
+
getSharedPixiRenderer,
|
|
13065
|
+
getSourceCropRect,
|
|
13197
13066
|
getSupportedWebMMimeType,
|
|
13198
13067
|
getTemplatePreset,
|
|
13199
13068
|
getTemplatesByCategory,
|
|
@@ -13206,10 +13075,10 @@ export {
|
|
|
13206
13075
|
getTransitionsByTags,
|
|
13207
13076
|
getVideoEffect,
|
|
13208
13077
|
getWebMFrameCount,
|
|
13209
|
-
glitchTransition,
|
|
13210
13078
|
heatDistortionEffect,
|
|
13211
13079
|
hexToLottieColor,
|
|
13212
13080
|
hexToLottieRgb,
|
|
13081
|
+
hexToRgb,
|
|
13213
13082
|
hexToRgba,
|
|
13214
13083
|
identityEffect,
|
|
13215
13084
|
initializeFontSystem,
|
|
@@ -13232,7 +13101,6 @@ export {
|
|
|
13232
13101
|
loadLottieFonts,
|
|
13233
13102
|
lottieColorToHex,
|
|
13234
13103
|
lottieJToAlign,
|
|
13235
|
-
lumaWipeTransition,
|
|
13236
13104
|
measureTextFits,
|
|
13237
13105
|
mergeSceneIntoConfig,
|
|
13238
13106
|
moveKeyframe,
|
|
@@ -13244,26 +13112,32 @@ export {
|
|
|
13244
13112
|
preloadGoogleFont,
|
|
13245
13113
|
presetToRecipe,
|
|
13246
13114
|
pruneTracksForLayer,
|
|
13247
|
-
pushTransition,
|
|
13248
13115
|
rainbowCharFillColors,
|
|
13249
13116
|
readLayerScalar,
|
|
13250
13117
|
readStyleFromLottieLayer,
|
|
13251
13118
|
reindexLayers,
|
|
13252
13119
|
releaseCanvas,
|
|
13120
|
+
releaseMediaSprite,
|
|
13121
|
+
releaseSharedPixiRenderer,
|
|
13253
13122
|
removeKeyframe,
|
|
13254
13123
|
removeTemplateKeyframe,
|
|
13255
13124
|
removeTrack,
|
|
13256
13125
|
renderPngSequence,
|
|
13257
13126
|
renderSceneWebM,
|
|
13127
|
+
renderStickerLayerBridged,
|
|
13258
13128
|
renderTextEffectCore,
|
|
13129
|
+
renderTextLayerBridged,
|
|
13259
13130
|
resetFontLoader,
|
|
13260
13131
|
resetSceneTime,
|
|
13261
13132
|
resizeCharFillColors,
|
|
13262
13133
|
resolveAnimatedScalar,
|
|
13134
|
+
resolveConform,
|
|
13263
13135
|
resolveCustomEngineId,
|
|
13264
13136
|
resolveFontFamilyName,
|
|
13137
|
+
resolveMediaLayout,
|
|
13265
13138
|
restoreLetterSpacing,
|
|
13266
13139
|
rgbaToComponents,
|
|
13140
|
+
rotateCrop,
|
|
13267
13141
|
scanLottieFonts,
|
|
13268
13142
|
scanTextLayers,
|
|
13269
13143
|
sceneToConfig,
|
|
@@ -13287,6 +13161,8 @@ export {
|
|
|
13287
13161
|
trackId,
|
|
13288
13162
|
transitionEffects,
|
|
13289
13163
|
transitionEffectsById,
|
|
13164
|
+
unmountStickerLayerBridge,
|
|
13165
|
+
unmountTextLayerBridge,
|
|
13290
13166
|
updateKeyframe,
|
|
13291
13167
|
updateSceneBevel,
|
|
13292
13168
|
updateSceneCanvas,
|
|
@@ -13314,7 +13190,6 @@ export {
|
|
|
13314
13190
|
videoEffectsById,
|
|
13315
13191
|
waitForFontsReady,
|
|
13316
13192
|
withContext,
|
|
13317
|
-
wrapTextToWidth
|
|
13318
|
-
zoomTransition
|
|
13193
|
+
wrapTextToWidth
|
|
13319
13194
|
};
|
|
13320
13195
|
//# sourceMappingURL=index.js.map
|