@clypra-studio/engine 0.1.2 → 1.0.1
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-CQoSb4ZB.d.cts +158 -0
- package/dist/TransitionDefinition-CQoSb4ZB.d.ts +158 -0
- package/dist/{chunk-CJRH4PAV.js → chunk-2VGI6ZB7.js} +289 -63
- package/dist/chunk-2VGI6ZB7.js.map +1 -0
- package/dist/chunk-4PKBLJ34.js +667 -0
- package/dist/chunk-4PKBLJ34.js.map +1 -0
- package/dist/chunk-FIJBB3MH.js +2990 -0
- package/dist/chunk-FIJBB3MH.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-Da47I6aX.d.cts} +5 -5
- package/dist/{index-BWo6qV_z.d.ts → index-Da47I6aX.d.ts} +5 -5
- package/dist/index.cjs +3906 -1371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +437 -3807
- package/dist/index.d.ts +437 -3807
- package/dist/index.js +1310 -1411
- 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 +58 -9
- package/dist/transitions/index.d.ts +58 -9
- 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/v2/contract/index.d.cts +12 -12
- package/dist/v2/contract/index.d.ts +12 -12
- package/dist/videoEffects/index.cjs +284 -64
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +34 -138
- package/dist/videoEffects/index.d.ts +34 -138
- package/dist/videoEffects/index.js +1 -1
- package/package.json +12 -12
- package/LICENSE +0 -9
- 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
|
@@ -71,11 +71,33 @@ import {
|
|
|
71
71
|
syncCompositorFromScene,
|
|
72
72
|
textEffectConfigToScene,
|
|
73
73
|
wrapTextToWidth
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-S24UVNPZ.js";
|
|
75
75
|
import {
|
|
76
|
+
ALL_TRANSITIONS,
|
|
77
|
+
ChromaticPushTransition,
|
|
78
|
+
CrossDissolveTransition,
|
|
79
|
+
DepthPushTransition,
|
|
80
|
+
DirectionalDissolveTransition,
|
|
81
|
+
ElasticSnapCutTransition,
|
|
82
|
+
FilmBurnWipeTransition,
|
|
83
|
+
FoldTurnTransition,
|
|
84
|
+
FrameHoldStutterTransition,
|
|
85
|
+
GlitchTransition,
|
|
86
|
+
GravityDropTransition,
|
|
87
|
+
IrisRevealTransition,
|
|
88
|
+
LightLeakSweepTransition,
|
|
89
|
+
LumaWipeTransition,
|
|
90
|
+
ParallaxLayerSplitTransition,
|
|
91
|
+
PixelateCollapseTransition,
|
|
92
|
+
PushTransition,
|
|
93
|
+
RackFocusBlendTransition,
|
|
94
|
+
RefractionWarpTransition,
|
|
95
|
+
ShatterBurstTransition,
|
|
96
|
+
StrobeCutTransition,
|
|
76
97
|
TRANSITION_CATEGORIES,
|
|
77
98
|
TRANSITION_PRESETS,
|
|
78
99
|
TransitionRenderer,
|
|
100
|
+
ZoomTransition,
|
|
79
101
|
getAllTransitionTags,
|
|
80
102
|
getAllTransitions,
|
|
81
103
|
getRecommendedDuration,
|
|
@@ -83,10 +105,13 @@ import {
|
|
|
83
105
|
getTransitionByRenderer,
|
|
84
106
|
getTransitionCategories,
|
|
85
107
|
getTransitionCountByCategory,
|
|
108
|
+
getTransitionEffect,
|
|
86
109
|
getTransitionsByCategory,
|
|
87
110
|
getTransitionsByTags,
|
|
88
|
-
searchTransitions
|
|
89
|
-
|
|
111
|
+
searchTransitions,
|
|
112
|
+
transitionEffects,
|
|
113
|
+
transitionEffectsById
|
|
114
|
+
} from "./chunk-FIJBB3MH.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-2VGI6ZB7.js";
|
|
123
148
|
import {
|
|
124
149
|
ColorAdjustmentsEffect,
|
|
125
|
-
PixiRenderBackend
|
|
126
|
-
|
|
150
|
+
PixiRenderBackend,
|
|
151
|
+
hexToRgb
|
|
152
|
+
} from "./chunk-4PKBLJ34.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,1390 +7883,90 @@ var crossDissolveTransition = {
|
|
|
7729
7883
|
},
|
|
7730
7884
|
nodes: [
|
|
7731
7885
|
{
|
|
7732
|
-
id: "
|
|
7733
|
-
type: "Input",
|
|
7734
|
-
params: {},
|
|
7735
|
-
outputs: {
|
|
7736
|
-
clipA: { type: "Texture" }
|
|
7737
|
-
}
|
|
7738
|
-
},
|
|
7739
|
-
{
|
|
7740
|
-
id: "inputB",
|
|
7886
|
+
id: "input",
|
|
7741
7887
|
type: "Input",
|
|
7742
7888
|
params: {},
|
|
7743
7889
|
outputs: {
|
|
7744
|
-
|
|
7890
|
+
source: { type: "Texture" },
|
|
7891
|
+
mask: { type: "Texture" }
|
|
7745
7892
|
}
|
|
7746
7893
|
},
|
|
7894
|
+
// Edge Detection Pass
|
|
7747
7895
|
{
|
|
7748
|
-
id: "
|
|
7896
|
+
id: "edge-detect",
|
|
7749
7897
|
type: "ShaderNode",
|
|
7750
7898
|
params: {
|
|
7751
7899
|
shader: `
|
|
7752
7900
|
precision highp float;
|
|
7753
7901
|
|
|
7754
|
-
uniform sampler2D
|
|
7755
|
-
uniform
|
|
7756
|
-
uniform float
|
|
7757
|
-
uniform float uEasing;
|
|
7758
|
-
uniform vec3 uFadeColor;
|
|
7759
|
-
uniform float uUseFadeColor;
|
|
7902
|
+
uniform sampler2D uMask;
|
|
7903
|
+
uniform vec2 uResolution;
|
|
7904
|
+
uniform float uThickness;
|
|
7760
7905
|
|
|
7761
7906
|
varying vec2 vUv;
|
|
7762
7907
|
|
|
7763
|
-
// Easing functions
|
|
7764
|
-
float easeIn(float t) {
|
|
7765
|
-
return t * t;
|
|
7766
|
-
}
|
|
7767
|
-
|
|
7768
|
-
float easeOut(float t) {
|
|
7769
|
-
return t * (2.0 - t);
|
|
7770
|
-
}
|
|
7771
|
-
|
|
7772
|
-
float easeInOut(float t) {
|
|
7773
|
-
return t < 0.5 ? 2.0 * t * t : -1.0 + (4.0 - 2.0 * t) * t;
|
|
7774
|
-
}
|
|
7775
|
-
|
|
7776
|
-
float smoothstep(float t) {
|
|
7777
|
-
return t * t * (3.0 - 2.0 * t);
|
|
7778
|
-
}
|
|
7779
|
-
|
|
7780
|
-
float applyEasing(float t, float easingType) {
|
|
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
|
-
}
|
|
7787
|
-
|
|
7788
7908
|
void main() {
|
|
7789
|
-
|
|
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;
|
|
7790
7922
|
|
|
7791
|
-
|
|
7792
|
-
|
|
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;
|
|
7793
7926
|
|
|
7794
|
-
|
|
7927
|
+
// Edge magnitude
|
|
7928
|
+
float edge = sqrt(gx * gx + gy * gy);
|
|
7795
7929
|
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
if (t < 0.5) {
|
|
7799
|
-
// Fade A to color
|
|
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);
|
|
7810
|
-
}
|
|
7930
|
+
// Threshold and normalize
|
|
7931
|
+
edge = smoothstep(0.1, 0.5, edge);
|
|
7811
7932
|
|
|
7812
|
-
gl_FragColor =
|
|
7933
|
+
gl_FragColor = vec4(edge, edge, edge, edge);
|
|
7813
7934
|
}
|
|
7814
7935
|
`,
|
|
7815
7936
|
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" }
|
|
7937
|
+
uMask: { type: "Texture", value: "@input.mask" },
|
|
7938
|
+
uResolution: { type: "vec2", value: "resolution" },
|
|
7939
|
+
uThickness: { type: "float", value: "@params.thickness" }
|
|
7822
7940
|
}
|
|
7823
7941
|
},
|
|
7824
7942
|
inputs: {
|
|
7825
|
-
|
|
7826
|
-
clipB: { type: "Texture" }
|
|
7827
|
-
},
|
|
7828
|
-
outputs: {
|
|
7829
|
-
result: { type: "Texture" }
|
|
7830
|
-
}
|
|
7831
|
-
},
|
|
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)"
|
|
7943
|
+
mask: { type: "Texture" }
|
|
7938
7944
|
},
|
|
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
7945
|
outputs: {
|
|
7966
|
-
|
|
7946
|
+
edges: { type: "Texture" }
|
|
7967
7947
|
}
|
|
7968
7948
|
},
|
|
7949
|
+
// Horizontal Blur Pass
|
|
7969
7950
|
{
|
|
7970
|
-
id: "
|
|
7951
|
+
id: "blur-h",
|
|
7971
7952
|
type: "ShaderNode",
|
|
7972
7953
|
params: {
|
|
7973
7954
|
shader: `
|
|
7974
7955
|
precision highp float;
|
|
7975
7956
|
|
|
7976
|
-
uniform sampler2D
|
|
7977
|
-
uniform
|
|
7978
|
-
uniform float
|
|
7979
|
-
uniform float uDirection; // 0=left, 1=right, 2=up, 3=down
|
|
7980
|
-
uniform float uEasing;
|
|
7957
|
+
uniform sampler2D uEdges;
|
|
7958
|
+
uniform vec2 uResolution;
|
|
7959
|
+
uniform float uSoftness;
|
|
7981
7960
|
|
|
7982
7961
|
varying vec2 vUv;
|
|
7983
7962
|
|
|
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
7963
|
void main() {
|
|
8005
|
-
|
|
8006
|
-
|
|
7964
|
+
vec2 texelSize = 1.0 / uResolution;
|
|
7965
|
+
float blur = 0.0;
|
|
8007
7966
|
|
|
8008
|
-
//
|
|
8009
|
-
|
|
8010
|
-
|
|
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;
|
|
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;
|
|
9116
7970
|
|
|
9117
7971
|
blur += texture2D(uEdges, vUv).r * weights[0];
|
|
9118
7972
|
|
|
@@ -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,1001 @@ 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
|
+
if (!sprite || sprite.destroyed || !sprite.anchor) {
|
|
12391
|
+
console.warn("[clypra-engine] Skipping applyMediaTransform \u2014 sprite is null or destroyed");
|
|
12392
|
+
return;
|
|
12393
|
+
}
|
|
12394
|
+
const { projectWidth, projectHeight } = viewport;
|
|
12395
|
+
const conform = layer.conform || {
|
|
12396
|
+
mode: "fit",
|
|
12397
|
+
sourceWidth: layer.width || 0,
|
|
12398
|
+
sourceHeight: layer.height || 0,
|
|
12399
|
+
userScale: 1,
|
|
12400
|
+
userOffsetX: 0,
|
|
12401
|
+
userOffsetY: 0
|
|
12402
|
+
};
|
|
12403
|
+
const { x, y, width, height } = resolveConform(conform, projectWidth || 1920, projectHeight || 1080);
|
|
12404
|
+
const isTransposed = layer.sourceRotation === 90 || layer.sourceRotation === 270;
|
|
12405
|
+
sprite.anchor.set(0, 0);
|
|
12406
|
+
sprite.position.set(x, y);
|
|
12407
|
+
sprite.width = isTransposed ? height : width;
|
|
12408
|
+
sprite.height = isTransposed ? width : height;
|
|
12409
|
+
const sw = sprite.texture.source.width;
|
|
12410
|
+
const sh = sprite.texture.source.height;
|
|
12411
|
+
if (sw && sh) {
|
|
12412
|
+
const currFrame = sprite.texture.frame;
|
|
12413
|
+
if (currFrame && (currFrame.x !== 0 || currFrame.y !== 0 || currFrame.width !== sw || currFrame.height !== sh)) {
|
|
12414
|
+
sprite.texture.frame.x = 0;
|
|
12415
|
+
sprite.texture.frame.y = 0;
|
|
12416
|
+
sprite.texture.frame.width = sw;
|
|
12417
|
+
sprite.texture.frame.height = sh;
|
|
12418
|
+
sprite.texture.orig.x = 0;
|
|
12419
|
+
sprite.texture.orig.y = 0;
|
|
12420
|
+
sprite.texture.orig.width = sw;
|
|
12421
|
+
sprite.texture.orig.height = sh;
|
|
12422
|
+
if (typeof sprite.texture.updateUvs === "function") {
|
|
12423
|
+
sprite.texture.updateUvs();
|
|
12424
|
+
}
|
|
12425
|
+
if (typeof sprite.onViewUpdate === "function") {
|
|
12426
|
+
sprite.onViewUpdate();
|
|
12427
|
+
}
|
|
12428
|
+
}
|
|
12429
|
+
}
|
|
12430
|
+
sprite.rotation = ((layer.rotation || 0) + (layer.sourceRotation || 0)) * Math.PI / 180;
|
|
12431
|
+
sprite.alpha = layer.opacity;
|
|
12432
|
+
}
|
|
12433
|
+
function releaseMediaSprite(clipId, container) {
|
|
12434
|
+
const record = mediaRegistry.get(clipId);
|
|
12435
|
+
if (record) {
|
|
12436
|
+
try {
|
|
12437
|
+
if (record.sprite && !record.sprite.destroyed) {
|
|
12438
|
+
if (record.sprite.parent) {
|
|
12439
|
+
record.sprite.parent.removeChild(record.sprite);
|
|
12440
|
+
} else {
|
|
12441
|
+
container.removeChild(record.sprite);
|
|
12442
|
+
}
|
|
12443
|
+
record.sprite.destroy();
|
|
12444
|
+
}
|
|
12445
|
+
} catch (err) {
|
|
12446
|
+
console.warn(`[clypra-engine] Error destroying sprite for clip ${clipId}:`, err);
|
|
12447
|
+
}
|
|
12448
|
+
try {
|
|
12449
|
+
if (record.texture && !record.texture.destroyed) {
|
|
12450
|
+
record.texture.destroy(false);
|
|
12451
|
+
}
|
|
12452
|
+
} catch (err) {
|
|
12453
|
+
console.warn(`[clypra-engine] Error destroying texture for clip ${clipId}:`, err);
|
|
12454
|
+
}
|
|
12455
|
+
record.destroyed = true;
|
|
12456
|
+
mediaRegistry.delete(clipId);
|
|
12457
|
+
}
|
|
12458
|
+
}
|
|
12459
|
+
function getOrCreateMediaSprite(clipId, kind, sourceElement, container) {
|
|
12460
|
+
let record = mediaRegistry.get(clipId);
|
|
12461
|
+
if (record && (record.destroyed || record.sprite.destroyed)) {
|
|
12462
|
+
mediaRegistry.delete(clipId);
|
|
12463
|
+
record = void 0;
|
|
12464
|
+
}
|
|
12465
|
+
if (record) {
|
|
12466
|
+
const isVideo = kind === "video";
|
|
12467
|
+
const videoEl = sourceElement;
|
|
12468
|
+
const dimensionsMismatch = isVideo && videoEl.videoWidth > 0 && (record.texture.source.width !== videoEl.videoWidth || record.texture.source.height !== videoEl.videoHeight);
|
|
12469
|
+
if (record.sourceIdentity !== sourceElement || dimensionsMismatch) {
|
|
12470
|
+
releaseMediaSprite(clipId, container);
|
|
12471
|
+
record = void 0;
|
|
12472
|
+
}
|
|
12473
|
+
}
|
|
12474
|
+
if (!record) {
|
|
12475
|
+
let source;
|
|
12476
|
+
let texture;
|
|
12477
|
+
if (kind === "video") {
|
|
12478
|
+
const video = sourceElement;
|
|
12479
|
+
if (!canCreateVideoTexture(video)) {
|
|
12480
|
+
const pending = pendingVideoLayers.get(clipId);
|
|
12481
|
+
if (!pending || pending.video !== video) {
|
|
12482
|
+
pendingVideoLayers.set(clipId, { video, container, setupListeners: false });
|
|
12483
|
+
}
|
|
12484
|
+
if (!pending?.setupListeners) {
|
|
12485
|
+
const onMetadataReady = () => {
|
|
12486
|
+
pendingVideoLayers.delete(clipId);
|
|
12487
|
+
};
|
|
12488
|
+
video.addEventListener("loadedmetadata", onMetadataReady, { once: true });
|
|
12489
|
+
video.addEventListener("loadeddata", onMetadataReady, { once: true });
|
|
12490
|
+
if (pending) {
|
|
12491
|
+
pending.setupListeners = true;
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
return null;
|
|
12495
|
+
}
|
|
12496
|
+
source = new VideoSource({ resource: video, autoPlay: false });
|
|
12497
|
+
texture = new Texture5({ source });
|
|
12498
|
+
pendingVideoLayers.delete(clipId);
|
|
12499
|
+
} else {
|
|
12500
|
+
source = null;
|
|
12501
|
+
const baseTexture = Texture5.from(sourceElement);
|
|
12502
|
+
texture = new Texture5({ source: baseTexture.source });
|
|
12503
|
+
}
|
|
12504
|
+
const sprite = new Sprite4(texture);
|
|
12505
|
+
container.addChild(sprite);
|
|
12506
|
+
record = {
|
|
12507
|
+
clipId,
|
|
12508
|
+
kind,
|
|
12509
|
+
sprite,
|
|
12510
|
+
texture,
|
|
12511
|
+
source,
|
|
12512
|
+
sourceIdentity: sourceElement,
|
|
12513
|
+
lastSeenFrame: 0,
|
|
12514
|
+
width: sprite.width,
|
|
12515
|
+
height: sprite.height,
|
|
12516
|
+
destroyed: false
|
|
12517
|
+
};
|
|
12518
|
+
mediaRegistry.set(clipId, record);
|
|
12519
|
+
} else {
|
|
12520
|
+
if (record.sprite.parent !== container) {
|
|
12521
|
+
container.addChild(record.sprite);
|
|
12522
|
+
}
|
|
12523
|
+
}
|
|
12524
|
+
return record;
|
|
12525
|
+
}
|
|
12526
|
+
function clearAllMediaSprites(container) {
|
|
12527
|
+
for (const [clipId, record] of mediaRegistry.entries()) {
|
|
12528
|
+
if (container && record.sprite.parent === container) {
|
|
12529
|
+
container.removeChild(record.sprite);
|
|
12530
|
+
}
|
|
12531
|
+
record.sprite.destroy();
|
|
12532
|
+
record.texture.destroy(false);
|
|
12533
|
+
}
|
|
12534
|
+
mediaRegistry.clear();
|
|
12535
|
+
}
|
|
12536
|
+
|
|
12537
|
+
// src/media/sourceCapture.ts
|
|
12538
|
+
function captureVideoSourceDimensions(videoEl, onCaptured) {
|
|
12539
|
+
if (videoEl.readyState >= 1 && videoEl.videoWidth && videoEl.videoHeight) {
|
|
12540
|
+
onCaptured(videoEl.videoWidth, videoEl.videoHeight);
|
|
12541
|
+
return;
|
|
12542
|
+
}
|
|
12543
|
+
videoEl.addEventListener(
|
|
12544
|
+
"loadedmetadata",
|
|
12545
|
+
() => onCaptured(videoEl.videoWidth, videoEl.videoHeight),
|
|
12546
|
+
{ once: true }
|
|
12547
|
+
);
|
|
12548
|
+
}
|
|
12549
|
+
function captureImageSourceDimensions(imageEl) {
|
|
12550
|
+
return { width: imageEl.naturalWidth || imageEl.width, height: imageEl.naturalHeight || imageEl.height };
|
|
12551
|
+
}
|
|
12552
|
+
|
|
12553
|
+
// src/effects/body/bodyEffectFilters.ts
|
|
12554
|
+
import { Filter as Filter8 } from "pixi.js";
|
|
12555
|
+
var VERTEX_SHADER = `
|
|
12556
|
+
in vec2 aPosition;
|
|
12557
|
+
out vec2 vTextureCoord;
|
|
12558
|
+
|
|
12559
|
+
uniform vec4 uInputSize;
|
|
12560
|
+
uniform vec4 uOutputFrame;
|
|
12561
|
+
uniform vec4 uOutputTexture;
|
|
12562
|
+
|
|
12563
|
+
vec4 filterVertexPosition(void) {
|
|
12564
|
+
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
12565
|
+
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
12566
|
+
position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
12567
|
+
return vec4(position, 0.0, 1.0);
|
|
12568
|
+
}
|
|
12569
|
+
|
|
12570
|
+
vec2 filterTextureCoord(void) {
|
|
12571
|
+
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
12572
|
+
}
|
|
12573
|
+
|
|
12574
|
+
void main(void) {
|
|
12575
|
+
gl_Position = filterVertexPosition();
|
|
12576
|
+
vTextureCoord = filterTextureCoord();
|
|
12577
|
+
}
|
|
12578
|
+
`;
|
|
12579
|
+
function hexToRgbNormalized(hex) {
|
|
12580
|
+
let clean = hex.replace("#", "");
|
|
12581
|
+
if (clean.length === 3) {
|
|
12582
|
+
clean = clean[0] + clean[0] + clean[1] + clean[1] + clean[2] + clean[2];
|
|
12583
|
+
}
|
|
12584
|
+
const num = parseInt(clean, 16);
|
|
12585
|
+
return [
|
|
12586
|
+
(num >> 16 & 255) / 255,
|
|
12587
|
+
(num >> 8 & 255) / 255,
|
|
12588
|
+
(num & 255) / 255
|
|
12589
|
+
];
|
|
12590
|
+
}
|
|
12591
|
+
function createGPUBodyOutlineFilter(maskTexture, colorHex, thickness) {
|
|
12592
|
+
const fragmentShader = `
|
|
12593
|
+
precision mediump float;
|
|
12594
|
+
in vec2 vTextureCoord;
|
|
12595
|
+
out vec4 fragColor;
|
|
12596
|
+
uniform sampler2D uSampler;
|
|
12597
|
+
uniform sampler2D uMask;
|
|
12598
|
+
uniform vec4 uOutlineColor;
|
|
12599
|
+
uniform float uThickness;
|
|
12600
|
+
uniform vec4 uInputSize;
|
|
12601
|
+
|
|
12602
|
+
void main(void) {
|
|
12603
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12604
|
+
float maskAlpha = texture(uMask, vTextureCoord).a;
|
|
12605
|
+
if (maskAlpha > 0.1) {
|
|
12606
|
+
fragColor = base;
|
|
12607
|
+
return;
|
|
12608
|
+
}
|
|
12609
|
+
float border = 0.0;
|
|
12610
|
+
vec2 texelSize = vec2(uThickness) * uInputSize.zw;
|
|
12611
|
+
for (float x = -1.0; x <= 1.0; x += 1.0) {
|
|
12612
|
+
for (float y = -1.0; y <= 1.0; y += 1.0) {
|
|
12613
|
+
if (x == 0.0 && y == 0.0) continue;
|
|
12614
|
+
float a = texture(uMask, vTextureCoord + vec2(x, y) * texelSize).a;
|
|
12615
|
+
if (a > 0.1) {
|
|
12616
|
+
border = 1.0;
|
|
12617
|
+
break;
|
|
12618
|
+
}
|
|
12619
|
+
}
|
|
12620
|
+
}
|
|
12621
|
+
if (border > 0.0) {
|
|
12622
|
+
fragColor = uOutlineColor;
|
|
12623
|
+
} else {
|
|
12624
|
+
fragColor = base;
|
|
12625
|
+
}
|
|
12626
|
+
}
|
|
12627
|
+
`;
|
|
12628
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12629
|
+
const originalFilterFrom = Filter8.from;
|
|
12630
|
+
Filter8.from = function(options) {
|
|
12631
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12632
|
+
options.resources.uMask = maskTexture.source;
|
|
12633
|
+
}
|
|
12634
|
+
return originalFilterFrom.call(this, options);
|
|
12635
|
+
};
|
|
12636
|
+
try {
|
|
12637
|
+
const filter = Filter8.from({
|
|
12638
|
+
gl: {
|
|
12639
|
+
vertex: VERTEX_SHADER,
|
|
12640
|
+
fragment: fragmentShader
|
|
12641
|
+
},
|
|
12642
|
+
resources: {
|
|
12643
|
+
customUniforms: {
|
|
12644
|
+
uOutlineColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12645
|
+
uThickness: { value: thickness, type: "f32" }
|
|
12646
|
+
}
|
|
12647
|
+
}
|
|
12648
|
+
});
|
|
12649
|
+
filter.resources.uMask = maskTexture.source;
|
|
12650
|
+
return filter;
|
|
12651
|
+
} finally {
|
|
12652
|
+
Filter8.from = originalFilterFrom;
|
|
12653
|
+
}
|
|
12654
|
+
}
|
|
12655
|
+
function createGPUBodyGlowFilter(maskTexture, colorHex, radius, intensity) {
|
|
12656
|
+
const fragmentShader = `
|
|
12657
|
+
precision mediump float;
|
|
12658
|
+
in vec2 vTextureCoord;
|
|
12659
|
+
out vec4 fragColor;
|
|
12660
|
+
uniform sampler2D uSampler;
|
|
12661
|
+
uniform sampler2D uMask;
|
|
12662
|
+
uniform vec4 uGlowColor;
|
|
12663
|
+
uniform float uGlowRadius;
|
|
12664
|
+
uniform float uGlowIntensity;
|
|
12665
|
+
uniform vec4 uInputSize;
|
|
12666
|
+
|
|
12667
|
+
void main(void) {
|
|
12668
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12669
|
+
float maskAlpha = texture(uMask, vTextureCoord).a;
|
|
12670
|
+
|
|
12671
|
+
float blur = 0.0;
|
|
12672
|
+
float total = 0.0;
|
|
12673
|
+
vec2 texelSize = vec2(uGlowRadius) * uInputSize.zw;
|
|
12674
|
+
|
|
12675
|
+
for (float x = -2.0; x <= 2.0; x += 1.0) {
|
|
12676
|
+
for (float y = -2.0; y <= 2.0; y += 1.0) {
|
|
12677
|
+
float weight = (3.0 - abs(x)) * (3.0 - abs(y));
|
|
12678
|
+
float a = texture(uMask, vTextureCoord + vec2(x, y) * texelSize * 0.5).a;
|
|
12679
|
+
blur += a * weight;
|
|
12680
|
+
total += weight;
|
|
12681
|
+
}
|
|
12682
|
+
}
|
|
12683
|
+
|
|
12684
|
+
float glow = (blur / total) * uGlowIntensity;
|
|
12685
|
+
|
|
12686
|
+
if (maskAlpha > 0.1) {
|
|
12687
|
+
fragColor = vec4(mix(base.rgb, uGlowColor.rgb, 0.15 * uGlowIntensity), base.a);
|
|
12688
|
+
} else {
|
|
12689
|
+
fragColor = vec4(mix(base.rgb, uGlowColor.rgb, glow), max(base.a, glow * uGlowColor.a));
|
|
12690
|
+
}
|
|
12691
|
+
}
|
|
12692
|
+
`;
|
|
12693
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12694
|
+
const originalFilterFrom = Filter8.from;
|
|
12695
|
+
Filter8.from = function(options) {
|
|
12696
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12697
|
+
options.resources.uMask = maskTexture.source;
|
|
12698
|
+
}
|
|
12699
|
+
return originalFilterFrom.call(this, options);
|
|
12700
|
+
};
|
|
12701
|
+
try {
|
|
12702
|
+
const filter = Filter8.from({
|
|
12703
|
+
gl: {
|
|
12704
|
+
vertex: VERTEX_SHADER,
|
|
12705
|
+
fragment: fragmentShader
|
|
12706
|
+
},
|
|
12707
|
+
resources: {
|
|
12708
|
+
customUniforms: {
|
|
12709
|
+
uGlowColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12710
|
+
uGlowRadius: { value: radius, type: "f32" },
|
|
12711
|
+
uGlowIntensity: { value: intensity, type: "f32" }
|
|
12712
|
+
}
|
|
12713
|
+
}
|
|
12714
|
+
});
|
|
12715
|
+
filter.resources.uMask = maskTexture.source;
|
|
12716
|
+
return filter;
|
|
12717
|
+
} finally {
|
|
12718
|
+
Filter8.from = originalFilterFrom;
|
|
12719
|
+
}
|
|
12720
|
+
}
|
|
12721
|
+
function createGPUBodyParticlesFilter(maskTexture, colorHex, particleCount, intensity, time) {
|
|
12722
|
+
const fragmentShader = `
|
|
12723
|
+
precision mediump float;
|
|
12724
|
+
in vec2 vTextureCoord;
|
|
12725
|
+
out vec4 fragColor;
|
|
12726
|
+
uniform sampler2D uSampler;
|
|
12727
|
+
uniform sampler2D uMask;
|
|
12728
|
+
uniform vec4 uParticleColor;
|
|
12729
|
+
uniform float uTime;
|
|
12730
|
+
uniform float uIntensity;
|
|
12731
|
+
uniform float uCount;
|
|
12732
|
+
|
|
12733
|
+
float rand(float n) { return fract(sin(n) * 43758.5453123); }
|
|
12734
|
+
|
|
12735
|
+
void main(void) {
|
|
12736
|
+
vec4 base = texture(uSampler, vTextureCoord);
|
|
12737
|
+
vec4 maskVal = texture(uMask, vTextureCoord);
|
|
12738
|
+
|
|
12739
|
+
float particleOverlay = 0.0;
|
|
12740
|
+
|
|
12741
|
+
for (float i = 0.0; i < 40.0; i += 1.0) {
|
|
12742
|
+
if (i >= uCount) break;
|
|
12743
|
+
float seedX = i * 37.0;
|
|
12744
|
+
float seedY = i * 43.0;
|
|
12745
|
+
|
|
12746
|
+
vec2 pPos = vec2(rand(seedX), rand(seedY));
|
|
12747
|
+
pPos.y -= fract(uTime * 0.1 + rand(i * 17.0)) * 0.4 * uIntensity;
|
|
12748
|
+
pPos.x += sin(uTime * 2.0 + i) * 0.015 * uIntensity;
|
|
12749
|
+
|
|
12750
|
+
float d = distance(vTextureCoord, pPos);
|
|
12751
|
+
float size = 0.001 + rand(i * 53.0) * 0.003;
|
|
12752
|
+
|
|
12753
|
+
if (d < size) {
|
|
12754
|
+
float maskAtParticle = texture(uMask, pPos).a;
|
|
12755
|
+
if (maskAtParticle > 0.1) {
|
|
12756
|
+
float alpha = smoothstep(size, size - 0.001, d);
|
|
12757
|
+
particleOverlay = max(particleOverlay, alpha);
|
|
12758
|
+
}
|
|
12759
|
+
}
|
|
12760
|
+
}
|
|
12761
|
+
|
|
12762
|
+
if (particleOverlay > 0.0) {
|
|
12763
|
+
fragColor = vec4(mix(base.rgb, uParticleColor.rgb, particleOverlay), base.a);
|
|
12764
|
+
} else {
|
|
12765
|
+
fragColor = base;
|
|
12766
|
+
}
|
|
12767
|
+
}
|
|
12768
|
+
`;
|
|
12769
|
+
const rgb = hexToRgbNormalized(colorHex);
|
|
12770
|
+
const originalFilterFrom = Filter8.from;
|
|
12771
|
+
Filter8.from = function(options) {
|
|
12772
|
+
if (options && options.resources && !options.resources.uMask) {
|
|
12773
|
+
options.resources.uMask = maskTexture.source;
|
|
12774
|
+
}
|
|
12775
|
+
return originalFilterFrom.call(this, options);
|
|
12776
|
+
};
|
|
12777
|
+
try {
|
|
12778
|
+
const filter = Filter8.from({
|
|
12779
|
+
gl: {
|
|
12780
|
+
vertex: VERTEX_SHADER,
|
|
12781
|
+
fragment: fragmentShader
|
|
12782
|
+
},
|
|
12783
|
+
resources: {
|
|
12784
|
+
customUniforms: {
|
|
12785
|
+
uParticleColor: { value: [...rgb, 1], type: "vec4<f32>" },
|
|
12786
|
+
uTime: { value: time, type: "f32" },
|
|
12787
|
+
uIntensity: { value: intensity, type: "f32" },
|
|
12788
|
+
uCount: { value: Math.min(40, particleCount), type: "f32" }
|
|
12789
|
+
}
|
|
12790
|
+
}
|
|
12791
|
+
});
|
|
12792
|
+
filter.resources.uMask = maskTexture.source;
|
|
12793
|
+
return filter;
|
|
12794
|
+
} finally {
|
|
12795
|
+
Filter8.from = originalFilterFrom;
|
|
12796
|
+
}
|
|
12797
|
+
}
|
|
12798
|
+
|
|
12799
|
+
// src/effects/body/bodyEffectMask.ts
|
|
12800
|
+
import { Texture as Texture7 } from "pixi.js";
|
|
12801
|
+
var maskTextures = /* @__PURE__ */ new Map();
|
|
12802
|
+
function applyBodyEffectMask(clipId, maskData) {
|
|
12803
|
+
let maskTexture = maskTextures.get(clipId);
|
|
12804
|
+
if (!maskTexture) {
|
|
12805
|
+
maskTexture = Texture7.from(maskData);
|
|
12806
|
+
maskTextures.set(clipId, maskTexture);
|
|
12807
|
+
} else {
|
|
12808
|
+
maskTexture.source.update();
|
|
12809
|
+
}
|
|
12810
|
+
return maskTexture;
|
|
12811
|
+
}
|
|
12812
|
+
function clearBodyEffectMask(clipId) {
|
|
12813
|
+
const maskTexture = maskTextures.get(clipId);
|
|
12814
|
+
if (maskTexture) {
|
|
12815
|
+
maskTexture.destroy(true);
|
|
12816
|
+
maskTextures.delete(clipId);
|
|
12817
|
+
}
|
|
12818
|
+
}
|
|
12819
|
+
function clearAllBodyEffectMasks() {
|
|
12820
|
+
for (const [clipId, texture] of maskTextures.entries()) {
|
|
12821
|
+
texture.destroy(true);
|
|
12822
|
+
}
|
|
12823
|
+
maskTextures.clear();
|
|
12824
|
+
}
|
|
12825
|
+
|
|
12981
12826
|
// src/index.ts
|
|
12982
12827
|
var VERSION = "0.1.0";
|
|
12983
12828
|
export {
|
|
12829
|
+
ALL_TRANSITIONS,
|
|
12984
12830
|
AlphaEffect,
|
|
12985
12831
|
AnimationPresetSchema,
|
|
12986
12832
|
AnimationSchema,
|
|
@@ -12993,12 +12839,14 @@ export {
|
|
|
12993
12839
|
CUSTOM_ENGINE_IDS,
|
|
12994
12840
|
camera_exports as CameraEffects,
|
|
12995
12841
|
CanvasDevice,
|
|
12842
|
+
ChromaticPushTransition,
|
|
12996
12843
|
CinematicLUTEffect,
|
|
12997
12844
|
ColorAdjustmentsEffect,
|
|
12998
12845
|
ColorGradientEffect,
|
|
12999
12846
|
ColorMatrixEffect,
|
|
13000
12847
|
ColorOverlayEffect,
|
|
13001
12848
|
CommandBufferBuilder,
|
|
12849
|
+
CrossDissolveTransition,
|
|
13002
12850
|
CrossHatchEffect,
|
|
13003
12851
|
DEFAULT_CANVAS_HEIGHT,
|
|
13004
12852
|
DEFAULT_CANVAS_WIDTH,
|
|
@@ -13006,6 +12854,8 @@ export {
|
|
|
13006
12854
|
DEFAULT_FONT_SIZE,
|
|
13007
12855
|
DEFAULT_FPS,
|
|
13008
12856
|
DEFAULT_TEXT_STYLE,
|
|
12857
|
+
DepthPushTransition,
|
|
12858
|
+
DirectionalDissolveTransition,
|
|
13009
12859
|
DisplacementEffect,
|
|
13010
12860
|
DotEffect,
|
|
13011
12861
|
DropShadowEffect,
|
|
@@ -13026,23 +12876,31 @@ export {
|
|
|
13026
12876
|
EffectShadowSchema,
|
|
13027
12877
|
EffectStackSchema,
|
|
13028
12878
|
EffectStrokeSchema,
|
|
12879
|
+
ElasticSnapCutTransition,
|
|
13029
12880
|
EmbossEffect,
|
|
13030
12881
|
example_exports as ExamplePixiEffects,
|
|
13031
12882
|
FONT_WEIGHT_OPTIONS,
|
|
12883
|
+
FilmBurnWipeTransition,
|
|
13032
12884
|
FilmGrainEffect,
|
|
12885
|
+
FoldTurnTransition,
|
|
13033
12886
|
FontLoader,
|
|
13034
12887
|
FontSchema,
|
|
13035
12888
|
FrameGraphBuilder,
|
|
12889
|
+
FrameHoldStutterTransition,
|
|
13036
12890
|
GaussianBlurEffect,
|
|
13037
12891
|
GlitchBandEffect,
|
|
12892
|
+
GlitchTransition,
|
|
13038
12893
|
GlowEffect,
|
|
13039
12894
|
GradientStopSchema,
|
|
13040
12895
|
GraphHelper,
|
|
13041
12896
|
GraphValidator,
|
|
12897
|
+
GravityDropTransition,
|
|
13042
12898
|
GrayscaleEffect,
|
|
12899
|
+
HalationEffect,
|
|
13043
12900
|
HslAdjustmentEffect,
|
|
13044
12901
|
ImageLayerSchema,
|
|
13045
12902
|
InkBrushEngine,
|
|
12903
|
+
IrisRevealTransition,
|
|
13046
12904
|
KawaseBlurEffect,
|
|
13047
12905
|
LEGACY_RENDERER_MAP,
|
|
13048
12906
|
LOOP_PRESETS,
|
|
@@ -13052,6 +12910,8 @@ export {
|
|
|
13052
12910
|
LensFlareEffect,
|
|
13053
12911
|
light_exports as LightEffects,
|
|
13054
12912
|
LightLeakEffect,
|
|
12913
|
+
LightLeakSweepTransition,
|
|
12914
|
+
LumaWipeTransition,
|
|
13055
12915
|
MPGFrameRenderer,
|
|
13056
12916
|
MotionBlurEffect,
|
|
13057
12917
|
NeonGlowEffect,
|
|
@@ -13059,19 +12919,26 @@ export {
|
|
|
13059
12919
|
NullBackend,
|
|
13060
12920
|
OldFilmEffect,
|
|
13061
12921
|
OutlineEffect,
|
|
12922
|
+
ParallaxLayerSplitTransition,
|
|
12923
|
+
PixelateCollapseTransition,
|
|
13062
12924
|
PixelateEffect,
|
|
13063
12925
|
PixiRenderBackend,
|
|
13064
12926
|
PixiRenderer,
|
|
13065
12927
|
ProjectCompiler,
|
|
13066
12928
|
ProjectHelper,
|
|
12929
|
+
PushTransition,
|
|
13067
12930
|
RGBSplitEffect,
|
|
12931
|
+
RackFocusBlendTransition,
|
|
13068
12932
|
RadialBlurEffect,
|
|
13069
12933
|
ReflectionEffect,
|
|
12934
|
+
RefractionWarpTransition,
|
|
13070
12935
|
SCENE_VERSION,
|
|
13071
12936
|
SUPPORTED_FONT_FAMILIES,
|
|
13072
12937
|
ShapeLayerSchema,
|
|
12938
|
+
ShatterBurstTransition,
|
|
13073
12939
|
ShockwaveEffect,
|
|
13074
12940
|
StaticNoiseEffect,
|
|
12941
|
+
StrobeCutTransition,
|
|
13075
12942
|
TEMPLATE_CATEGORIES,
|
|
13076
12943
|
TRANSITION_CATEGORIES,
|
|
13077
12944
|
TRANSITION_PRESETS,
|
|
@@ -13092,6 +12959,7 @@ export {
|
|
|
13092
12959
|
WEBM_EXPORT_MAX_FRAMES,
|
|
13093
12960
|
WebGLCompositor,
|
|
13094
12961
|
ZoomBlurEffect,
|
|
12962
|
+
ZoomTransition,
|
|
13095
12963
|
_buildConfig,
|
|
13096
12964
|
_resetPlatformCache,
|
|
13097
12965
|
addImageLayer,
|
|
@@ -13106,15 +12974,19 @@ export {
|
|
|
13106
12974
|
addVectorShape,
|
|
13107
12975
|
advanceSceneTime,
|
|
13108
12976
|
alignToLottieJ,
|
|
12977
|
+
applyBodyEffectMask,
|
|
13109
12978
|
applyFillColorToAll,
|
|
13110
12979
|
applyLetterSpacing,
|
|
13111
12980
|
applyMaskReveal,
|
|
12981
|
+
applyMediaTransform,
|
|
13112
12982
|
applyRecipeToScene,
|
|
13113
12983
|
applyStyleToLottie,
|
|
13114
12984
|
applyStyleToLottieLayer,
|
|
13115
12985
|
applyTimelineAtTime,
|
|
13116
12986
|
backgroundBlurEffect,
|
|
13117
12987
|
bakeAnimationIntoLayer,
|
|
12988
|
+
beginStickerFrame,
|
|
12989
|
+
beginTextFrame,
|
|
13118
12990
|
blendColors,
|
|
13119
12991
|
blendConfigs,
|
|
13120
12992
|
blendScenes,
|
|
@@ -13126,12 +12998,23 @@ export {
|
|
|
13126
12998
|
buildPngSequenceZip,
|
|
13127
12999
|
builtInPresets,
|
|
13128
13000
|
builtInRecipes,
|
|
13001
|
+
calculateCropFromFocalPoint,
|
|
13002
|
+
calculateDefaultCoverCrop,
|
|
13003
|
+
calculateMediaFit,
|
|
13004
|
+
captureImageSourceDimensions,
|
|
13129
13005
|
captureLottieFrames,
|
|
13006
|
+
captureVideoSourceDimensions,
|
|
13130
13007
|
checkFontVariant,
|
|
13131
13008
|
chromaticAberrationEffect,
|
|
13009
|
+
clearAllBodyEffectMasks,
|
|
13010
|
+
clearAllMediaSprites,
|
|
13011
|
+
clearAllStickerBridges,
|
|
13012
|
+
clearAllTextBridges,
|
|
13132
13013
|
clearAnimationFromLayer,
|
|
13014
|
+
clearBodyEffectMask,
|
|
13133
13015
|
clearCanvas,
|
|
13134
13016
|
clearFontCache,
|
|
13017
|
+
clearPendingVideoLayers,
|
|
13135
13018
|
clearRecipeCache,
|
|
13136
13019
|
cloneSceneWithNewIds,
|
|
13137
13020
|
colorIsolationEffect,
|
|
@@ -13143,9 +13026,11 @@ export {
|
|
|
13143
13026
|
createCanvas,
|
|
13144
13027
|
createDefaultRevealTrack,
|
|
13145
13028
|
createEmptyScene,
|
|
13029
|
+
createGPUBodyGlowFilter,
|
|
13030
|
+
createGPUBodyOutlineFilter,
|
|
13031
|
+
createGPUBodyParticlesFilter,
|
|
13146
13032
|
createKeyframed,
|
|
13147
13033
|
createPulseOpacityTrack,
|
|
13148
|
-
crossDissolveTransition,
|
|
13149
13034
|
cubicBezier,
|
|
13150
13035
|
defaultConfig,
|
|
13151
13036
|
deleteKeyframe,
|
|
@@ -13162,6 +13047,8 @@ export {
|
|
|
13162
13047
|
effectMetadataToApi,
|
|
13163
13048
|
enableKeyframing,
|
|
13164
13049
|
encodeGif,
|
|
13050
|
+
endStickerFrame,
|
|
13051
|
+
endTextFrame,
|
|
13165
13052
|
ensureDefaultTimeline,
|
|
13166
13053
|
ensureFontInLottie,
|
|
13167
13054
|
ensureFontsLoaded,
|
|
@@ -13173,6 +13060,7 @@ export {
|
|
|
13173
13060
|
findTrackIndex,
|
|
13174
13061
|
formatValidationErrors,
|
|
13175
13062
|
generateEffectsManifest,
|
|
13063
|
+
getActiveMediaSpriteKeys,
|
|
13176
13064
|
getAllEffectsForApi,
|
|
13177
13065
|
getAllTransitionTags,
|
|
13178
13066
|
getAllTransitions,
|
|
@@ -13181,6 +13069,7 @@ export {
|
|
|
13181
13069
|
getAnimatableParamsForLayer,
|
|
13182
13070
|
getCanvasTemplatePreset,
|
|
13183
13071
|
getCanvasTemplatesByCategory,
|
|
13072
|
+
getClipLayout,
|
|
13184
13073
|
getDefaultText,
|
|
13185
13074
|
getEffectByIdForApi,
|
|
13186
13075
|
getEffectCategoriesSummary,
|
|
@@ -13191,9 +13080,13 @@ export {
|
|
|
13191
13080
|
getEffectsByCategoryForApi,
|
|
13192
13081
|
getFontLoader,
|
|
13193
13082
|
getLayerById,
|
|
13083
|
+
getMediaSpriteRecord,
|
|
13084
|
+
getOrCreateMediaSprite,
|
|
13194
13085
|
getPresetScene,
|
|
13195
13086
|
getRecommendedDuration,
|
|
13196
13087
|
getSceneTime,
|
|
13088
|
+
getSharedPixiRenderer,
|
|
13089
|
+
getSourceCropRect,
|
|
13197
13090
|
getSupportedWebMMimeType,
|
|
13198
13091
|
getTemplatePreset,
|
|
13199
13092
|
getTemplatesByCategory,
|
|
@@ -13206,10 +13099,10 @@ export {
|
|
|
13206
13099
|
getTransitionsByTags,
|
|
13207
13100
|
getVideoEffect,
|
|
13208
13101
|
getWebMFrameCount,
|
|
13209
|
-
glitchTransition,
|
|
13210
13102
|
heatDistortionEffect,
|
|
13211
13103
|
hexToLottieColor,
|
|
13212
13104
|
hexToLottieRgb,
|
|
13105
|
+
hexToRgb,
|
|
13213
13106
|
hexToRgba,
|
|
13214
13107
|
identityEffect,
|
|
13215
13108
|
initializeFontSystem,
|
|
@@ -13232,7 +13125,6 @@ export {
|
|
|
13232
13125
|
loadLottieFonts,
|
|
13233
13126
|
lottieColorToHex,
|
|
13234
13127
|
lottieJToAlign,
|
|
13235
|
-
lumaWipeTransition,
|
|
13236
13128
|
measureTextFits,
|
|
13237
13129
|
mergeSceneIntoConfig,
|
|
13238
13130
|
moveKeyframe,
|
|
@@ -13244,26 +13136,32 @@ export {
|
|
|
13244
13136
|
preloadGoogleFont,
|
|
13245
13137
|
presetToRecipe,
|
|
13246
13138
|
pruneTracksForLayer,
|
|
13247
|
-
pushTransition,
|
|
13248
13139
|
rainbowCharFillColors,
|
|
13249
13140
|
readLayerScalar,
|
|
13250
13141
|
readStyleFromLottieLayer,
|
|
13251
13142
|
reindexLayers,
|
|
13252
13143
|
releaseCanvas,
|
|
13144
|
+
releaseMediaSprite,
|
|
13145
|
+
releaseSharedPixiRenderer,
|
|
13253
13146
|
removeKeyframe,
|
|
13254
13147
|
removeTemplateKeyframe,
|
|
13255
13148
|
removeTrack,
|
|
13256
13149
|
renderPngSequence,
|
|
13257
13150
|
renderSceneWebM,
|
|
13151
|
+
renderStickerLayerBridged,
|
|
13258
13152
|
renderTextEffectCore,
|
|
13153
|
+
renderTextLayerBridged,
|
|
13259
13154
|
resetFontLoader,
|
|
13260
13155
|
resetSceneTime,
|
|
13261
13156
|
resizeCharFillColors,
|
|
13262
13157
|
resolveAnimatedScalar,
|
|
13158
|
+
resolveConform,
|
|
13263
13159
|
resolveCustomEngineId,
|
|
13264
13160
|
resolveFontFamilyName,
|
|
13161
|
+
resolveMediaLayout,
|
|
13265
13162
|
restoreLetterSpacing,
|
|
13266
13163
|
rgbaToComponents,
|
|
13164
|
+
rotateCrop,
|
|
13267
13165
|
scanLottieFonts,
|
|
13268
13166
|
scanTextLayers,
|
|
13269
13167
|
sceneToConfig,
|
|
@@ -13287,6 +13185,8 @@ export {
|
|
|
13287
13185
|
trackId,
|
|
13288
13186
|
transitionEffects,
|
|
13289
13187
|
transitionEffectsById,
|
|
13188
|
+
unmountStickerLayerBridge,
|
|
13189
|
+
unmountTextLayerBridge,
|
|
13290
13190
|
updateKeyframe,
|
|
13291
13191
|
updateSceneBevel,
|
|
13292
13192
|
updateSceneCanvas,
|
|
@@ -13314,7 +13214,6 @@ export {
|
|
|
13314
13214
|
videoEffectsById,
|
|
13315
13215
|
waitForFontsReady,
|
|
13316
13216
|
withContext,
|
|
13317
|
-
wrapTextToWidth
|
|
13318
|
-
zoomTransition
|
|
13217
|
+
wrapTextToWidth
|
|
13319
13218
|
};
|
|
13320
13219
|
//# sourceMappingURL=index.js.map
|