@remotion/starburst 4.0.467 → 4.0.468
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/esm/index.mjs +8 -58
- package/dist/index.d.ts +1 -1
- package/dist/starburst-effect.d.ts +0 -9
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -41,14 +41,6 @@ var starburstEffectSchema = {
|
|
|
41
41
|
default: 0,
|
|
42
42
|
description: "Edge Smoothness"
|
|
43
43
|
},
|
|
44
|
-
vignette: {
|
|
45
|
-
type: "number",
|
|
46
|
-
min: 0,
|
|
47
|
-
max: 1,
|
|
48
|
-
step: 0.01,
|
|
49
|
-
default: 1,
|
|
50
|
-
description: "Vignette"
|
|
51
|
-
},
|
|
52
44
|
originOffsetX: {
|
|
53
45
|
type: "number",
|
|
54
46
|
min: -1,
|
|
@@ -71,7 +63,6 @@ var resolve = (p) => ({
|
|
|
71
63
|
colors: p.colors,
|
|
72
64
|
rotation: p.rotation ?? 0,
|
|
73
65
|
smoothness: p.smoothness ?? 0,
|
|
74
|
-
vignette: p.vignette ?? 1,
|
|
75
66
|
originOffsetX: p.originOffsetX ?? 0,
|
|
76
67
|
originOffsetY: p.originOffsetY ?? 0
|
|
77
68
|
});
|
|
@@ -99,12 +90,6 @@ var validateStarburstEffectParams = (params) => {
|
|
|
99
90
|
if (r.smoothness < 0 || r.smoothness > 1) {
|
|
100
91
|
throw new RangeError(`"smoothness" must be between 0 and 1, but got ${r.smoothness}`);
|
|
101
92
|
}
|
|
102
|
-
if (typeof r.vignette !== "number" || !Number.isFinite(r.vignette)) {
|
|
103
|
-
throw new TypeError(`"vignette" must be a finite number, but got ${JSON.stringify(params.vignette)}`);
|
|
104
|
-
}
|
|
105
|
-
if (r.vignette < 0 || r.vignette > 1) {
|
|
106
|
-
throw new RangeError(`"vignette" must be between 0 and 1, but got ${r.vignette}`);
|
|
107
|
-
}
|
|
108
93
|
if (typeof r.originOffsetX !== "number" || !Number.isFinite(r.originOffsetX)) {
|
|
109
94
|
throw new TypeError(`"originOffsetX" must be a finite number, but got ${JSON.stringify(params.originOffsetX)}`);
|
|
110
95
|
}
|
|
@@ -127,14 +112,12 @@ void main() {
|
|
|
127
112
|
var STARBURST_FS = `#version 300 es
|
|
128
113
|
precision highp float;
|
|
129
114
|
|
|
130
|
-
uniform sampler2D uSource;
|
|
131
115
|
uniform sampler2D colorPalette;
|
|
132
116
|
uniform float numRays;
|
|
133
117
|
uniform float rotationOffset;
|
|
134
118
|
uniform float smoothEdge;
|
|
135
119
|
uniform vec2 resolution;
|
|
136
120
|
uniform float numColors;
|
|
137
|
-
uniform float vignetteAmount;
|
|
138
121
|
uniform vec2 originOffset;
|
|
139
122
|
|
|
140
123
|
in vec2 vUv;
|
|
@@ -170,16 +153,7 @@ void main() {
|
|
|
170
153
|
vec3 prevCol = texture(colorPalette, vec2(prevTexCoord, 0.5)).rgb;
|
|
171
154
|
col = mix(col, prevCol, blendStart);
|
|
172
155
|
|
|
173
|
-
|
|
174
|
-
float dist = length(vignetteCenter);
|
|
175
|
-
float radius = vignetteAmount * 3.0;
|
|
176
|
-
float burstAlpha = smoothstep(radius, radius * 0.5, dist);
|
|
177
|
-
|
|
178
|
-
vec4 src = texture(uSource, vUv);
|
|
179
|
-
vec3 burstPm = col * burstAlpha;
|
|
180
|
-
vec3 outRgb = burstPm + src.rgb * (1.0 - burstAlpha);
|
|
181
|
-
float outA = burstAlpha + src.a * (1.0 - burstAlpha);
|
|
182
|
-
fragColor = vec4(outRgb, outA);
|
|
156
|
+
fragColor = vec4(col, 1.0);
|
|
183
157
|
}
|
|
184
158
|
`;
|
|
185
159
|
var compileShader = (gl, type, source) => {
|
|
@@ -213,12 +187,12 @@ var linkProgram = (gl, vs, fs) => {
|
|
|
213
187
|
};
|
|
214
188
|
var starburst = createEffect({
|
|
215
189
|
type: "remotion/starburst",
|
|
216
|
-
label: "
|
|
217
|
-
documentationLink: "https://www.remotion.dev/docs/starburst/starburst",
|
|
190
|
+
label: "starburst()",
|
|
191
|
+
documentationLink: "https://www.remotion.dev/docs/starburst/starburst-effect",
|
|
218
192
|
backend: "webgl2",
|
|
219
193
|
calculateKey: (params) => {
|
|
220
194
|
const r = resolve(params);
|
|
221
|
-
return `starburst-${r.rays}-${r.colors.join("|")}-${r.rotation}-${r.smoothness}-${r.
|
|
195
|
+
return `starburst-${r.rays}-${r.colors.join("|")}-${r.rotation}-${r.smoothness}-${r.originOffsetX}-${r.originOffsetY}`;
|
|
222
196
|
},
|
|
223
197
|
setup: (target) => {
|
|
224
198
|
const gl = target.getContext("webgl2", {
|
|
@@ -271,14 +245,6 @@ var starburst = createEffect({
|
|
|
271
245
|
gl.enableVertexAttribArray(aUv);
|
|
272
246
|
gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
|
|
273
247
|
gl.bindVertexArray(null);
|
|
274
|
-
const sourceTexture = gl.createTexture();
|
|
275
|
-
if (!sourceTexture) {
|
|
276
|
-
throw new Error("Failed to create WebGL source texture");
|
|
277
|
-
}
|
|
278
|
-
gl.bindTexture(gl.TEXTURE_2D, sourceTexture);
|
|
279
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
280
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
281
|
-
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
282
248
|
const paletteTexture = gl.createTexture();
|
|
283
249
|
if (!paletteTexture) {
|
|
284
250
|
throw new Error("Failed to create WebGL palette texture");
|
|
@@ -294,37 +260,31 @@ var starburst = createEffect({
|
|
|
294
260
|
program,
|
|
295
261
|
vao,
|
|
296
262
|
vbo,
|
|
297
|
-
sourceTexture,
|
|
298
263
|
paletteTexture,
|
|
299
|
-
uSource: gl.getUniformLocation(program, "uSource"),
|
|
300
264
|
uColorPalette: gl.getUniformLocation(program, "colorPalette"),
|
|
301
265
|
uNumRays: gl.getUniformLocation(program, "numRays"),
|
|
302
266
|
uRotationOffset: gl.getUniformLocation(program, "rotationOffset"),
|
|
303
267
|
uSmoothEdge: gl.getUniformLocation(program, "smoothEdge"),
|
|
304
268
|
uResolution: gl.getUniformLocation(program, "resolution"),
|
|
305
269
|
uNumColors: gl.getUniformLocation(program, "numColors"),
|
|
306
|
-
uVignetteAmount: gl.getUniformLocation(program, "vignetteAmount"),
|
|
307
270
|
uOriginOffset: gl.getUniformLocation(program, "originOffset"),
|
|
308
271
|
cachedPaletteKey: "",
|
|
309
272
|
palettePixelData: new Uint8Array(0)
|
|
310
273
|
};
|
|
311
274
|
},
|
|
312
|
-
apply: ({
|
|
275
|
+
apply: ({ width, height, params, state }) => {
|
|
313
276
|
const r = resolve(params);
|
|
314
277
|
const {
|
|
315
278
|
gl,
|
|
316
279
|
program,
|
|
317
280
|
vao,
|
|
318
|
-
sourceTexture,
|
|
319
281
|
paletteTexture,
|
|
320
|
-
uSource,
|
|
321
282
|
uColorPalette,
|
|
322
283
|
uNumRays,
|
|
323
284
|
uRotationOffset,
|
|
324
285
|
uSmoothEdge,
|
|
325
286
|
uResolution,
|
|
326
287
|
uNumColors,
|
|
327
|
-
uVignetteAmount,
|
|
328
288
|
uOriginOffset
|
|
329
289
|
} = state;
|
|
330
290
|
const rotationRad = r.rotation * Math.PI / 180;
|
|
@@ -351,20 +311,12 @@ var starburst = createEffect({
|
|
|
351
311
|
gl.useProgram(program);
|
|
352
312
|
gl.bindVertexArray(vao);
|
|
353
313
|
gl.activeTexture(gl.TEXTURE0);
|
|
354
|
-
gl.bindTexture(gl.TEXTURE_2D, sourceTexture);
|
|
355
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
356
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
357
|
-
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
|
|
358
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
|
|
359
|
-
gl.activeTexture(gl.TEXTURE1);
|
|
360
314
|
gl.bindTexture(gl.TEXTURE_2D, paletteTexture);
|
|
361
315
|
if (paletteDirty) {
|
|
362
316
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, r.colors.length, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, state.palettePixelData);
|
|
363
317
|
}
|
|
364
|
-
if (uSource)
|
|
365
|
-
gl.uniform1i(uSource, 0);
|
|
366
318
|
if (uColorPalette)
|
|
367
|
-
gl.uniform1i(uColorPalette,
|
|
319
|
+
gl.uniform1i(uColorPalette, 0);
|
|
368
320
|
if (uNumRays)
|
|
369
321
|
gl.uniform1f(uNumRays, r.rays);
|
|
370
322
|
if (uNumColors)
|
|
@@ -373,8 +325,6 @@ var starburst = createEffect({
|
|
|
373
325
|
gl.uniform1f(uRotationOffset, rotationRad);
|
|
374
326
|
if (uSmoothEdge)
|
|
375
327
|
gl.uniform1f(uSmoothEdge, r.smoothness);
|
|
376
|
-
if (uVignetteAmount)
|
|
377
|
-
gl.uniform1f(uVignetteAmount, r.vignette);
|
|
378
328
|
if (uOriginOffset)
|
|
379
329
|
gl.uniform2f(uOriginOffset, r.originOffsetX, r.originOffsetY);
|
|
380
330
|
if (uResolution)
|
|
@@ -384,11 +334,10 @@ var starburst = createEffect({
|
|
|
384
334
|
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
385
335
|
gl.useProgram(null);
|
|
386
336
|
},
|
|
387
|
-
cleanup: ({ gl, program, vao, vbo,
|
|
337
|
+
cleanup: ({ gl, program, vao, vbo, paletteTexture }) => {
|
|
388
338
|
gl.deleteBuffer(vbo);
|
|
389
339
|
gl.deleteProgram(program);
|
|
390
340
|
gl.deleteVertexArray(vao);
|
|
391
|
-
gl.deleteTexture(sourceTexture);
|
|
392
341
|
gl.deleteTexture(paletteTexture);
|
|
393
342
|
},
|
|
394
343
|
schema: starburstEffectSchema,
|
|
@@ -709,6 +658,7 @@ var StarburstInternals = {
|
|
|
709
658
|
};
|
|
710
659
|
export {
|
|
711
660
|
starburstEffectSchema,
|
|
661
|
+
starburst,
|
|
712
662
|
StarburstInternals,
|
|
713
663
|
Starburst
|
|
714
664
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Starburst } from './Starburst';
|
|
2
2
|
export type { StarburstProps } from './Starburst';
|
|
3
|
-
export { starburstEffectSchema, type StarburstEffectParams, } from './starburst-effect';
|
|
3
|
+
export { starburst, starburstEffectSchema, type StarburstEffectParams, } from './starburst-effect';
|
|
4
4
|
export declare const StarburstInternals: {
|
|
5
5
|
readonly starburst: (params: import("./starburst-effect").StarburstEffectParams & {
|
|
6
6
|
readonly disabled?: boolean | undefined;
|
|
@@ -23,14 +23,6 @@ export declare const starburstEffectSchema: {
|
|
|
23
23
|
readonly default: 0;
|
|
24
24
|
readonly description: "Edge Smoothness";
|
|
25
25
|
};
|
|
26
|
-
readonly vignette: {
|
|
27
|
-
readonly type: "number";
|
|
28
|
-
readonly min: 0;
|
|
29
|
-
readonly max: 1;
|
|
30
|
-
readonly step: 0.01;
|
|
31
|
-
readonly default: 1;
|
|
32
|
-
readonly description: "Vignette";
|
|
33
|
-
};
|
|
34
26
|
readonly originOffsetX: {
|
|
35
27
|
readonly type: "number";
|
|
36
28
|
readonly min: -1;
|
|
@@ -53,7 +45,6 @@ export type StarburstEffectParams = {
|
|
|
53
45
|
readonly colors: readonly string[];
|
|
54
46
|
readonly rotation?: number;
|
|
55
47
|
readonly smoothness?: number;
|
|
56
|
-
readonly vignette?: number;
|
|
57
48
|
readonly originOffsetX?: number;
|
|
58
49
|
readonly originOffsetY?: number;
|
|
59
50
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/starburst",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.468",
|
|
4
4
|
"description": "Starburst ray effect for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"remotion": "4.0.
|
|
27
|
+
"remotion": "4.0.468",
|
|
28
28
|
"zod": "4.3.6"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
45
|
+
"@remotion/eslint-config-internal": "4.0.468",
|
|
46
46
|
"eslint": "9.19.0",
|
|
47
47
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
48
48
|
},
|