@remotion/effects 4.0.498 → 4.0.500

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.
@@ -1376,9 +1376,661 @@ var rings = createEffect3({
1376
1376
  validateParams: validateRingsParams
1377
1377
  });
1378
1378
 
1379
- // src/gridlines.ts
1379
+ // src/starburst.ts
1380
1380
  import { Internals as Internals4 } from "remotion";
1381
+ import { NoReactInternals } from "remotion/no-react";
1381
1382
  var { createEffect: createEffect4, createWebGL2ContextError: createWebGL2ContextError4 } = Internals4;
1383
+ var colorToRgb = (color) => {
1384
+ const packed = NoReactInternals.processColor(color);
1385
+ return [packed >>> 16 & 255, packed >>> 8 & 255, packed & 255];
1386
+ };
1387
+ var DEFAULT_ORIGIN2 = [0.5, 0.5];
1388
+ var starburstEffectSchema = {
1389
+ rays: {
1390
+ type: "number",
1391
+ min: 2,
1392
+ max: 100,
1393
+ step: 1,
1394
+ default: undefined,
1395
+ description: "Number of Rays",
1396
+ hiddenFromList: false
1397
+ },
1398
+ colors: {
1399
+ type: "array",
1400
+ item: {
1401
+ type: "color"
1402
+ },
1403
+ default: undefined,
1404
+ minLength: 2,
1405
+ newItemDefault: "#ff0000",
1406
+ description: "Colors",
1407
+ keyframable: false
1408
+ },
1409
+ rotation: {
1410
+ type: "number",
1411
+ min: 0,
1412
+ max: 360,
1413
+ step: 1,
1414
+ default: 0,
1415
+ description: "Rotation",
1416
+ hiddenFromList: false
1417
+ },
1418
+ smoothness: {
1419
+ type: "number",
1420
+ min: 0,
1421
+ max: 1,
1422
+ step: 0.01,
1423
+ default: 0,
1424
+ description: "Edge Smoothness",
1425
+ hiddenFromList: false
1426
+ },
1427
+ origin: {
1428
+ type: "uv-coordinate",
1429
+ min: 0,
1430
+ max: 1,
1431
+ step: 0.01,
1432
+ default: DEFAULT_ORIGIN2,
1433
+ description: "Origin"
1434
+ }
1435
+ };
1436
+ var resolve4 = (p) => ({
1437
+ rays: p.rays,
1438
+ colors: p.colors,
1439
+ rotation: p.rotation ?? 0,
1440
+ smoothness: p.smoothness ?? 0,
1441
+ origin: p.origin ?? DEFAULT_ORIGIN2
1442
+ });
1443
+ var validateStarburstEffectParams = (params) => {
1444
+ if (params === null || typeof params !== "object") {
1445
+ throw new TypeError(`Starburst effect requires a parameters object, but got ${JSON.stringify(params)}`);
1446
+ }
1447
+ const { rays, colors } = params;
1448
+ if (typeof rays !== "number" || !Number.isFinite(rays)) {
1449
+ throw new TypeError(`"rays" must be a finite number, but got ${JSON.stringify(rays)}`);
1450
+ }
1451
+ if (rays < 2 || rays > 100) {
1452
+ throw new RangeError(`"rays" must be between 2 and 100, but got ${rays}`);
1453
+ }
1454
+ if (!Array.isArray(colors) || colors.length < 2) {
1455
+ throw new TypeError(`"colors" must be an array with at least 2 colors, but got ${JSON.stringify(colors)}`);
1456
+ }
1457
+ const r = resolve4(params);
1458
+ if (typeof r.rotation !== "number" || !Number.isFinite(r.rotation)) {
1459
+ throw new TypeError(`"rotation" must be a finite number, but got ${JSON.stringify(params.rotation)}`);
1460
+ }
1461
+ if (typeof r.smoothness !== "number" || !Number.isFinite(r.smoothness)) {
1462
+ throw new TypeError(`"smoothness" must be a finite number, but got ${JSON.stringify(params.smoothness)}`);
1463
+ }
1464
+ if (r.smoothness < 0 || r.smoothness > 1) {
1465
+ throw new RangeError(`"smoothness" must be between 0 and 1, but got ${r.smoothness}`);
1466
+ }
1467
+ if (!Array.isArray(r.origin) || r.origin.length !== 2 || r.origin.some((coordinate) => {
1468
+ return typeof coordinate !== "number" || !Number.isFinite(coordinate);
1469
+ })) {
1470
+ throw new TypeError('"origin" must be a [number, number] tuple');
1471
+ }
1472
+ if (r.origin.some((coordinate) => coordinate < 0 || coordinate > 1)) {
1473
+ throw new RangeError(`"origin" must contain coordinates between 0 and 1, but got ${JSON.stringify(r.origin)}`);
1474
+ }
1475
+ for (const c of r.colors) {
1476
+ colorToRgb(c);
1477
+ }
1478
+ };
1479
+ var STARBURST_VS = `#version 300 es
1480
+ in vec2 aPos;
1481
+ in vec2 aUv;
1482
+ out vec2 vUv;
1483
+ void main() {
1484
+ vUv = aUv;
1485
+ gl_Position = vec4(aPos, 0.0, 1.0);
1486
+ }
1487
+ `;
1488
+ var STARBURST_FS = `#version 300 es
1489
+ precision highp float;
1490
+
1491
+ uniform sampler2D colorPalette;
1492
+ uniform float numRays;
1493
+ uniform float rotationOffset;
1494
+ uniform float smoothEdge;
1495
+ uniform vec2 resolution;
1496
+ uniform float numColors;
1497
+ uniform vec2 origin;
1498
+
1499
+ in vec2 vUv;
1500
+ out vec4 fragColor;
1501
+
1502
+ const float Pi = 3.14159265359;
1503
+
1504
+ void main() {
1505
+ vec2 uv = vUv;
1506
+ vec2 center = uv - origin;
1507
+ center.x *= resolution.x / resolution.y;
1508
+
1509
+ float angle = atan(center.y, center.x) + rotationOffset;
1510
+ float normalizedAngle = (angle + Pi) / (2.0 * Pi);
1511
+ float sector = normalizedAngle * numRays;
1512
+ float rayIndex = mod(floor(sector), numRays);
1513
+
1514
+ float colorIndex = mod(rayIndex, numColors);
1515
+ float texCoord = (colorIndex + 0.5) / numColors;
1516
+ vec3 col = texture(colorPalette, vec2(texCoord, 0.5)).rgb;
1517
+
1518
+ float fractSector = fract(sector);
1519
+ float edgeSmooth = smoothEdge * 0.5;
1520
+ float nextColorIndex = mod(rayIndex + 1.0, numColors);
1521
+ float nextTexCoord = (nextColorIndex + 0.5) / numColors;
1522
+ vec3 nextCol = texture(colorPalette, vec2(nextTexCoord, 0.5)).rgb;
1523
+
1524
+ float blend = smoothstep(1.0 - edgeSmooth, 1.0, fractSector);
1525
+ col = mix(col, nextCol, blend);
1526
+ float blendStart = smoothstep(edgeSmooth, 0.0, fractSector);
1527
+ float prevColorIndex = mod(rayIndex - 1.0 + numColors, numColors);
1528
+ float prevTexCoord = (prevColorIndex + 0.5) / numColors;
1529
+ vec3 prevCol = texture(colorPalette, vec2(prevTexCoord, 0.5)).rgb;
1530
+ col = mix(col, prevCol, blendStart);
1531
+
1532
+ fragColor = vec4(col, 1.0);
1533
+ }
1534
+ `;
1535
+ var compileShader4 = (gl, type, source) => {
1536
+ const shader = gl.createShader(type);
1537
+ if (!shader) {
1538
+ throw new Error("Failed to create WebGL shader");
1539
+ }
1540
+ gl.shaderSource(shader, source);
1541
+ gl.compileShader(shader);
1542
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
1543
+ const log = gl.getShaderInfoLog(shader);
1544
+ gl.deleteShader(shader);
1545
+ throw new Error(`Starburst shader compile failed: ${log ?? "(no log)"}`);
1546
+ }
1547
+ return shader;
1548
+ };
1549
+ var linkProgram4 = (gl, vs, fs) => {
1550
+ const program = gl.createProgram();
1551
+ if (!program) {
1552
+ throw new Error("Failed to create WebGL program");
1553
+ }
1554
+ gl.attachShader(program, vs);
1555
+ gl.attachShader(program, fs);
1556
+ gl.linkProgram(program);
1557
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
1558
+ const log = gl.getProgramInfoLog(program);
1559
+ gl.deleteProgram(program);
1560
+ throw new Error(`Starburst program link failed: ${log ?? "(no log)"}`);
1561
+ }
1562
+ return program;
1563
+ };
1564
+ var starburst = createEffect4({
1565
+ type: "remotion/starburst",
1566
+ label: "starburst()",
1567
+ documentationLink: "https://www.remotion.dev/docs/effects/starburst",
1568
+ backend: "webgl2",
1569
+ calculateKey: (params) => {
1570
+ const r = resolve4(params);
1571
+ return `starburst-${r.rays}-${r.colors.join("|")}-${r.rotation}-${r.smoothness}-${r.origin.join(":")}`;
1572
+ },
1573
+ setup: (target) => {
1574
+ const gl = target.getContext("webgl2", {
1575
+ premultipliedAlpha: true,
1576
+ alpha: true,
1577
+ preserveDrawingBuffer: true
1578
+ });
1579
+ if (!gl) {
1580
+ throw createWebGL2ContextError4("starburst effect");
1581
+ }
1582
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
1583
+ const vs = compileShader4(gl, gl.VERTEX_SHADER, STARBURST_VS);
1584
+ const fs = compileShader4(gl, gl.FRAGMENT_SHADER, STARBURST_FS);
1585
+ const program = linkProgram4(gl, vs, fs);
1586
+ gl.deleteShader(vs);
1587
+ gl.deleteShader(fs);
1588
+ const vao = gl.createVertexArray();
1589
+ if (!vao) {
1590
+ throw new Error("Failed to create WebGL vertex array");
1591
+ }
1592
+ gl.bindVertexArray(vao);
1593
+ const data = new Float32Array([
1594
+ -1,
1595
+ -1,
1596
+ 0,
1597
+ 0,
1598
+ 1,
1599
+ -1,
1600
+ 1,
1601
+ 0,
1602
+ -1,
1603
+ 1,
1604
+ 0,
1605
+ 1,
1606
+ 1,
1607
+ 1,
1608
+ 1,
1609
+ 1
1610
+ ]);
1611
+ const vbo = gl.createBuffer();
1612
+ if (!vbo) {
1613
+ throw new Error("Failed to create WebGL buffer");
1614
+ }
1615
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
1616
+ gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
1617
+ const aPos = gl.getAttribLocation(program, "aPos");
1618
+ const aUv = gl.getAttribLocation(program, "aUv");
1619
+ gl.enableVertexAttribArray(aPos);
1620
+ gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
1621
+ gl.enableVertexAttribArray(aUv);
1622
+ gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
1623
+ gl.bindVertexArray(null);
1624
+ const paletteTexture = gl.createTexture();
1625
+ if (!paletteTexture) {
1626
+ throw new Error("Failed to create WebGL palette texture");
1627
+ }
1628
+ gl.bindTexture(gl.TEXTURE_2D, paletteTexture);
1629
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
1630
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
1631
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1632
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1633
+ gl.bindTexture(gl.TEXTURE_2D, null);
1634
+ return {
1635
+ gl,
1636
+ program,
1637
+ vao,
1638
+ vbo,
1639
+ paletteTexture,
1640
+ uColorPalette: gl.getUniformLocation(program, "colorPalette"),
1641
+ uNumRays: gl.getUniformLocation(program, "numRays"),
1642
+ uRotationOffset: gl.getUniformLocation(program, "rotationOffset"),
1643
+ uSmoothEdge: gl.getUniformLocation(program, "smoothEdge"),
1644
+ uResolution: gl.getUniformLocation(program, "resolution"),
1645
+ uNumColors: gl.getUniformLocation(program, "numColors"),
1646
+ uOrigin: gl.getUniformLocation(program, "origin"),
1647
+ cachedPaletteKey: "",
1648
+ palettePixelData: new Uint8Array(0)
1649
+ };
1650
+ },
1651
+ apply: ({ width, height, params, state }) => {
1652
+ const r = resolve4(params);
1653
+ const {
1654
+ gl,
1655
+ program,
1656
+ vao,
1657
+ paletteTexture,
1658
+ uColorPalette,
1659
+ uNumRays,
1660
+ uRotationOffset,
1661
+ uSmoothEdge,
1662
+ uResolution,
1663
+ uNumColors,
1664
+ uOrigin
1665
+ } = state;
1666
+ const rotationRad = r.rotation * Math.PI / 180;
1667
+ const paletteKey = r.colors.join("|");
1668
+ const paletteDirty = state.cachedPaletteKey !== paletteKey;
1669
+ if (paletteDirty) {
1670
+ state.cachedPaletteKey = paletteKey;
1671
+ const len = r.colors.length * 4;
1672
+ if (state.palettePixelData.length !== len) {
1673
+ state.palettePixelData = new Uint8Array(len);
1674
+ }
1675
+ const { palettePixelData } = state;
1676
+ for (let i = 0;i < r.colors.length; i++) {
1677
+ const rgb = colorToRgb(r.colors[i]);
1678
+ palettePixelData[i * 4] = rgb[0];
1679
+ palettePixelData[i * 4 + 1] = rgb[1];
1680
+ palettePixelData[i * 4 + 2] = rgb[2];
1681
+ palettePixelData[i * 4 + 3] = 255;
1682
+ }
1683
+ }
1684
+ gl.viewport(0, 0, width, height);
1685
+ gl.clearColor(0, 0, 0, 0);
1686
+ gl.clear(gl.COLOR_BUFFER_BIT);
1687
+ gl.useProgram(program);
1688
+ gl.bindVertexArray(vao);
1689
+ gl.activeTexture(gl.TEXTURE0);
1690
+ gl.bindTexture(gl.TEXTURE_2D, paletteTexture);
1691
+ if (paletteDirty) {
1692
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, r.colors.length, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, state.palettePixelData);
1693
+ }
1694
+ if (uColorPalette)
1695
+ gl.uniform1i(uColorPalette, 0);
1696
+ if (uNumRays)
1697
+ gl.uniform1f(uNumRays, r.rays);
1698
+ if (uNumColors)
1699
+ gl.uniform1f(uNumColors, r.colors.length);
1700
+ if (uRotationOffset)
1701
+ gl.uniform1f(uRotationOffset, rotationRad);
1702
+ if (uSmoothEdge)
1703
+ gl.uniform1f(uSmoothEdge, r.smoothness);
1704
+ if (uOrigin)
1705
+ gl.uniform2f(uOrigin, r.origin[0], 1 - r.origin[1]);
1706
+ if (uResolution)
1707
+ gl.uniform2f(uResolution, width, height);
1708
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
1709
+ gl.bindVertexArray(null);
1710
+ gl.bindTexture(gl.TEXTURE_2D, null);
1711
+ gl.useProgram(null);
1712
+ },
1713
+ cleanup: ({ gl, program, vao, vbo, paletteTexture }) => {
1714
+ gl.deleteBuffer(vbo);
1715
+ gl.deleteProgram(program);
1716
+ gl.deleteVertexArray(vao);
1717
+ gl.deleteTexture(paletteTexture);
1718
+ },
1719
+ schema: starburstEffectSchema,
1720
+ validateParams: validateStarburstEffectParams
1721
+ });
1722
+
1723
+ // src/light-leak.ts
1724
+ import { Internals as Internals5 } from "remotion";
1725
+ var { createEffect: createEffect5, createWebGL2ContextError: createWebGL2ContextError5 } = Internals5;
1726
+ var DEFAULT_SEED = 0;
1727
+ var DEFAULT_HUE_SHIFT = 0;
1728
+ var DEFAULT_PROGRESS = 0.5;
1729
+ var lightLeakEffectSchema = {
1730
+ seed: {
1731
+ type: "number",
1732
+ default: DEFAULT_SEED,
1733
+ description: "Seed",
1734
+ hiddenFromList: false
1735
+ },
1736
+ hueShift: {
1737
+ type: "number",
1738
+ min: 0,
1739
+ max: 360,
1740
+ default: DEFAULT_HUE_SHIFT,
1741
+ description: "Hue Shift",
1742
+ hiddenFromList: false
1743
+ },
1744
+ progress: {
1745
+ type: "number",
1746
+ min: 0,
1747
+ max: 1,
1748
+ step: 0.01,
1749
+ default: DEFAULT_PROGRESS,
1750
+ description: "Progress",
1751
+ hiddenFromList: false
1752
+ }
1753
+ };
1754
+ var resolve5 = (p) => ({
1755
+ seed: p.seed ?? DEFAULT_SEED,
1756
+ hueShift: p.hueShift ?? DEFAULT_HUE_SHIFT,
1757
+ progress: p.progress ?? DEFAULT_PROGRESS
1758
+ });
1759
+ var validateLightLeakParams = (params) => {
1760
+ assertEffectParamsObject(params, "lightLeak()");
1761
+ assertOptionalFiniteNumber(params.seed, "seed");
1762
+ assertOptionalFiniteNumber(params.hueShift, "hueShift");
1763
+ assertOptionalFiniteNumber(params.progress, "progress");
1764
+ const { hueShift, progress } = resolve5(params);
1765
+ if (hueShift < 0) {
1766
+ throw new TypeError(`"hueShift" must be >= 0, but got ${hueShift}`);
1767
+ }
1768
+ if (hueShift > 360) {
1769
+ throw new TypeError(`"hueShift" must be <= 360, but got ${hueShift}`);
1770
+ }
1771
+ validateUnitInterval(progress, "progress");
1772
+ };
1773
+ var LIGHT_LEAK_VS = `#version 300 es
1774
+ in vec2 aPos;
1775
+ in vec2 aUv;
1776
+ out vec2 vUv;
1777
+ void main() {
1778
+ vUv = aUv;
1779
+ gl_Position = vec4(aPos, 0.0, 1.0);
1780
+ }
1781
+ `;
1782
+ var LIGHT_LEAK_FS = `#version 300 es
1783
+ precision highp float;
1784
+
1785
+ in vec2 vUv;
1786
+ out vec4 fragColor;
1787
+
1788
+ uniform sampler2D uSource;
1789
+ uniform float evolveProgress;
1790
+ uniform float retractProgress;
1791
+ uniform float seed;
1792
+ uniform float retractSeed;
1793
+ uniform float hueShift;
1794
+ uniform vec2 resolution;
1795
+
1796
+ const float Pi = 3.14159;
1797
+
1798
+ vec3 computePattern(vec2 uv, float s, float t) {
1799
+ vec2 p = uv * 0.8;
1800
+ p += vec2(sin(s * 1.61803) * 5.0, cos(s * 2.71828) * 5.0);
1801
+
1802
+ for (int i = 1; i < 5; i++) {
1803
+ vec2 newp = p;
1804
+ float fi = float(i);
1805
+ float phase = s * 0.7 * fi;
1806
+ newp.x += 0.6 / fi * cos(fi * p.y + t * 0.7 + 0.3 * fi + phase) + 20.0;
1807
+ newp.y += 0.6 / fi * cos(fi * p.x + t * 0.7 + 0.3 * float(i + 10) + phase) - 20.0 + 15.0;
1808
+ p = newp;
1809
+ }
1810
+
1811
+ float v1 = 0.5 * sin(2.0 * p.x) + 0.5;
1812
+ float v2 = 0.5 * sin(2.0 * p.y) + 0.5;
1813
+ float blend = sin(p.x + p.y) * 0.5 + 0.5;
1814
+ float brightness = v1 * 0.5 + v2 * 0.5;
1815
+ float patternValue = brightness * 0.6 + blend * 0.4;
1816
+
1817
+ return vec3(brightness, blend, patternValue);
1818
+ }
1819
+
1820
+ void main() {
1821
+ float refScale = 1.92;
1822
+ vec2 uv = (gl_FragCoord.xy / resolution) * vec2(refScale, refScale * resolution.y / resolution.x);
1823
+
1824
+ vec3 patA = computePattern(uv, seed, evolveProgress * Pi);
1825
+ float threshA = 1.0 - evolveProgress;
1826
+ float revealAlpha = smoothstep(threshA, threshA + 0.3, patA.z);
1827
+
1828
+ vec2 maxUv = vec2(refScale, refScale * resolution.y / resolution.x);
1829
+ vec2 retractUv = maxUv - uv;
1830
+ vec3 patB = computePattern(retractUv, retractSeed, retractProgress * Pi);
1831
+ float threshB = 1.0 - retractProgress;
1832
+ float eraseAlpha = smoothstep(threshB, threshB + 0.3, patB.z);
1833
+
1834
+ float alpha = revealAlpha * (1.0 - eraseAlpha);
1835
+
1836
+ vec3 yellow = vec3(1.0, 0.85, 0.2);
1837
+ vec3 orange = vec3(1.0, 0.5, 0.05);
1838
+ vec3 col = mix(yellow, orange, patA.y);
1839
+ col *= 0.6 + 0.6 * patA.x;
1840
+
1841
+ float angle = hueShift * Pi / 180.0;
1842
+ float cosA = cos(angle);
1843
+ float sinA = sin(angle);
1844
+ mat3 hueRot = mat3(
1845
+ cosA + (1.0 - cosA) / 3.0,
1846
+ (1.0 - cosA) / 3.0 - sinA * 0.57735,
1847
+ (1.0 - cosA) / 3.0 + sinA * 0.57735,
1848
+ (1.0 - cosA) / 3.0 + sinA * 0.57735,
1849
+ cosA + (1.0 - cosA) / 3.0,
1850
+ (1.0 - cosA) / 3.0 - sinA * 0.57735,
1851
+ (1.0 - cosA) / 3.0 - sinA * 0.57735,
1852
+ (1.0 - cosA) / 3.0 + sinA * 0.57735,
1853
+ cosA + (1.0 - cosA) / 3.0
1854
+ );
1855
+ col = clamp(hueRot * col, 0.0, 1.0);
1856
+
1857
+ vec4 src = texture(uSource, vUv);
1858
+ vec4 leakPm = vec4(col * alpha, alpha);
1859
+ fragColor = leakPm + src * (1.0 - alpha);
1860
+ }
1861
+ `;
1862
+ var compileShader5 = (gl, type, source) => {
1863
+ const shader = gl.createShader(type);
1864
+ if (!shader) {
1865
+ throw new Error("Failed to create WebGL shader");
1866
+ }
1867
+ gl.shaderSource(shader, source);
1868
+ gl.compileShader(shader);
1869
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
1870
+ const log = gl.getShaderInfoLog(shader);
1871
+ gl.deleteShader(shader);
1872
+ throw new Error(`Light leak shader compile failed: ${log ?? "(no log)"}`);
1873
+ }
1874
+ return shader;
1875
+ };
1876
+ var linkProgram5 = (gl, vs, fs) => {
1877
+ const program = gl.createProgram();
1878
+ if (!program) {
1879
+ throw new Error("Failed to create WebGL program");
1880
+ }
1881
+ gl.attachShader(program, vs);
1882
+ gl.attachShader(program, fs);
1883
+ gl.linkProgram(program);
1884
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
1885
+ const log = gl.getProgramInfoLog(program);
1886
+ gl.deleteProgram(program);
1887
+ throw new Error(`Light leak program link failed: ${log ?? "(no log)"}`);
1888
+ }
1889
+ return program;
1890
+ };
1891
+ var lightLeak = createEffect5({
1892
+ type: "remotion/light-leak",
1893
+ label: "lightLeak()",
1894
+ documentationLink: "https://www.remotion.dev/docs/effects/light-leak",
1895
+ backend: "webgl2",
1896
+ calculateKey: (params) => {
1897
+ const r = resolve5(params);
1898
+ return `light-leak-${r.seed}-${r.hueShift}-${r.progress}`;
1899
+ },
1900
+ setup: (target) => {
1901
+ const gl = target.getContext("webgl2", {
1902
+ premultipliedAlpha: true,
1903
+ alpha: true,
1904
+ preserveDrawingBuffer: true
1905
+ });
1906
+ if (!gl) {
1907
+ throw createWebGL2ContextError5("light leak effect");
1908
+ }
1909
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
1910
+ const vs = compileShader5(gl, gl.VERTEX_SHADER, LIGHT_LEAK_VS);
1911
+ const fs = compileShader5(gl, gl.FRAGMENT_SHADER, LIGHT_LEAK_FS);
1912
+ const program = linkProgram5(gl, vs, fs);
1913
+ gl.deleteShader(vs);
1914
+ gl.deleteShader(fs);
1915
+ const vao = gl.createVertexArray();
1916
+ if (!vao) {
1917
+ throw new Error("Failed to create WebGL vertex array");
1918
+ }
1919
+ gl.bindVertexArray(vao);
1920
+ const data = new Float32Array([
1921
+ -1,
1922
+ -1,
1923
+ 0,
1924
+ 0,
1925
+ 1,
1926
+ -1,
1927
+ 1,
1928
+ 0,
1929
+ -1,
1930
+ 1,
1931
+ 0,
1932
+ 1,
1933
+ 1,
1934
+ 1,
1935
+ 1,
1936
+ 1
1937
+ ]);
1938
+ const vbo = gl.createBuffer();
1939
+ if (!vbo) {
1940
+ throw new Error("Failed to create WebGL buffer");
1941
+ }
1942
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
1943
+ gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
1944
+ const aPos = gl.getAttribLocation(program, "aPos");
1945
+ const aUv = gl.getAttribLocation(program, "aUv");
1946
+ gl.enableVertexAttribArray(aPos);
1947
+ gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
1948
+ gl.enableVertexAttribArray(aUv);
1949
+ gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
1950
+ gl.bindVertexArray(null);
1951
+ const texture = gl.createTexture();
1952
+ if (!texture) {
1953
+ throw new Error("Failed to create WebGL texture");
1954
+ }
1955
+ gl.bindTexture(gl.TEXTURE_2D, texture);
1956
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1957
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1958
+ gl.bindTexture(gl.TEXTURE_2D, null);
1959
+ return {
1960
+ gl,
1961
+ program,
1962
+ vao,
1963
+ vbo,
1964
+ texture,
1965
+ uSource: gl.getUniformLocation(program, "uSource"),
1966
+ uEvolveProgress: gl.getUniformLocation(program, "evolveProgress"),
1967
+ uRetractProgress: gl.getUniformLocation(program, "retractProgress"),
1968
+ uSeed: gl.getUniformLocation(program, "seed"),
1969
+ uRetractSeed: gl.getUniformLocation(program, "retractSeed"),
1970
+ uHueShift: gl.getUniformLocation(program, "hueShift"),
1971
+ uResolution: gl.getUniformLocation(program, "resolution")
1972
+ };
1973
+ },
1974
+ apply: ({ source, width, height, params, state, flipSourceY }) => {
1975
+ const r = resolve5(params);
1976
+ const evolveProgress = Math.min(1, r.progress * 2);
1977
+ const retractProgress = Math.max(0, r.progress * 2 - 1);
1978
+ const {
1979
+ gl,
1980
+ program,
1981
+ vao,
1982
+ texture,
1983
+ uSource,
1984
+ uEvolveProgress,
1985
+ uRetractProgress,
1986
+ uSeed,
1987
+ uRetractSeed,
1988
+ uHueShift,
1989
+ uResolution
1990
+ } = state;
1991
+ gl.viewport(0, 0, width, height);
1992
+ gl.clearColor(0, 0, 0, 0);
1993
+ gl.clear(gl.COLOR_BUFFER_BIT);
1994
+ gl.useProgram(program);
1995
+ gl.bindVertexArray(vao);
1996
+ gl.activeTexture(gl.TEXTURE0);
1997
+ gl.bindTexture(gl.TEXTURE_2D, texture);
1998
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
1999
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
2000
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
2001
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
2002
+ if (uSource)
2003
+ gl.uniform1i(uSource, 0);
2004
+ if (uEvolveProgress)
2005
+ gl.uniform1f(uEvolveProgress, evolveProgress);
2006
+ if (uRetractProgress)
2007
+ gl.uniform1f(uRetractProgress, retractProgress);
2008
+ if (uSeed)
2009
+ gl.uniform1f(uSeed, r.seed);
2010
+ if (uRetractSeed)
2011
+ gl.uniform1f(uRetractSeed, r.seed + 42);
2012
+ if (uHueShift)
2013
+ gl.uniform1f(uHueShift, r.hueShift);
2014
+ if (uResolution)
2015
+ gl.uniform2f(uResolution, width, height);
2016
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
2017
+ gl.bindVertexArray(null);
2018
+ gl.bindTexture(gl.TEXTURE_2D, null);
2019
+ gl.useProgram(null);
2020
+ },
2021
+ cleanup: ({ gl, program, vao, vbo, texture }) => {
2022
+ gl.deleteBuffer(vbo);
2023
+ gl.deleteProgram(program);
2024
+ gl.deleteVertexArray(vao);
2025
+ gl.deleteTexture(texture);
2026
+ },
2027
+ schema: lightLeakEffectSchema,
2028
+ validateParams: validateLightLeakParams
2029
+ });
2030
+
2031
+ // src/gridlines.ts
2032
+ import { Internals as Internals6 } from "remotion";
2033
+ var { createEffect: createEffect6, createWebGL2ContextError: createWebGL2ContextError6 } = Internals6;
1382
2034
  var DEFAULT_GRID_SIZE = 64;
