@clypra-studio/engine 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TransitionDefinition-CC6oSTYB.d.cts +158 -0
- package/dist/TransitionDefinition-CC6oSTYB.d.ts +158 -0
- package/dist/chunk-4Y7ZSGHJ.js +2990 -0
- package/dist/chunk-4Y7ZSGHJ.js.map +1 -0
- package/dist/chunk-AUMNXFYQ.js +667 -0
- package/dist/chunk-AUMNXFYQ.js.map +1 -0
- package/dist/{chunk-CJRH4PAV.js → chunk-LGW5SSLZ.js} +292 -61
- package/dist/chunk-LGW5SSLZ.js.map +1 -0
- package/dist/{chunk-EVQAI3P3.js → chunk-S24UVNPZ.js} +5 -1
- package/dist/{chunk-EVQAI3P3.js.map → chunk-S24UVNPZ.js.map} +1 -1
- package/dist/{index-BWo6qV_z.d.cts → index-BP1N8Yg7.d.cts} +2 -2
- package/dist/{index-BWo6qV_z.d.ts → index-BP1N8Yg7.d.ts} +2 -2
- package/dist/index.cjs +3882 -1366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +428 -3798
- package/dist/index.d.ts +428 -3798
- package/dist/index.js +1373 -1498
- package/dist/index.js.map +1 -1
- package/dist/textEffects/index.cjs.map +1 -1
- package/dist/textEffects/index.js +1 -1
- package/dist/transitions/index.cjs +2207 -3
- package/dist/transitions/index.cjs.map +1 -1
- package/dist/transitions/index.d.cts +54 -5
- package/dist/transitions/index.d.ts +54 -5
- package/dist/transitions/index.js +53 -3
- package/dist/v2/backends/index.cjs +246 -33
- package/dist/v2/backends/index.cjs.map +1 -1
- package/dist/v2/backends/index.d.cts +1 -1
- package/dist/v2/backends/index.d.ts +1 -1
- package/dist/v2/backends/index.js +1 -1
- package/dist/videoEffects/index.cjs +287 -62
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +31 -134
- package/dist/videoEffects/index.d.ts +31 -134
- package/dist/videoEffects/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-5JOAEDIQ.js +0 -446
- package/dist/chunk-5JOAEDIQ.js.map +0 -1
- package/dist/chunk-CJRH4PAV.js.map +0 -1
- package/dist/chunk-QMRMNH52.js +0 -811
- package/dist/chunk-QMRMNH52.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/v2/backends/PixiRenderBackend.ts","../src/effects/light/ColorAdjustmentsEffect.ts","../src/v2/backends/colorAdjustmentsFilter.ts"],"sourcesContent":["/**\n * @clypra/engine — Pipeline V2: Pixi Render Backend\n *\n * @deprecated Use @clypra/runtime/renderer instead\n * The runtime version (PixiRenderer) is more complete with better resource management.\n * This file will be removed in v3.0.0\n *\n * RenderBackend implementation using Pixi.js for GPU pass execution.\n */\n\nimport * as PIXI from \"pixi.js\";\nimport { AdjustmentFilter } from \"pixi-filters\";\nimport type { RenderBackend, CommandBuffer } from \"../runtime/types\";\nimport type { RenderPass } from \"../planner/types\";\nimport { createColorAdjustmentsFilter, updateColorAdjustmentsFilter, normalizeColorAdjustmentsUniforms } from \"./colorAdjustmentsFilter.js\";\n\nexport class PixiRenderBackend implements RenderBackend {\n private app: PIXI.Application | null = null;\n private initialized = false;\n private resources = new Map<string, PIXI.Texture>();\n private filters = new Map<string, PIXI.Filter>();\n private canvasElement?: HTMLCanvasElement;\n\n async init(canvasElement?: HTMLCanvasElement, width?: number, height?: number): Promise<void> {\n if (this.initialized) {\n throw new Error(\"PixiRenderBackend already initialized\");\n }\n\n this.canvasElement = canvasElement;\n\n const logicalWidth = width ?? canvasElement?.clientWidth ?? canvasElement?.width ?? 1920;\n const logicalHeight = height ?? canvasElement?.clientHeight ?? canvasElement?.height ?? 1080;\n\n this.app = new PIXI.Application();\n await this.app.init({\n canvas: canvasElement,\n width: logicalWidth,\n height: logicalHeight,\n backgroundColor: 0x0e0e12,\n antialias: true,\n preference: \"webgl\",\n resolution: typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1,\n autoDensity: true,\n preserveDrawingBuffer: true,\n });\n\n this.initialized = true;\n }\n\n resize(width: number, height: number): void {\n if (!this.app) return;\n this.app.renderer.resize(width, height);\n }\n\n get logicalWidth(): number {\n return this.app?.renderer.width ?? 0;\n }\n\n get logicalHeight(): number {\n return this.app?.renderer.height ?? 0;\n }\n\n allocateResource(id: string, _type: \"texture\" | \"buffer\", width: number, height: number, _format: string): void {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n if (this.resources.has(id)) {\n throw new Error(`Resource \"${id}\" already allocated`);\n }\n this.resources.set(id, PIXI.RenderTexture.create({ width, height }));\n }\n\n releaseResource(id: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(id);\n if (!texture) {\n throw new Error(`Resource \"${id}\" not found for release`);\n }\n texture.destroy(true);\n this.resources.delete(id);\n }\n\n compileShader(shaderId: string, _sourceGLSLOrWGSL: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n if (this.filters.has(shaderId)) return;\n\n let filter: PIXI.Filter;\n switch (shaderId) {\n case \"brightness\":\n filter = new AdjustmentFilter({ brightness: 1.0 });\n break;\n case \"contrast\":\n filter = new AdjustmentFilter({ contrast: 1.0 });\n break;\n case \"gaussian-blur-h\":\n case \"gaussian-blur-v\":\n filter = new PIXI.BlurFilter({ strength: 8, quality: 4 });\n break;\n case \"copy\":\n case \"blit-source\":\n filter = new AdjustmentFilter({ brightness: 1, contrast: 1, saturation: 1 });\n break;\n case \"color-adjustments\":\n // Per-pass instances are created in executePass; no shared cached filter.\n return;\n default:\n filter = new AdjustmentFilter({});\n }\n\n this.filters.set(shaderId, filter);\n }\n\n async submit(commandBuffer: CommandBuffer): Promise<void> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n for (const { pass } of commandBuffer.passes) {\n await this.executePass(pass);\n }\n }\n\n private async executePass(pass: RenderPass): Promise<void> {\n if (!this.app) return;\n\n const inputTexture = pass.inputs.length > 0 ? this.resources.get(pass.inputs[0]) : null;\n const outputTexture = this.resources.get(pass.output);\n if (!outputTexture) {\n throw new Error(`Output resource not found: ${pass.output}`);\n }\n\n if (pass.shaderId === \"copy\" || pass.shaderId === \"blit-source\") {\n if (inputTexture) {\n this.blitTexture(inputTexture, outputTexture as PIXI.RenderTexture);\n }\n return;\n }\n\n if (!inputTexture) return;\n\n const target = outputTexture as PIXI.RenderTexture;\n const sprite = new PIXI.Sprite(inputTexture);\n sprite.width = target.width;\n sprite.height = target.height;\n\n let filter: PIXI.Filter | PIXI.Filter[];\n let disposeFilter = false;\n\n if (pass.shaderId === \"color-adjustments\") {\n filter = createColorAdjustmentsFilter(normalizeColorAdjustmentsUniforms(pass.uniforms));\n disposeFilter = true;\n } else {\n if (!this.filters.has(pass.shaderId)) {\n this.compileShader(pass.shaderId, \"\");\n }\n const cachedFilter = this.filters.get(pass.shaderId);\n if (!cachedFilter) {\n throw new Error(`Filter not compiled for shader: ${pass.shaderId}`);\n }\n filter = cachedFilter;\n this.applyUniforms(cachedFilter, pass.uniforms, pass.shaderId);\n }\n\n const filterArray = Array.isArray(filter) ? filter : [filter];\n sprite.filters = filterArray;\n this.app.renderer.render({ container: sprite, target, clear: true });\n sprite.filters = null;\n\n if (disposeFilter) {\n if (Array.isArray(filter)) {\n filter.forEach((f) => f.destroy());\n } else {\n filter.destroy();\n }\n }\n }\n\n private applyUniforms(filter: PIXI.Filter, uniforms: Readonly<Record<string, unknown>>, shaderId?: string): void {\n if (shaderId === \"color-adjustments\") {\n updateColorAdjustmentsFilter(filter, normalizeColorAdjustmentsUniforms(uniforms));\n return;\n }\n if (filter instanceof AdjustmentFilter) {\n if (uniforms.brightness !== undefined) {\n filter.brightness = 1.0 + Number(uniforms.brightness);\n }\n if (uniforms.contrast !== undefined) {\n filter.contrast = 1.0 + Number(uniforms.contrast);\n }\n } else if (filter instanceof PIXI.BlurFilter && uniforms.uBlurStrength !== undefined) {\n filter.strength = Number(uniforms.uBlurStrength);\n }\n }\n\n private blitTexture(source: PIXI.Texture, target: PIXI.RenderTexture): void {\n if (!this.app) return;\n const sprite = new PIXI.Sprite(source);\n this.app.renderer.render({ container: sprite, target });\n }\n\n /** Upload a source image into track/source render textures (contain-fit). */\n uploadSourceImage(sourceImage: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, resourceIds: readonly string[]): void {\n if (!this.app) return;\n\n const sourceTexture = PIXI.Texture.from(sourceImage);\n for (const resourceId of resourceIds) {\n const texture = this.resources.get(resourceId);\n if (!texture) continue;\n\n const blitSprite = new PIXI.Sprite(sourceTexture);\n const fitScale = Math.min(texture.width / sourceTexture.width, texture.height / sourceTexture.height);\n blitSprite.scale.set(fitScale);\n blitSprite.position.set((texture.width - sourceTexture.width * fitScale) / 2, (texture.height - sourceTexture.height * fitScale) / 2);\n this.app.renderer.render({ container: blitSprite, target: texture as PIXI.RenderTexture });\n }\n }\n\n /** Present a resource texture to the canvas screen. */\n present(resourceId: string): void {\n if (!this.app) return;\n const texture = this.resources.get(resourceId);\n if (!texture) return;\n\n const screenW = this.app.renderer.screen.width;\n const screenH = this.app.renderer.screen.height;\n const scale = Math.min(screenW / texture.width, screenH / texture.height);\n const sprite = new PIXI.Sprite(texture);\n sprite.scale.set(scale);\n sprite.position.set((screenW - texture.width * scale) / 2, (screenH - texture.height * scale) / 2);\n\n this.app.stage.removeChildren();\n this.app.stage.addChild(sprite);\n this.app.renderer.render(this.app.stage);\n }\n\n getResource(id: string): PIXI.Texture | undefined {\n return this.resources.get(id);\n }\n\n async readPixels(resourceId: string): Promise<Uint8Array> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(resourceId);\n if (!texture) {\n throw new Error(`Resource \"${resourceId}\" not found for readPixels`);\n }\n const pixels = this.app.renderer.extract.pixels(texture);\n return new Uint8Array(pixels.pixels);\n }\n\n clearResources(): void {\n for (const id of [...this.resources.keys()]) {\n this.releaseResource(id);\n }\n }\n\n destroy(): void {\n if (!this.initialized) return;\n\n for (const texture of this.resources.values()) {\n texture.destroy(true);\n }\n this.resources.clear();\n\n for (const filter of this.filters.values()) {\n filter.destroy();\n }\n this.filters.clear();\n\n if (this.app) {\n this.app.destroy(true);\n this.app = null;\n }\n\n this.initialized = false;\n this.canvasElement = undefined;\n }\n}\n","import { Filter } from 'pixi.js'\nimport type { PixiEffectDefinition, ParamValues } from '../../videoEffects/EffectDefinition'\n\n/** Pixi v8 default filter vertex — required for correct render-to-texture in MPG. */\nconst ADJUSTMENTS_VERTEX_SHADER = `\n in vec2 aPosition;\n out vec2 vTextureCoord;\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n return vec4(position, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n }\n`;\n\nconst ADJUSTMENTS_FRAGMENT_SHADER = `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n // ── Existing uniforms ─────────────────────────────────────────────────────\n uniform float uExposure; // -1.0 to 1.0\n uniform float uBrightness; // -1.0 to 1.0\n uniform float uContrast; // -1.0 to 1.0\n uniform float uSaturation; // -1.0 to 1.0\n uniform vec3 uTemperatureColor; // warm or cool color\n uniform float uTemperatureWeight; // 0.0 to 1.0\n uniform vec3 uTintColor; // magenta or green color\n uniform float uTintWeight; // 0.0 to 1.0\n uniform float uSepia; // 0.0 to 1.0\n uniform float uGrayscale; // 0.0 to 1.0\n uniform float uHueRotate; // radians\n uniform float uVignette; // 0.0 to 1.0\n uniform float uInvert; // 0.0 to 1.0\n\n // ── NEW: Lift ─────────────────────────────────────────────────────────────\n uniform float uLift; // -0.2 to 0.2; positive = faded/matte, negative = crushed\n\n // ── NEW: Split-toning ─────────────────────────────────────────────────────\n uniform vec3 uShadowTint; // multiplicative color for shadows (neutral = vec3(1))\n uniform float uShadowTintStrength;\n uniform vec3 uHighlightTint; // multiplicative color for highlights (neutral = vec3(1))\n uniform float uHighlightTintStrength;\n uniform float uSplitBalance; // 0.0-1.0, luma split point\n\n // ── NEW: Film grain ───────────────────────────────────────────────────────\n uniform float uGrainIntensity; // 0.0 to 0.5\n uniform float uGrainSize; // 0.1 to 5.0\n uniform float uTime; // animated, incremented each frame\n\n // ── NEW: Channel-mix B&W ──────────────────────────────────────────────────\n uniform vec3 uChannelMix; // R/G/B weights summing to ~1.0\n uniform float uUseChannelMix; // 1.0 = active, 0.0 = off\n\n // ── NEW: Duotone ──────────────────────────────────────────────────────────\n uniform vec3 uDuotoneDark; // color mapped to black/dark tones\n uniform vec3 uDuotoneLight; // color mapped to white/light tones\n uniform float uUseDuotone; // 1.0 = active, 0.0 = off\n\n // ── NEW: Vibrance ─────────────────────────────────────────────────────────\n uniform float uVibranceAmount; // -1.0 to 1.0\n uniform vec3 uVibranceProtectedHue; // reference color for skin-tone protection\n\n // ── NEW: Cross-process ────────────────────────────────────────────────────\n uniform float uCrossProcessAmount; // 0.0 to 1.0\n\n // ── Helper functions ──────────────────────────────────────────────────────\n vec3 hueRotateColor(vec3 color, float angle) {\n vec3 k = vec3(0.57735, 0.57735, 0.57735);\n float c = cos(angle);\n return color * c + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - c);\n }\n\n vec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n void main() {\n vec4 texColor = texture(uTexture, vTextureCoord);\n vec3 rgb = texColor.rgb;\n\n // Invert\n rgb = mix(rgb, 1.0 - rgb, uInvert);\n\n // Exposure\n rgb = rgb * pow(2.0, uExposure);\n\n // Brightness\n rgb = rgb + uBrightness;\n\n // Lift — shift black point; applied before contrast so it interacts correctly with tonal range\n if (uLift != 0.0) {\n rgb = rgb + uLift * (1.0 - rgb);\n }\n\n // Contrast\n rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;\n\n // Saturation (flat, distinct from vibrance)\n float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);\n\n // Grayscale\n float lumaG = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(rgb, vec3(lumaG), uGrayscale);\n\n // Sepia\n if (uSepia > 0.0) {\n vec3 sep = vec3(\n dot(rgb, vec3(0.393, 0.769, 0.189)),\n dot(rgb, vec3(0.349, 0.686, 0.168)),\n dot(rgb, vec3(0.272, 0.534, 0.131))\n );\n rgb = mix(rgb, sep, uSepia);\n }\n\n // Hue Rotate\n if (uHueRotate != 0.0) {\n rgb = hueRotateColor(rgb, uHueRotate);\n }\n\n // Temperature — soft-light blend\n if (uTemperatureWeight > 0.0) {\n vec3 t = uTemperatureColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);\n }\n\n // Tint — soft-light blend\n if (uTintWeight > 0.0) {\n vec3 t = uTintColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);\n }\n\n // ── NEW: Channel-mixed B&W ─────────────────────────────────────────────\n // Applied before duotone; mutually exclusive (both produce mono, duotone adds color back)\n if (uUseChannelMix > 0.5) {\n float mono = dot(rgb, uChannelMix);\n rgb = vec3(mono);\n }\n\n // ── NEW: Duotone ───────────────────────────────────────────────────────\n // Maps current luminance to a 2-color gradient; applied after channel-mix for correct mono base\n if (uUseDuotone > 0.5) {\n float duoLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n rgb = mix(uDuotoneDark, uDuotoneLight, duoLuma);\n }\n\n // ── NEW: Split-toning ──────────────────────────────────────────────────\n if (uShadowTintStrength > 0.0 || uHighlightTintStrength > 0.0) {\n float splitLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n float shadowW = 1.0 - smoothstep(0.0, uSplitBalance, splitLuma);\n float highlightW = smoothstep(uSplitBalance, 1.0, splitLuma);\n rgb = mix(rgb, rgb * uShadowTint, shadowW * uShadowTintStrength);\n rgb = mix(rgb, rgb * uHighlightTint, highlightW * uHighlightTintStrength);\n }\n\n // ── NEW: Vibrance — hue-selective saturation ───────────────────────────\n // Skipped when channel-mix or duotone have flattened color information\n if (uVibranceAmount != 0.0 && uUseChannelMix < 0.5 && uUseDuotone < 0.5) {\n vec3 hsv = rgb2hsv(clamp(rgb, 0.0, 1.0));\n vec3 protHSV = rgb2hsv(uVibranceProtectedHue);\n float hueDist = abs(hsv.x - protHSV.x);\n hueDist = min(hueDist, 1.0 - hueDist); // wrap hue distance\n float protection = smoothstep(0.0, 0.15, hueDist);\n hsv.y = clamp(hsv.y + uVibranceAmount * protection, 0.0, 1.0);\n rgb = hsv2rgb(hsv);\n }\n\n // ── NEW: Cross-process — channel curve swap ────────────────────────────\n if (uCrossProcessAmount > 0.0) {\n float origR = rgb.r;\n float origB = rgb.b;\n rgb.r = mix(rgb.r, pow(max(origB, 0.001), 0.8), uCrossProcessAmount);\n rgb.b = mix(rgb.b, pow(max(origR, 0.001), 1.2), uCrossProcessAmount);\n }\n\n // ── NEW: Film grain — last before vignette ────────────────────────────\n if (uGrainIntensity > 0.0) {\n float grain = fract(sin(dot(vTextureCoord * uGrainSize + uTime, vec2(12.9898, 78.233))) * 43758.5453);\n rgb += (grain - 0.5) * uGrainIntensity;\n }\n\n // Vignette\n vec2 uv = vTextureCoord - 0.5;\n float vignetteVal = smoothstep(0.45, 1.0, length(uv));\n rgb = mix(rgb, vec3(0.0), vignetteVal * uVignette);\n\n finalColor = vec4(rgb, texColor.a);\n }\n`;\n\n/** Convert a hex color string (#RRGGBB) to a normalized [r, g, b] array. */\nexport function hexToRgb(hex: string): [number, number, number] {\n const clean = hex.replace('#', '').padEnd(6, '0')\n const r = parseInt(clean.substring(0, 2), 16) / 255\n const g = parseInt(clean.substring(2, 4), 16) / 255\n const b = parseInt(clean.substring(4, 6), 16) / 255\n return [isNaN(r) ? 1 : r, isNaN(g) ? 1 : g, isNaN(b) ? 1 : b]\n}\n\nexport const ColorAdjustmentsEffect: PixiEffectDefinition = {\n backend: 'pixi',\n subtype: 'filter',\n id: 'color-adjustments',\n name: 'Color Adjustments',\n category: 'light',\n description: 'Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, vignette, lift, split-toning, grain, channel-mix, duotone, vibrance, and cross-process.',\n tags: ['color', 'adjustments', 'brightness', 'contrast', 'saturation', 'temperature', 'tint', 'vignette', 'grain', 'duotone', 'vibrance'],\n thumbnail: '',\n params: [\n // ── Existing ───────────────────────────────────────────────────────────\n { key: 'exposure', label: 'Exposure', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'brightness', label: 'Brightness', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'contrast', label: 'Contrast', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'saturation', label: 'Saturation', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'temperature', label: 'Temperature', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'tint', label: 'Tint', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'sepia', label: 'Sepia', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grayscale', label: 'Grayscale', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'hueRotate', label: 'Hue Rotate', type: 'range', value: 0.0, min: 0.0, max: 6.28318, step: 0.01 },\n { key: 'vignette', label: 'Vignette', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'invert', label: 'Invert', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n // ── NEW ────────────────────────────────────────────────────────────────\n { key: 'lift', label: 'Lift', type: 'range', value: 0.0, min: -0.5, max: 0.5, step: 0.01 },\n { key: 'shadowTintR', label: 'Shadow Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintG', label: 'Shadow Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintB', label: 'Shadow Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintStrength', label: 'Shadow Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'highlightTintR', label: 'Hi Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintG', label: 'Hi Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintB', label: 'Hi Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintStrength', label: 'Hi Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'splitBalance', label: 'Split Balance', type: 'range', value: 0.5, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grainIntensity', label: 'Grain Intensity', type: 'range', value: 0.0, min: 0.0, max: 0.5, step: 0.01 },\n { key: 'grainSize', label: 'Grain Size', type: 'range', value: 1.0, min: 0.1, max: 5.0, step: 0.1 },\n { key: 'channelMixR', label: 'Channel Mix R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixG', label: 'Channel Mix G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixB', label: 'Channel Mix B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useChannelMix', label: 'Use Channel Mix', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'duotoneDarkR', label: 'Duo Dark R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkG', label: 'Duo Dark G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkB', label: 'Duo Dark B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightR', label: 'Duo Light R', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightG', label: 'Duo Light G', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightB', label: 'Duo Light B', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useDuotone', label: 'Use Duotone', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'vibranceAmount', label: 'Vibrance', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueR', label: 'Vib Protect R', type: 'range', value: 0.91, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueG', label: 'Vib Protect G', type: 'range', value: 0.69, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueB', label: 'Vib Protect B', type: 'range', value: 0.55, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'crossProcessAmount', label: 'Cross Process', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n ],\n filterSpec: {\n create(params: ParamValues): Filter {\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n return Filter.from({\n gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },\n clipToViewport: false,\n resources: {\n adjustmentsUniforms: {\n // ── Existing ──────────────────────────────────────────────────\n uExposure: { value: params.exposure as number || 0.0, type: 'f32' },\n uBrightness: { value: params.brightness as number || 0.0, type: 'f32' },\n uContrast: { value: params.contrast as number || 0.0, type: 'f32' },\n uSaturation: { value: params.saturation as number || 0.0, type: 'f32' },\n uTemperatureColor: { value: tempColor, type: 'vec3<f32>' },\n uTemperatureWeight: { value: tempWeight, type: 'f32' },\n uTintColor: { value: tintColor, type: 'vec3<f32>' },\n uTintWeight: { value: tintWeight, type: 'f32' },\n uSepia: { value: params.sepia as number || 0.0, type: 'f32' },\n uGrayscale: { value: params.grayscale as number || 0.0, type: 'f32' },\n uHueRotate: { value: params.hueRotate as number || 0.0, type: 'f32' },\n uVignette: { value: params.vignette as number || 0.0, type: 'f32' },\n uInvert: { value: params.invert as number || 0.0, type: 'f32' },\n // ── NEW ───────────────────────────────────────────────────────\n uLift: { value: params.lift as number || 0.0, type: 'f32' },\n uShadowTint: { value: [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0], type: 'vec3<f32>' },\n uShadowTintStrength: { value: params.shadowTintStrength as number || 0.0, type: 'f32' },\n uHighlightTint: { value: [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0], type: 'vec3<f32>' },\n uHighlightTintStrength: { value: params.highlightTintStrength as number|| 0.0, type: 'f32' },\n uSplitBalance: { value: params.splitBalance as number ?? 0.5, type: 'f32' },\n uGrainIntensity: { value: params.grainIntensity as number || 0.0, type: 'f32' },\n uGrainSize: { value: params.grainSize as number ?? 1.0, type: 'f32' },\n uTime: { value: 0.0, type: 'f32' },\n uChannelMix: { value: [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0], type: 'vec3<f32>' },\n uUseChannelMix: { value: params.useChannelMix as number || 0.0, type: 'f32' },\n uDuotoneDark: { value: [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0], type: 'vec3<f32>' },\n uDuotoneLight: { value: [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0], type: 'vec3<f32>' },\n uUseDuotone: { value: params.useDuotone as number || 0.0, type: 'f32' },\n uVibranceAmount: { value: params.vibranceAmount as number || 0.0, type: 'f32' },\n uVibranceProtectedHue: { value: [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55], type: 'vec3<f32>' },\n uCrossProcessAmount: { value: params.crossProcessAmount as number || 0.0, type: 'f32' },\n }\n }\n })\n },\n\n updateUniforms(filter: Filter, params: ParamValues): void {\n type UniformGroup = { uniforms?: Record<string, unknown>; update?: () => void }\n const group = (filter as Filter & { resources?: { adjustmentsUniforms?: UniformGroup } }).resources?.adjustmentsUniforms\n const uniforms = group?.uniforms\n if (!uniforms) return\n\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n // ── Existing ────────────────────────────────────────────────────────\n uniforms.uExposure = params.exposure as number || 0.0\n uniforms.uBrightness = params.brightness as number || 0.0\n uniforms.uContrast = params.contrast as number || 0.0\n uniforms.uSaturation = params.saturation as number || 0.0\n uniforms.uTemperatureColor = tempColor\n uniforms.uTemperatureWeight = tempWeight\n uniforms.uTintColor = tintColor\n uniforms.uTintWeight = tintWeight\n uniforms.uSepia = params.sepia as number || 0.0\n uniforms.uGrayscale = params.grayscale as number || 0.0\n uniforms.uHueRotate = params.hueRotate as number || 0.0\n uniforms.uVignette = params.vignette as number || 0.0\n uniforms.uInvert = params.invert as number || 0.0\n // ── NEW ──────────────────────────────────────────────────────────\n uniforms.uLift = params.lift as number || 0.0\n uniforms.uShadowTint = [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0]\n uniforms.uShadowTintStrength = params.shadowTintStrength as number || 0.0\n uniforms.uHighlightTint = [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0]\n uniforms.uHighlightTintStrength = params.highlightTintStrength as number || 0.0\n uniforms.uSplitBalance = params.splitBalance as number ?? 0.5\n uniforms.uGrainIntensity = params.grainIntensity as number || 0.0\n uniforms.uGrainSize = params.grainSize as number ?? 1.0\n uniforms.uTime = ((uniforms.uTime as number || 0.0) + 0.016) % 100.0\n uniforms.uChannelMix = [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0]\n uniforms.uUseChannelMix = params.useChannelMix as number || 0.0\n uniforms.uDuotoneDark = [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0]\n uniforms.uDuotoneLight = [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0]\n uniforms.uUseDuotone = params.useDuotone as number || 0.0\n uniforms.uVibranceAmount = params.vibranceAmount as number || 0.0\n uniforms.uVibranceProtectedHue = [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55]\n uniforms.uCrossProcessAmount = params.crossProcessAmount as number || 0.0\n group?.update?.()\n }\n }\n}\n","/**\n * V2 MPG — shared Color Adjustments filter factory (used by PixiRenderBackend).\n */\n\nimport type { Filter } from \"pixi.js\";\nimport type { ParamValues } from \"../../videoEffects/EffectDefinition.js\";\nimport { ColorAdjustmentsEffect } from \"../../effects/light/ColorAdjustmentsEffect.js\";\n\nconst spec = ColorAdjustmentsEffect.filterSpec!;\n\nexport function createColorAdjustmentsFilter(params: Record<string, unknown> = {}): Filter | Filter[] {\n return spec.create(params as ParamValues);\n}\n\nexport function updateColorAdjustmentsFilter(filter: Filter, params: Record<string, unknown>): void {\n spec.updateUniforms(filter, params as ParamValues, 0);\n}\n\n/** Normalize partial uniforms into full ColorAdjustments param set */\nexport function normalizeColorAdjustmentsUniforms(uniforms: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return {\n // ── Existing ────────────────────────────────────────────────────────────\n exposure: uniforms.exposure ?? 0,\n brightness: uniforms.brightness ?? 0,\n contrast: uniforms.contrast ?? 0,\n saturation: uniforms.saturation ?? 0,\n temperature: uniforms.temperature ?? 0,\n tint: uniforms.tint ?? 0,\n sepia: uniforms.sepia ?? 0,\n grayscale: uniforms.grayscale ?? 0,\n hueRotate: uniforms.hueRotate ?? 0,\n vignette: uniforms.vignette ?? 0,\n invert: uniforms.invert ?? 0,\n // ── NEW: Lift ────────────────────────────────────────────────────────────\n lift: uniforms.lift ?? 0,\n // ── NEW: Split-toning ────────────────────────────────────────────────────\n shadowTintR: uniforms.shadowTintR ?? 1.0,\n shadowTintG: uniforms.shadowTintG ?? 1.0,\n shadowTintB: uniforms.shadowTintB ?? 1.0,\n shadowTintStrength: uniforms.shadowTintStrength ?? 0,\n highlightTintR: uniforms.highlightTintR ?? 1.0,\n highlightTintG: uniforms.highlightTintG ?? 1.0,\n highlightTintB: uniforms.highlightTintB ?? 1.0,\n highlightTintStrength: uniforms.highlightTintStrength ?? 0,\n splitBalance: uniforms.splitBalance ?? 0.5,\n // ── NEW: Film grain ──────────────────────────────────────────────────────\n grainIntensity: uniforms.grainIntensity ?? 0,\n grainSize: uniforms.grainSize ?? 1.0,\n // ── NEW: Channel-mix B&W ─────────────────────────────────────────────────\n channelMixR: uniforms.channelMixR ?? 0,\n channelMixG: uniforms.channelMixG ?? 0,\n channelMixB: uniforms.channelMixB ?? 0,\n useChannelMix: uniforms.useChannelMix ?? 0,\n // ── NEW: Duotone ─────────────────────────────────────────────────────────\n duotoneDarkR: uniforms.duotoneDarkR ?? 0,\n duotoneDarkG: uniforms.duotoneDarkG ?? 0,\n duotoneDarkB: uniforms.duotoneDarkB ?? 0,\n duotoneLightR: uniforms.duotoneLightR ?? 1.0,\n duotoneLightG: uniforms.duotoneLightG ?? 1.0,\n duotoneLightB: uniforms.duotoneLightB ?? 1.0,\n useDuotone: uniforms.useDuotone ?? 0,\n // ── NEW: Vibrance ────────────────────────────────────────────────────────\n vibranceAmount: uniforms.vibranceAmount ?? 0,\n vibranceProtectedHueR: uniforms.vibranceProtectedHueR ?? 0.91,\n vibranceProtectedHueG: uniforms.vibranceProtectedHueG ?? 0.69,\n vibranceProtectedHueB: uniforms.vibranceProtectedHueB ?? 0.55,\n // ── NEW: Cross-process ───────────────────────────────────────────────────\n crossProcessAmount: uniforms.crossProcessAmount ?? 0,\n };\n}\n\n"],"mappings":";AAUA,YAAY,UAAU;AACtB,SAAS,wBAAwB;;;ACXjC,SAAS,cAAc;AAIvB,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BlC,IAAM,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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2181,24 @@ function isCompositeEffect(e) {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
|
|
2183
2183
|
// src/videoEffects/PixiRenderer.ts
|
|
2184
|
-
import {
|
|
2185
|
-
Application,
|
|
2186
|
-
Container,
|
|
2187
|
-
Sprite
|
|
2188
|
-
} from "pixi.js";
|
|
2184
|
+
import { Application, Container, Sprite, Texture, Filter, RenderTexture } from "pixi.js";
|
|
2189
2185
|
var PixiRenderer = class {
|
|
2190
2186
|
app = null;
|
|
2191
2187
|
videoSprite = null;
|
|
2188
|
+
transitionSprite = null;
|
|
2189
|
+
_activeTransition = null;
|
|
2190
|
+
fromRenderTexture = null;
|
|
2191
|
+
toRenderTexture = null;
|
|
2192
|
+
blitSprite = null;
|
|
2193
|
+
_transitionFromTex = null;
|
|
2194
|
+
_transitionToTex = null;
|
|
2192
2195
|
overlayContainer = null;
|
|
2196
|
+
baseMediaContainer = null;
|
|
2193
2197
|
mounted = /* @__PURE__ */ new Map();
|
|
2194
2198
|
initialized = false;
|
|
2199
|
+
initializing = false;
|
|
2200
|
+
_activeSource = null;
|
|
2201
|
+
_fitMode = "fit";
|
|
2195
2202
|
/**
|
|
2196
2203
|
* Initialize the PixiJS Application.
|
|
2197
2204
|
* Call once, reuse across effect changes.
|
|
@@ -2201,47 +2208,77 @@ var PixiRenderer = class {
|
|
|
2201
2208
|
* @param height Canvas height in pixels
|
|
2202
2209
|
*/
|
|
2203
2210
|
async init(canvas, width, height) {
|
|
2204
|
-
if (this.initialized) return;
|
|
2205
|
-
this.
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
antialias: true,
|
|
2213
|
-
preference: "webgl",
|
|
2214
|
-
// WebGL for production stability; swap to 'webgpu' later
|
|
2215
|
-
resolution: typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1,
|
|
2216
|
-
autoDensity: true,
|
|
2217
|
-
preserveDrawingBuffer: true
|
|
2211
|
+
if (this.initialized || this.initializing) return;
|
|
2212
|
+
this.initializing = true;
|
|
2213
|
+
canvas.addEventListener("webglcontextlost", (event) => {
|
|
2214
|
+
event.preventDefault();
|
|
2215
|
+
console.warn("[PixiRenderer] WebGL context lost \u2014 attempting recovery");
|
|
2216
|
+
});
|
|
2217
|
+
canvas.addEventListener("webglcontextrestored", () => {
|
|
2218
|
+
console.log("[PixiRenderer] WebGL context restored");
|
|
2218
2219
|
});
|
|
2220
|
+
const app = new Application();
|
|
2221
|
+
try {
|
|
2222
|
+
await app.init({
|
|
2223
|
+
canvas,
|
|
2224
|
+
width,
|
|
2225
|
+
height,
|
|
2226
|
+
backgroundAlpha: 0,
|
|
2227
|
+
// transparent — composited over video below
|
|
2228
|
+
antialias: true,
|
|
2229
|
+
preference: "webgl",
|
|
2230
|
+
// WebGL for production stability; swap to 'webgpu' later
|
|
2231
|
+
resolution: typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1,
|
|
2232
|
+
autoDensity: true,
|
|
2233
|
+
preserveDrawingBuffer: true
|
|
2234
|
+
});
|
|
2235
|
+
} catch (e) {
|
|
2236
|
+
this.initializing = false;
|
|
2237
|
+
throw e;
|
|
2238
|
+
}
|
|
2239
|
+
if (!this.initializing) {
|
|
2240
|
+
app.destroy(true);
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
this.app = app;
|
|
2219
2244
|
this.videoSprite = new Sprite();
|
|
2220
2245
|
this.videoSprite.width = width;
|
|
2221
2246
|
this.videoSprite.height = height;
|
|
2247
|
+
this.transitionSprite = new Sprite();
|
|
2248
|
+
this.transitionSprite.width = width;
|
|
2249
|
+
this.transitionSprite.height = height;
|
|
2250
|
+
this.transitionSprite.visible = false;
|
|
2222
2251
|
this.overlayContainer = new Container();
|
|
2252
|
+
this.baseMediaContainer = new Container();
|
|
2253
|
+
this.baseMediaContainer.sortableChildren = true;
|
|
2254
|
+
this.app.stage.addChildAt(this.baseMediaContainer, 0);
|
|
2223
2255
|
this.app.stage.addChild(this.videoSprite);
|
|
2256
|
+
this.app.stage.addChild(this.transitionSprite);
|
|
2224
2257
|
this.app.stage.addChild(this.overlayContainer);
|
|
2225
2258
|
this.initialized = true;
|
|
2259
|
+
this.initializing = false;
|
|
2226
2260
|
}
|
|
2227
|
-
/**
|
|
2228
|
-
* Point the video sprite at a live HTMLVideoElement.
|
|
2229
|
-
* PixiJS polls the video element each frame automatically.
|
|
2230
|
-
*/
|
|
2231
2261
|
setVideoSource(video) {
|
|
2262
|
+
if (this._activeSource === video) {
|
|
2263
|
+
this.resizeSprites();
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
this._activeSource = video;
|
|
2232
2267
|
if (!this.videoSprite || !this.app) return;
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
this.videoSprite.texture = texture;
|
|
2237
|
-
});
|
|
2268
|
+
const texture = Texture.from(video);
|
|
2269
|
+
this.videoSprite.texture = texture;
|
|
2270
|
+
this.resizeSprites();
|
|
2238
2271
|
}
|
|
2239
2272
|
setImageSource(image) {
|
|
2273
|
+
if (this._activeSource === image) {
|
|
2274
|
+
this.resizeSprites();
|
|
2275
|
+
return;
|
|
2276
|
+
}
|
|
2277
|
+
this._activeSource = image;
|
|
2240
2278
|
if (!this.videoSprite || !this.app) return;
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
});
|
|
2279
|
+
const texture = Texture.from(image);
|
|
2280
|
+
this.videoSprite.texture = texture;
|
|
2281
|
+
this.resizeSprites();
|
|
2245
2282
|
}
|
|
2246
2283
|
// -------------------------------------------------------------------------
|
|
2247
2284
|
// Effect lifecycle
|
|
@@ -2272,11 +2309,7 @@ var PixiRenderer = class {
|
|
|
2272
2309
|
Object.assign(m.params, params);
|
|
2273
2310
|
Object.assign(m.ctx.params, params);
|
|
2274
2311
|
if (m.filters && m.definition.filterSpec?.updateUniforms) {
|
|
2275
|
-
m.definition.filterSpec.updateUniforms(
|
|
2276
|
-
m.filters.length === 1 ? m.filters[0] : m.filters,
|
|
2277
|
-
m.params,
|
|
2278
|
-
0
|
|
2279
|
-
);
|
|
2312
|
+
m.definition.filterSpec.updateUniforms(m.filters.length === 1 ? m.filters[0] : m.filters, m.params, 0);
|
|
2280
2313
|
}
|
|
2281
2314
|
if (m.filters) filterChain.push(...m.filters);
|
|
2282
2315
|
continue;
|
|
@@ -2301,11 +2334,7 @@ var PixiRenderer = class {
|
|
|
2301
2334
|
tickerFn = (ticker) => {
|
|
2302
2335
|
elapsed.value += ticker.deltaMS;
|
|
2303
2336
|
if (filters) {
|
|
2304
|
-
spec.updateUniforms(
|
|
2305
|
-
filters.length === 1 ? filters[0] : filters,
|
|
2306
|
-
params,
|
|
2307
|
-
elapsed.value
|
|
2308
|
-
);
|
|
2337
|
+
spec.updateUniforms(filters.length === 1 ? filters[0] : filters, params, elapsed.value);
|
|
2309
2338
|
}
|
|
2310
2339
|
};
|
|
2311
2340
|
this.app.ticker.add(tickerFn);
|
|
@@ -2327,11 +2356,7 @@ var PixiRenderer = class {
|
|
|
2327
2356
|
Object.assign(m.params, params);
|
|
2328
2357
|
Object.assign(m.ctx.params, params);
|
|
2329
2358
|
if (m.filters && m.definition.filterSpec?.updateUniforms) {
|
|
2330
|
-
m.definition.filterSpec.updateUniforms(
|
|
2331
|
-
m.filters.length === 1 ? m.filters[0] : m.filters,
|
|
2332
|
-
m.params,
|
|
2333
|
-
0
|
|
2334
|
-
);
|
|
2359
|
+
m.definition.filterSpec.updateUniforms(m.filters.length === 1 ? m.filters[0] : m.filters, m.params, 0);
|
|
2335
2360
|
}
|
|
2336
2361
|
}
|
|
2337
2362
|
/**
|
|
@@ -2351,11 +2376,7 @@ var PixiRenderer = class {
|
|
|
2351
2376
|
m.params[key] = value;
|
|
2352
2377
|
m.ctx.params[key] = value;
|
|
2353
2378
|
if (m.filters && m.definition.filterSpec?.updateUniforms) {
|
|
2354
|
-
m.definition.filterSpec.updateUniforms(
|
|
2355
|
-
m.filters.length === 1 ? m.filters[0] : m.filters,
|
|
2356
|
-
m.params,
|
|
2357
|
-
0
|
|
2358
|
-
);
|
|
2379
|
+
m.definition.filterSpec.updateUniforms(m.filters.length === 1 ? m.filters[0] : m.filters, m.params, 0);
|
|
2359
2380
|
}
|
|
2360
2381
|
m.definition.onParamChange?.(m.ctx, key, value);
|
|
2361
2382
|
}
|
|
@@ -2376,9 +2397,78 @@ var PixiRenderer = class {
|
|
|
2376
2397
|
resize(width, height) {
|
|
2377
2398
|
if (!this.app) return;
|
|
2378
2399
|
this.app.renderer.resize(width, height);
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2400
|
+
this.resizeSprites();
|
|
2401
|
+
}
|
|
2402
|
+
setFitMode(mode) {
|
|
2403
|
+
if (this._fitMode === mode) return;
|
|
2404
|
+
this._fitMode = mode;
|
|
2405
|
+
this.resizeSprites();
|
|
2406
|
+
}
|
|
2407
|
+
resizeSprites() {
|
|
2408
|
+
if (this.videoSprite && this.videoSprite.texture) {
|
|
2409
|
+
this._resizeSprite(this.videoSprite, this.videoSprite.texture, this._fitMode);
|
|
2410
|
+
}
|
|
2411
|
+
if (this.transitionSprite) {
|
|
2412
|
+
if (this._activeTransition) {
|
|
2413
|
+
this.transitionSprite.width = this.app?.screen.width ?? 1280;
|
|
2414
|
+
this.transitionSprite.height = this.app?.screen.height ?? 720;
|
|
2415
|
+
this.transitionSprite.position.set(0, 0);
|
|
2416
|
+
} else if (this.transitionSprite.texture) {
|
|
2417
|
+
this._resizeSprite(this.transitionSprite, this.transitionSprite.texture, this._fitMode);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
_getElementDimensions(texture) {
|
|
2422
|
+
const sourceEl = this._activeSource;
|
|
2423
|
+
if (sourceEl) {
|
|
2424
|
+
const tagName = sourceEl.tagName;
|
|
2425
|
+
if ((tagName === "VIDEO" || sourceEl.videoWidth !== void 0) && sourceEl.videoWidth > 0) {
|
|
2426
|
+
return { width: sourceEl.videoWidth, height: sourceEl.videoHeight };
|
|
2427
|
+
}
|
|
2428
|
+
if ((tagName === "IMG" || sourceEl.naturalWidth !== void 0) && sourceEl.naturalWidth > 0) {
|
|
2429
|
+
return { width: sourceEl.naturalWidth, height: sourceEl.naturalHeight };
|
|
2430
|
+
}
|
|
2431
|
+
if ((tagName === "CANVAS" || sourceEl.getContext !== void 0) && sourceEl.width > 0) {
|
|
2432
|
+
return { width: sourceEl.width, height: sourceEl.height };
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
const resource = texture.source?.resource || texture.source?.source;
|
|
2436
|
+
if (resource) {
|
|
2437
|
+
const tagName = resource.tagName;
|
|
2438
|
+
if ((tagName === "VIDEO" || resource.videoWidth !== void 0) && resource.videoWidth > 0) {
|
|
2439
|
+
return { width: resource.videoWidth, height: resource.videoHeight };
|
|
2440
|
+
}
|
|
2441
|
+
if ((tagName === "IMG" || resource.naturalWidth !== void 0) && resource.naturalWidth > 0) {
|
|
2442
|
+
return { width: resource.naturalWidth, height: resource.naturalHeight };
|
|
2443
|
+
}
|
|
2444
|
+
if ((tagName === "CANVAS" || resource.getContext !== void 0) && resource.width > 0) {
|
|
2445
|
+
return { width: resource.width, height: resource.height };
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
if (texture.width > 0) {
|
|
2449
|
+
return { width: texture.width, height: texture.height };
|
|
2450
|
+
}
|
|
2451
|
+
return { width: 1280, height: 720 };
|
|
2452
|
+
}
|
|
2453
|
+
_resizeSprite(sprite, texture, fitMode) {
|
|
2454
|
+
if (!this.app) return;
|
|
2455
|
+
const canvasWidth = this.app.screen.width;
|
|
2456
|
+
const canvasHeight = this.app.screen.height;
|
|
2457
|
+
const { width: texWidth, height: texHeight } = this._getElementDimensions(texture);
|
|
2458
|
+
if (fitMode === "stretch") {
|
|
2459
|
+
sprite.width = canvasWidth;
|
|
2460
|
+
sprite.height = canvasHeight;
|
|
2461
|
+
sprite.position.set(0, 0);
|
|
2462
|
+
} else {
|
|
2463
|
+
const scaleX = canvasWidth / texWidth;
|
|
2464
|
+
const scaleY = canvasHeight / texHeight;
|
|
2465
|
+
const scale = fitMode === "fit" ? Math.min(scaleX, scaleY) : Math.max(scaleX, scaleY);
|
|
2466
|
+
sprite.width = texWidth * scale;
|
|
2467
|
+
sprite.height = texHeight * scale;
|
|
2468
|
+
sprite.position.set(
|
|
2469
|
+
(canvasWidth - sprite.width) / 2,
|
|
2470
|
+
(canvasHeight - sprite.height) / 2
|
|
2471
|
+
);
|
|
2382
2472
|
}
|
|
2383
2473
|
}
|
|
2384
2474
|
/**
|
|
@@ -2386,15 +2476,40 @@ var PixiRenderer = class {
|
|
|
2386
2476
|
* Call when the editor session ends or the Studio workspace unmounts.
|
|
2387
2477
|
*/
|
|
2388
2478
|
destroy() {
|
|
2479
|
+
this.initializing = false;
|
|
2389
2480
|
for (const mounted of this.mounted.values()) {
|
|
2390
2481
|
this._unmount(mounted);
|
|
2391
2482
|
}
|
|
2392
2483
|
this.mounted.clear();
|
|
2393
|
-
this.app
|
|
2394
|
-
|
|
2484
|
+
if (this.app) {
|
|
2485
|
+
try {
|
|
2486
|
+
const gl = this.app.renderer.gl;
|
|
2487
|
+
this.app.destroy(true, { children: true, texture: true });
|
|
2488
|
+
gl?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
2489
|
+
} catch (e) {
|
|
2490
|
+
console.warn("Error destroying Pixi application:", e);
|
|
2491
|
+
}
|
|
2492
|
+
this.app = null;
|
|
2493
|
+
}
|
|
2395
2494
|
this.videoSprite = null;
|
|
2495
|
+
this.transitionSprite = null;
|
|
2396
2496
|
this.overlayContainer = null;
|
|
2497
|
+
this.baseMediaContainer = null;
|
|
2397
2498
|
this.initialized = false;
|
|
2499
|
+
this._activeTransition = null;
|
|
2500
|
+
this._activeSource = null;
|
|
2501
|
+
if (this.fromRenderTexture) {
|
|
2502
|
+
this.fromRenderTexture.destroy(true);
|
|
2503
|
+
this.fromRenderTexture = null;
|
|
2504
|
+
}
|
|
2505
|
+
if (this.toRenderTexture) {
|
|
2506
|
+
this.toRenderTexture.destroy(true);
|
|
2507
|
+
this.toRenderTexture = null;
|
|
2508
|
+
}
|
|
2509
|
+
if (this.blitSprite) {
|
|
2510
|
+
this.blitSprite.destroy();
|
|
2511
|
+
this.blitSprite = null;
|
|
2512
|
+
}
|
|
2398
2513
|
}
|
|
2399
2514
|
// -------------------------------------------------------------------------
|
|
2400
2515
|
// Private helpers
|
|
@@ -2419,9 +2534,125 @@ var PixiRenderer = class {
|
|
|
2419
2534
|
getVideoSprite() {
|
|
2420
2535
|
return this.videoSprite;
|
|
2421
2536
|
}
|
|
2537
|
+
getTransitionSprite() {
|
|
2538
|
+
return this.transitionSprite;
|
|
2539
|
+
}
|
|
2540
|
+
getBaseMediaContainer() {
|
|
2541
|
+
return this.baseMediaContainer;
|
|
2542
|
+
}
|
|
2543
|
+
getOverlayContainer() {
|
|
2544
|
+
return this.overlayContainer;
|
|
2545
|
+
}
|
|
2422
2546
|
get isReady() {
|
|
2423
2547
|
return this.initialized;
|
|
2424
2548
|
}
|
|
2549
|
+
_ensureRenderTextures(width, height) {
|
|
2550
|
+
if (!this.fromRenderTexture || this.fromRenderTexture.width !== width || this.fromRenderTexture.height !== height) {
|
|
2551
|
+
if (this.fromRenderTexture) this.fromRenderTexture.destroy(true);
|
|
2552
|
+
this.fromRenderTexture = RenderTexture.create({ width, height });
|
|
2553
|
+
}
|
|
2554
|
+
if (!this.toRenderTexture || this.toRenderTexture.width !== width || this.toRenderTexture.height !== height) {
|
|
2555
|
+
if (this.toRenderTexture) this.toRenderTexture.destroy(true);
|
|
2556
|
+
this.toRenderTexture = RenderTexture.create({ width, height });
|
|
2557
|
+
}
|
|
2558
|
+
if (!this.blitSprite) {
|
|
2559
|
+
this.blitSprite = new Sprite();
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
_blitTransitionFrames() {
|
|
2563
|
+
if (!this.app || !this._transitionFromTex || !this._transitionToTex || !this.fromRenderTexture || !this.toRenderTexture || !this.blitSprite) {
|
|
2564
|
+
return;
|
|
2565
|
+
}
|
|
2566
|
+
const currentFitMode = this._fitMode;
|
|
2567
|
+
this.blitSprite.texture = this._transitionFromTex;
|
|
2568
|
+
this._resizeSprite(this.blitSprite, this._transitionFromTex, currentFitMode);
|
|
2569
|
+
this.app.renderer.render({
|
|
2570
|
+
container: this.blitSprite,
|
|
2571
|
+
target: this.fromRenderTexture,
|
|
2572
|
+
clear: true
|
|
2573
|
+
});
|
|
2574
|
+
this.blitSprite.texture = this._transitionToTex;
|
|
2575
|
+
this._resizeSprite(this.blitSprite, this._transitionToTex, currentFitMode);
|
|
2576
|
+
this.app.renderer.render({
|
|
2577
|
+
container: this.blitSprite,
|
|
2578
|
+
target: this.toRenderTexture,
|
|
2579
|
+
clear: true
|
|
2580
|
+
});
|
|
2581
|
+
this.blitSprite.texture = Texture.EMPTY;
|
|
2582
|
+
}
|
|
2583
|
+
mountTransition(definition, fromTexture, toTexture, params) {
|
|
2584
|
+
if (!this.transitionSprite || !this.videoSprite || !this.app) return;
|
|
2585
|
+
this._activeSource = null;
|
|
2586
|
+
if (this._activeTransition?.filter) {
|
|
2587
|
+
this._activeTransition.filter.destroy();
|
|
2588
|
+
}
|
|
2589
|
+
this._transitionFromTex = fromTexture;
|
|
2590
|
+
this._transitionToTex = toTexture;
|
|
2591
|
+
const canvasWidth = this.app.screen.width;
|
|
2592
|
+
const canvasHeight = this.app.screen.height;
|
|
2593
|
+
this._ensureRenderTextures(canvasWidth, canvasHeight);
|
|
2594
|
+
this._blitTransitionFrames();
|
|
2595
|
+
const fromRT = this.fromRenderTexture;
|
|
2596
|
+
const toRT = this.toRenderTexture;
|
|
2597
|
+
const originalFilterFrom = Filter.from;
|
|
2598
|
+
Filter.from = function(options) {
|
|
2599
|
+
if (options && options.resources) {
|
|
2600
|
+
if (!options.resources.uFrom) {
|
|
2601
|
+
options.resources.uFrom = fromRT.source;
|
|
2602
|
+
}
|
|
2603
|
+
if (!options.resources.uTo) {
|
|
2604
|
+
options.resources.uTo = toRT.source;
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
return originalFilterFrom.call(this, options);
|
|
2608
|
+
};
|
|
2609
|
+
let filter;
|
|
2610
|
+
try {
|
|
2611
|
+
filter = definition.create(params);
|
|
2612
|
+
} finally {
|
|
2613
|
+
Filter.from = originalFilterFrom;
|
|
2614
|
+
}
|
|
2615
|
+
filter.resources.uFrom = fromRT.source;
|
|
2616
|
+
filter.resources.uTo = toRT.source;
|
|
2617
|
+
this.transitionSprite.texture = fromRT;
|
|
2618
|
+
this.transitionSprite.filters = [filter];
|
|
2619
|
+
this.transitionSprite.visible = true;
|
|
2620
|
+
this.videoSprite.visible = false;
|
|
2621
|
+
if (this.baseMediaContainer) {
|
|
2622
|
+
this.baseMediaContainer.visible = false;
|
|
2623
|
+
}
|
|
2624
|
+
this._activeTransition = { definition, filter, params };
|
|
2625
|
+
this.resizeSprites();
|
|
2626
|
+
}
|
|
2627
|
+
getActiveTransitionId() {
|
|
2628
|
+
return this._activeTransition?.definition.id || null;
|
|
2629
|
+
}
|
|
2630
|
+
updateTransitionProgress(id, progress, params) {
|
|
2631
|
+
if (!this._activeTransition) return;
|
|
2632
|
+
if (params) {
|
|
2633
|
+
this._activeTransition.params = params;
|
|
2634
|
+
}
|
|
2635
|
+
this._blitTransitionFrames();
|
|
2636
|
+
this._activeTransition.definition.updateProgress(this._activeTransition.filter, progress, this._activeTransition.params);
|
|
2637
|
+
}
|
|
2638
|
+
unmountTransition() {
|
|
2639
|
+
if (this.transitionSprite) {
|
|
2640
|
+
this.transitionSprite.visible = false;
|
|
2641
|
+
this.transitionSprite.filters = null;
|
|
2642
|
+
}
|
|
2643
|
+
if (this.videoSprite) {
|
|
2644
|
+
this.videoSprite.visible = true;
|
|
2645
|
+
}
|
|
2646
|
+
if (this.baseMediaContainer) {
|
|
2647
|
+
this.baseMediaContainer.visible = true;
|
|
2648
|
+
}
|
|
2649
|
+
if (this._activeTransition?.filter) {
|
|
2650
|
+
this._activeTransition.filter.destroy();
|
|
2651
|
+
}
|
|
2652
|
+
this._activeTransition = null;
|
|
2653
|
+
this._transitionFromTex = null;
|
|
2654
|
+
this._transitionToTex = null;
|
|
2655
|
+
}
|
|
2425
2656
|
};
|
|
2426
2657
|
|
|
2427
2658
|
// src/videoEffects/example.ts
|
|
@@ -2431,7 +2662,7 @@ __export(example_exports, {
|
|
|
2431
2662
|
ParticleBurstEffect: () => ParticleBurstEffect,
|
|
2432
2663
|
VHSCompositeEffect: () => VHSCompositeEffect
|
|
2433
2664
|
});
|
|
2434
|
-
import { Filter, Container as Container2, Graphics } from "pixi.js";
|
|
2665
|
+
import { Filter as Filter2, Container as Container2, Graphics } from "pixi.js";
|
|
2435
2666
|
var hexToRgb = (hex) => {
|
|
2436
2667
|
const r = parseInt(hex.slice(1, 3), 16) / 255;
|
|
2437
2668
|
const g = parseInt(hex.slice(3, 5), 16) / 255;
|
|
@@ -2518,7 +2749,7 @@ var NeonGlowEffect = {
|
|
|
2518
2749
|
}
|
|
2519
2750
|
`;
|
|
2520
2751
|
const rgb = hexToRgb(params.color);
|
|
2521
|
-
return
|
|
2752
|
+
return Filter2.from({
|
|
2522
2753
|
gl: { vertex: DEFAULT_VERTEX_SHADER, fragment },
|
|
2523
2754
|
resources: {
|
|
2524
2755
|
uniforms: {
|
|
@@ -2683,7 +2914,7 @@ var VHSCompositeEffect = {
|
|
|
2683
2914
|
finalColor = color;
|
|
2684
2915
|
}
|
|
2685
2916
|
`;
|
|
2686
|
-
return
|
|
2917
|
+
return Filter2.from({
|
|
2687
2918
|
gl: { vertex: DEFAULT_VERTEX_SHADER, fragment },
|
|
2688
2919
|
resources: {
|
|
2689
2920
|
uniforms: {
|
|
@@ -2823,4 +3054,4 @@ export {
|
|
|
2823
3054
|
example_exports,
|
|
2824
3055
|
camera_exports
|
|
2825
3056
|
};
|
|
2826
|
-
//# sourceMappingURL=chunk-
|
|
3057
|
+
//# sourceMappingURL=chunk-LGW5SSLZ.js.map
|