1383
2035
  var DEFAULT_LINE_WIDTH = 2;
1384
2036
  var DEFAULT_LINE_COLOR = "#ffffff";
@@ -1476,7 +2128,7 @@ var gridlinesSchema = {
1476
2128
  description: "Mask to source alpha"
1477
2129
  }
1478
2130
  };
1479
- var resolve4 = (p) => ({
2131
+ var resolve6 = (p) => ({
1480
2132
  gridSize: p.gridSize ?? DEFAULT_GRID_SIZE,
1481
2133
  lineWidth: p.lineWidth ?? DEFAULT_LINE_WIDTH,
1482
2134
  lineColor: p.lineColor ?? DEFAULT_LINE_COLOR,
@@ -1642,7 +2294,7 @@ void main() {
1642
2294
  fragColor = sourceOver(sourceOver(texColor, background), line);
1643
2295
  }
1644
2296
  `;
1645
- var compileShader4 = (gl, type, source) => {
2297
+ var compileShader6 = (gl, type, source) => {
1646
2298
  const shader = gl.createShader(type);
1647
2299
  if (!shader) {
1648
2300
  throw new Error("Failed to create WebGL shader");
@@ -1656,7 +2308,7 @@ var compileShader4 = (gl, type, source) => {
1656
2308
  }
1657
2309
  return shader;
1658
2310
  };
1659
- var linkProgram4 = (gl, vs, fs) => {
2311
+ var linkProgram6 = (gl, vs, fs) => {
1660
2312
  const program = gl.createProgram();
1661
2313
  if (!program) {
1662
2314
  throw new Error("Failed to create WebGL program");
@@ -1676,13 +2328,13 @@ var rgbaToUniform = (rgba) => {
1676
2328
  const alpha = a / 255;
1677
2329
  return [r / 255 * alpha, g / 255 * alpha, b / 255 * alpha, alpha];
1678
2330
  };
1679
- var gridlines = createEffect4({
2331
+ var gridlines = createEffect6({
1680
2332
  type: "remotion/gridlines",
1681
2333
  label: "gridlines()",
1682
2334
  documentationLink: "https://www.remotion.dev/docs/effects/gridlines",
1683
2335
  backend: "webgl2",
1684
2336
  calculateKey: (params) => {
1685
- const r = resolve4(params);
2337
+ const r = resolve6(params);
1686
2338
  const maskSuffix = r.maskToSourceAlpha ? "-mask-to-source-alpha" : "";
1687
2339
  return `gridlines-${r.gridSize}-${r.lineWidth}-${r.lineColor}-${r.backgroundColor}-${r.rotation}-${r.rotationX}-${r.rotationY}-${r.perspective}-${r.offsetX}-${r.offsetY}${maskSuffix}`;
1688
2340
  },
@@ -1693,12 +2345,12 @@ var gridlines = createEffect4({
1693
2345
  preserveDrawingBuffer: true
1694
2346
  });
1695
2347
  if (!gl) {
1696
- throw createWebGL2ContextError4("gridlines effect");
2348
+ throw createWebGL2ContextError6("gridlines effect");
1697
2349
  }
1698
2350
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
1699
- const vs = compileShader4(gl, gl.VERTEX_SHADER, GRIDLINES_VS);
1700
- const fs = compileShader4(gl, gl.FRAGMENT_SHADER, GRIDLINES_FS);
1701
- const program = linkProgram4(gl, vs, fs);
2351
+ const vs = compileShader6(gl, gl.VERTEX_SHADER, GRIDLINES_VS);
2352
+ const fs = compileShader6(gl, gl.FRAGMENT_SHADER, GRIDLINES_FS);
2353
+ const program = linkProgram6(gl, vs, fs);
1702
2354
  gl.deleteShader(vs);
1703
2355
  gl.deleteShader(fs);
1704
2356
  const vao = gl.createVertexArray();
@@ -1782,7 +2434,7 @@ var gridlines = createEffect4({
1782
2434
  };
1783
2435
  },
1784
2436
  apply: ({ source, width, height, params, state, flipSourceY }) => {
1785
- const r = resolve4(params);
2437
+ const r = resolve6(params);
1786
2438
  const { gl, program, vao, texture, uniforms } = state;
1787
2439
  if (state.cachedLineColorStr !== r.lineColor) {
1788
2440
  state.cachedLineColorStr = r.lineColor;
@@ -1844,8 +2496,8 @@ var gridlines = createEffect4({
1844
2496
  });
1845
2497
 
1846
2498
  // src/zigzag.ts
1847
- import { Internals as Internals5 } from "remotion";
1848
- var { createEffect: createEffect5, createWebGL2ContextError: createWebGL2ContextError5 } = Internals5;
2499
+ import { Internals as Internals7 } from "remotion";
2500
+ var { createEffect: createEffect7, createWebGL2ContextError: createWebGL2ContextError7 } = Internals7;
1849
2501
  var ZIGZAG_DIRECTIONS = ["horizontal", "vertical"];
1850
2502
  var DEFAULT_COLORS3 = ["#dff4ff", "#7cc6ff"];
1851
2503
  var DEFAULT_DIRECTION = "horizontal";
@@ -1932,7 +2584,7 @@ var zigzagSchema = {
1932
2584
  description: "Mask to source alpha"
1933
2585
  }
1934
2586
  };
1935
- var resolve5 = (p) => {
2587
+ var resolve7 = (p) => {
1936
2588
  const thickness = p.thickness ?? DEFAULT_THICKNESS2;
1937
2589
  const gap = p.gap ?? DEFAULT_GAP4;
1938
2590
  return {
@@ -2078,7 +2730,7 @@ void main() {
2078
2730
  );
2079
2731
  }
2080
2732
  `;
2081
- var compileShader5 = (gl, type, source) => {
2733
+ var compileShader7 = (gl, type, source) => {
2082
2734
  const shader = gl.createShader(type);
2083
2735
  if (!shader) {
2084
2736
  throw new Error("Failed to create WebGL shader");
@@ -2092,7 +2744,7 @@ var compileShader5 = (gl, type, source) => {
2092
2744
  }
2093
2745
  return shader;
2094
2746
  };
2095
- var linkProgram5 = (gl, vs, fs) => {
2747
+ var linkProgram7 = (gl, vs, fs) => {
2096
2748
  const program = gl.createProgram();
2097
2749
  if (!program) {
2098
2750
  throw new Error("Failed to create WebGL program");
@@ -2108,9 +2760,9 @@ var linkProgram5 = (gl, vs, fs) => {
2108
2760
  return program;
2109
2761
  };
2110
2762
  var createProgram3 = (gl, vertexSource, fragmentSource) => {
2111
- const vs = compileShader5(gl, gl.VERTEX_SHADER, vertexSource);
2112
- const fs = compileShader5(gl, gl.FRAGMENT_SHADER, fragmentSource);
2113
- const program = linkProgram5(gl, vs, fs);
2763
+ const vs = compileShader7(gl, gl.VERTEX_SHADER, vertexSource);
2764
+ const fs = compileShader7(gl, gl.FRAGMENT_SHADER, fragmentSource);
2765
+ const program = linkProgram7(gl, vs, fs);
2114
2766
  gl.deleteShader(vs);
2115
2767
  gl.deleteShader(fs);
2116
2768
  return program;
@@ -2135,7 +2787,7 @@ var setupZigzag = (target) => {
2135
2787
  preserveDrawingBuffer: true
2136
2788
  });
2137
2789
  if (!gl) {
2138
- throw createWebGL2ContextError5("zigzag effect");
2790
+ throw createWebGL2ContextError7("zigzag effect");
2139
2791
  }
2140
2792
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
2141
2793
  const program = createProgram3(gl, ZIGZAG_VS, ZIGZAG_FS);
@@ -2229,19 +2881,19 @@ var updatePalette3 = (state, colors) => {
2229
2881
  }
2230
2882
  return true;
2231
2883
  };
2232
- var zigzag = createEffect5({
2884
+ var zigzag = createEffect7({
2233
2885
  type: "dev.remotion.effects.zigzag",
2234
2886
  label: "zigzag()",
2235
2887
  documentationLink: "https://www.remotion.dev/docs/effects/zigzag",
2236
2888
  backend: "webgl2",
2237
2889
  calculateKey: (params) => {
2238
- const r = resolve5(params);
2890
+ const r = resolve7(params);
2239
2891
  const maskSuffix = r.maskToSourceAlpha ? "-mask-to-source-alpha" : "";
2240
2892
  return `zigzag-${r.colors.join("|")}-${r.direction}-${r.thickness}-${r.spacing}-${r.angle}-${r.offset}-${r.amplitude}-${r.wavelength}${maskSuffix}`;
2241
2893
  },
2242
2894
  setup: (target) => setupZigzag(target),
2243
2895
  apply: ({ source, width, height, params, state, flipSourceY }) => {
2244
- const r = resolve5(params);
2896
+ const r = resolve7(params);
2245
2897
  const paletteDirty = updatePalette3(state, r.colors);
2246
2898
  const { gl, program, sourceTexture, paletteTexture, uniforms, vao } = state;
2247
2899
  gl.viewport(0, 0, width, height);
@@ -2311,8 +2963,8 @@ var zigzag = createEffect5({
2311
2963
  });
2312
2964
 
2313
2965
  // src/linear-gradient.ts
2314
- import { Internals as Internals6 } from "remotion";
2315
- var { createEffect: createEffect6, createWebGL2ContextError: createWebGL2ContextError6 } = Internals6;
2966
+ import { Internals as Internals8 } from "remotion";
2967
+ var { createEffect: createEffect8, createWebGL2ContextError: createWebGL2ContextError8 } = Internals8;
2316
2968
  var DEFAULT_START = [0, 0.5];
2317
2969
  var DEFAULT_END = [1, 0.5];
2318
2970
  var DEFAULT_START_COLOR = "#000000";
@@ -2349,7 +3001,7 @@ var linearGradientSchema = {
2349
3001
  description: "End color"
2350
3002
  }
2351
3003
  };
2352
- var resolve6 = (p) => ({
3004
+ var resolve8 = (p) => ({
2353
3005
  start: [...p.start ?? DEFAULT_START],
2354
3006
  end: [...p.end ?? DEFAULT_END],
2355
3007
  startColor: p.startColor ?? DEFAULT_START_COLOR,
@@ -2407,7 +3059,7 @@ void main() {
2407
3059
  fragColor = vec4(color.rgb * color.a, color.a);
2408
3060
  }
2409
3061
  `;
2410
- var compileShader6 = (gl, type, source) => {
3062
+ var compileShader8 = (gl, type, source) => {
2411
3063
  const shader = gl.createShader(type);
2412
3064
  if (!shader) {
2413
3065
  throw new Error("Failed to create WebGL shader");
@@ -2422,8 +3074,8 @@ var compileShader6 = (gl, type, source) => {
2422
3074
  return shader;
2423
3075
  };
2424
3076
  var createProgram4 = (gl) => {
2425
- const vs = compileShader6(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
2426
- const fs = compileShader6(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
3077
+ const vs = compileShader8(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
3078
+ const fs = compileShader8(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
2427
3079
  const program = gl.createProgram();
2428
3080
  if (!program) {
2429
3081
  throw new Error("Failed to create WebGL program");
@@ -2447,7 +3099,7 @@ var setupLinearGradient = (target) => {
2447
3099
  preserveDrawingBuffer: true
2448
3100
  });
2449
3101
  if (!gl) {
2450
- throw createWebGL2ContextError6("linear gradient effect");
3102
+ throw createWebGL2ContextError8("linear gradient effect");
2451
3103
  }
2452
3104
  const program = createProgram4(gl);
2453
3105
  const vao = gl.createVertexArray();
@@ -2528,18 +3180,18 @@ var getParsedColors = (state, resolved) => {
2528
3180
  end: state.cachedEndColorRgba
2529
3181
  };
2530
3182
  };
2531
- var linearGradient = createEffect6({
3183
+ var linearGradient = createEffect8({
2532
3184
  type: "dev.remotion.effects.linearGradient",
2533
3185
  label: "linearGradient()",
2534
3186
  documentationLink: "https://www.remotion.dev/docs/effects/linear-gradient",
2535
3187
  backend: "webgl2",
2536
3188
  calculateKey: (params) => {
2537
- const r = resolve6(params);
3189
+ const r = resolve8(params);
2538
3190
  return `linear-gradient-${r.start.join(":")}-${r.end.join(":")}-${r.startColor}-${r.endColor}`;
2539
3191
  },
2540
3192
  setup: (target) => setupLinearGradient(target),
2541
3193
  apply: ({ width, height, params, state }) => {
2542
- const r = resolve6(params);
3194
+ const r = resolve8(params);
2543
3195
  const { start, end } = getParsedColors(state, r);
2544
3196
  const [sr, sg, sb, sa] = normalizedRgba(start);
2545
3197
  const [er, eg, eb, ea] = normalizedRgba(end);
@@ -2574,8 +3226,8 @@ var linearGradient = createEffect6({
2574
3226
  });
2575
3227
 
2576
3228
  // src/linear-gradient-tint.ts
2577
- import { Internals as Internals7 } from "remotion";
2578
- var { createEffect: createEffect7, createWebGL2ContextError: createWebGL2ContextError7 } = Internals7;
3229
+ import { Internals as Internals9 } from "remotion";
3230
+ var { createEffect: createEffect9, createWebGL2ContextError: createWebGL2ContextError9 } = Internals9;
2579
3231
  var DEFAULT_START2 = [0, 0.5];
2580
3232
  var DEFAULT_END2 = [1, 0.5];
2581
3233
  var DEFAULT_START_COLOR2 = "#000000";
@@ -2622,7 +3274,7 @@ var linearGradientTintSchema = {
2622
3274
  hiddenFromList: false
2623
3275
  }
2624
3276
  };
2625
- var resolve7 = (p) => ({
3277
+ var resolve9 = (p) => ({
2626
3278
  start: [...p.start ?? DEFAULT_START2],
2627
3279
  end: [...p.end ?? DEFAULT_END2],
2628
3280
  startColor: p.startColor ?? DEFAULT_START_COLOR2,
@@ -2644,7 +3296,7 @@ var validateLinearGradientTintParams = (params) => {
2644
3296
  assertOptionalColor(params.startColor, "startColor");
2645
3297
  assertOptionalColor(params.endColor, "endColor");
2646
3298
  assertOptionalFiniteNumber(params.amount, "amount");
2647
- validateUnitInterval(resolve7(params).amount, "amount");
3299
+ validateUnitInterval(resolve9(params).amount, "amount");
2648
3300
  };
2649
3301
  var VERTEX_SHADER2 = `#version 300 es
2650
3302
  in vec2 aPos;
@@ -2696,7 +3348,7 @@ void main() {
2696
3348
  fragColor = vec4(blended * alpha, alpha);
2697
3349
  }
2698
3350
  `;
2699
- var compileShader7 = (gl, type, source) => {
3351
+ var compileShader9 = (gl, type, source) => {
2700
3352
  const shader = gl.createShader(type);
2701
3353
  if (!shader) {
2702
3354
  throw new Error("Failed to create WebGL shader");
@@ -2711,8 +3363,8 @@ var compileShader7 = (gl, type, source) => {
2711
3363
  return shader;
2712
3364
  };
2713
3365
  var createProgram5 = (gl) => {
2714
- const vs = compileShader7(gl, gl.VERTEX_SHADER, VERTEX_SHADER2);
2715
- const fs = compileShader7(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER2);
3366
+ const vs = compileShader9(gl, gl.VERTEX_SHADER, VERTEX_SHADER2);
3367
+ const fs = compileShader9(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER2);
2716
3368
  const program = gl.createProgram();
2717
3369
  if (!program) {
2718
3370
  throw new Error("Failed to create WebGL program");
@@ -2749,7 +3401,7 @@ var setupLinearGradientTint = (target) => {
2749
3401
  preserveDrawingBuffer: true
2750
3402
  });
2751
3403
  if (!gl) {
2752
- throw createWebGL2ContextError7("linear gradient tint effect");
3404
+ throw createWebGL2ContextError9("linear gradient tint effect");
2753
3405
  }
2754
3406
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
2755
3407
  const program = createProgram5(gl);
@@ -2835,18 +3487,18 @@ var getParsedColors2 = (state, resolved) => {
2835
3487
  end: state.cachedEndColorRgba
2836
3488
  };
2837
3489
  };
2838
- var linearGradientTint = createEffect7({
3490
+ var linearGradientTint = createEffect9({
2839
3491
  type: "dev.remotion.effects.linearGradientTint",
2840
3492
  label: "linearGradientTint()",
2841
3493
  documentationLink: "https://www.remotion.dev/docs/effects/linear-gradient-tint",
2842
3494
  backend: "webgl2",
2843
3495
  calculateKey: (params) => {
2844
- const r = resolve7(params);
3496
+ const r = resolve9(params);
2845
3497
  return `linear-gradient-tint-${r.start.join(":")}-${r.end.join(":")}-${r.startColor}-${r.endColor}-${r.amount}`;
2846
3498
  },
2847
3499
  setup: (target) => setupLinearGradientTint(target),
2848
3500
  apply: ({ source, width, height, params, state, flipSourceY }) => {
2849
- const r = resolve7(params);
3501
+ const r = resolve9(params);
2850
3502
  const { start, end } = getParsedColors2(state, r);
2851
3503
  const [sr, sg, sb, sa] = normalizedRgba2(start);
2852
3504
  const [er, eg, eb, ea] = normalizedRgba2(end);
@@ -2890,10 +3542,10 @@ var linearGradientTint = createEffect7({
2890
3542
  validateParams: validateLinearGradientTintParams
2891
3543
  });
2892
3544
  // src/corner-pin/index.ts
2893
- import { Internals as Internals9 } from "remotion";
3545
+ import { Internals as Internals11 } from "remotion";
2894
3546
 
2895
3547
  // src/corner-pin/corner-pin-runtime.ts
2896
- import { Internals as Internals8 } from "remotion";
3548
+ import { Internals as Internals10 } from "remotion";
2897
3549
 
2898
3550
  // src/corner-pin/corner-pin-shaders.ts
2899
3551
  var CORNER_PIN_VS = `#version 300 es
@@ -2991,8 +3643,8 @@ void main() {
2991
3643
  `;
2992
3644
 
2993
3645
  // src/corner-pin/corner-pin-runtime.ts
2994
- var { createWebGL2ContextError: createWebGL2ContextError8 } = Internals8;
2995
- var compileShader8 = (gl, type, source) => {
3646
+ var { createWebGL2ContextError: createWebGL2ContextError10 } = Internals10;
3647
+ var compileShader10 = (gl, type, source) => {
2996
3648
  const shader = gl.createShader(type);
2997
3649
  if (!shader) {
2998
3650
  throw new Error("Failed to create WebGL shader");
@@ -3006,7 +3658,7 @@ var compileShader8 = (gl, type, source) => {
3006
3658
  }
3007
3659
  return shader;
3008
3660
  };
3009
- var linkProgram6 = (gl, vs, fs) => {
3661
+ var linkProgram8 = (gl, vs, fs) => {
3010
3662
  const program = gl.createProgram();
3011
3663
  if (!program) {
3012
3664
  throw new Error("Failed to create WebGL program");
@@ -3022,9 +3674,9 @@ var linkProgram6 = (gl, vs, fs) => {
3022
3674
  return program;
3023
3675
  };
3024
3676
  var createProgram6 = (gl, vertexSource, fragmentSource) => {
3025
- const vs = compileShader8(gl, gl.VERTEX_SHADER, vertexSource);
3026
- const fs = compileShader8(gl, gl.FRAGMENT_SHADER, fragmentSource);
3027
- const program = linkProgram6(gl, vs, fs);
3677
+ const vs = compileShader10(gl, gl.VERTEX_SHADER, vertexSource);
3678
+ const fs = compileShader10(gl, gl.FRAGMENT_SHADER, fragmentSource);
3679
+ const program = linkProgram8(gl, vs, fs);
3028
3680
  gl.deleteShader(vs);
3029
3681
  gl.deleteShader(fs);
3030
3682
  return program;
@@ -3049,7 +3701,7 @@ var setupCornerPin = (target) => {
3049
3701
  preserveDrawingBuffer: true
3050
3702
  });
3051
3703
  if (!gl) {
3052
- throw createWebGL2ContextError8("corner pin effect");
3704
+ throw createWebGL2ContextError10("corner pin effect");
3053
3705
  }
3054
3706
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
3055
3707
  const program = createProgram6(gl, CORNER_PIN_VS, CORNER_PIN_FS);
@@ -3158,7 +3810,7 @@ var applyCornerPin = ({
3158
3810
  };
3159
3811
 
3160
3812
  // src/corner-pin/index.ts
3161
- var { createEffect: createEffect8 } = Internals9;
3813
+ var { createEffect: createEffect10 } = Internals11;
3162
3814
  var DEFAULT_TOP_LEFT = [0, 0];
3163
3815
  var DEFAULT_TOP_RIGHT = [1, 0];
3164
3816
  var DEFAULT_BOTTOM_RIGHT = [1, 1];
@@ -3189,7 +3841,7 @@ var cornerPinSchema = {
3189
3841
  description: "Bottom left"
3190
3842
  }
3191
3843
  };
3192
- var resolve8 = (p) => ({
3844
+ var resolve10 = (p) => ({
3193
3845
  topLeft: [...p.topLeft ?? DEFAULT_TOP_LEFT],
3194
3846
  topRight: [...p.topRight ?? DEFAULT_TOP_RIGHT],
3195
3847
  bottomRight: [
@@ -3214,18 +3866,18 @@ var validateCornerPinParams = (params) => {
3214
3866
  assertOptionalUvCoordinate4(params.bottomRight, "bottomRight");
3215
3867
  assertOptionalUvCoordinate4(params.bottomLeft, "bottomLeft");
3216
3868
  };
3217
- var cornerPin = createEffect8({
3869
+ var cornerPin = createEffect10({
3218
3870
  type: "dev.remotion.effects.cornerPin",
3219
3871
  label: "cornerPin()",
3220
3872
  documentationLink: "https://www.remotion.dev/docs/effects/corner-pin",
3221
3873
  backend: "webgl2",
3222
3874
  calculateKey: (params) => {
3223
- const r = resolve8(params);
3875
+ const r = resolve10(params);
3224
3876
  return `corner-pin-${r.topLeft.join(":")}-${r.topRight.join(":")}-${r.bottomRight.join(":")}-${r.bottomLeft.join(":")}`;
3225
3877
  },
3226
3878
  setup: (target) => setupCornerPin(target),
3227
3879
  apply: ({ source, width, height, params, state, flipSourceY }) => {
3228
- const r = resolve8(params);
3880
+ const r = resolve10(params);
3229
3881
  applyCornerPin({
3230
3882
  state,
3231
3883
  source,
@@ -3244,10 +3896,14 @@ var cornerPin = createEffect8({
3244
3896
  });
3245
3897
  export {
3246
3898
  zigzag,
3899
+ starburstEffectSchema,
3900
+ starburst,
3247
3901
  rings,
3248
3902
  pattern,
3249
3903
  linearGradientTint,
3250
3904
  linearGradient,
3905
+ lightLeakEffectSchema,
3906
+ lightLeak,
3251
3907
  gridlines,
3252
3908
  cornerPin,
3253
3909
  checkerboard