pixi-effects 0.41.0 → 0.42.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/CHANGELOG.md +9 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Controller.d.cts +1 -1
- package/dist/Controller.d.ts +1 -1
- package/dist/{Movie-DWtxRiJ2.d.cts → Movie-BHGhg-fJ.d.cts} +44 -3
- package/dist/{Movie-CwqRLOzE.d.ts → Movie-CBVFZ1kg.d.ts} +44 -3
- package/dist/{chunk-Y2N6U3X5.js → chunk-NFJKBWYO.js} +150 -8
- package/dist/chunk-NFJKBWYO.js.map +1 -0
- package/dist/{chunk-RN5FWGGM.cjs → chunk-WVZLAIKK.cjs} +150 -8
- package/dist/chunk-WVZLAIKK.cjs.map +1 -0
- package/dist/index.cjs +25 -25
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.css +1 -1
- package/dist/present.cjs +1 -1
- package/dist/present.d.cts +1 -1
- package/dist/present.d.ts +1 -1
- package/dist/present.js +1 -1
- package/dist/three.cjs +34 -1
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +11 -0
- package/dist/three.d.ts +11 -0
- package/dist/three.js +35 -2
- package/dist/three.js.map +1 -1
- package/docs/api.md +23 -3
- package/llms-full.txt +144 -15
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +2 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -0
- package/skills/pixi-effects/reference/recipes.md +117 -11
- package/skills/pixi-effects/template.html +6 -6
- package/dist/chunk-RN5FWGGM.cjs.map +0 -1
- package/dist/chunk-Y2N6U3X5.js.map +0 -1
package/dist/three.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/three/defaults.ts","../src/three/spaceBridge.ts","../src/three/budget.ts","../src/three/ThreeSequence.ts","../src/three/gltf.ts","../src/three/index.ts"],"names":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AE,IAAI,MAAM,CAAA;AACzC,IAAA,QAAA,GAAW,IAAA,CAAK,GAAA,CAAI,QAAA,EAAU,CAAA,CAAE,GAAA,CAAI,QAAQ,CAAA,GAAK,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,GAAA,CAAI,KAAK,CAAC,CAAA,GAAI,MAAA,GAAU,IAAA,EAAM,CAAA,CAAE,GAAA,CAAI,QAAQ,CAAA,GAAK,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,GAAA,CAAI,EAAE,CAAC,CAAA,GAAI,MAAA,GAAU,IAAI,CAAA;AAAA,EACnJ;AACA,EAAA,GAAA,CAAI,SAAS,IAAA,CAAK,MAAM,CAAA,CAAE,eAAA,CAAgB,UAAU,QAAQ,CAAA;AAC5D,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,QAAA,GAAW,KAAK,IAAI,CAAA;AACxC,EAAA,GAAA,CAAI,MAAM,QAAA,GAAW,GAAA;AACrB,EAAA,GAAA,CAAI,OAAO,MAAM,CAAA;AACjB,EAAA,GAAA,CAAI,sBAAA,EAAuB;AAC7B;;;ACtGO,SAAS,aAAA,CAAc,OAAA,GAA4C,EAAC,EAAS;AAClF,EAAA,MAAM,IAAA,GAAO,QAAQ,QAAA,IAAY,OAAA;AACjC,EAAA,iBAAA,CAAkB,MAAM,0BAA0B,CAAA;AAClD,EAAA,eAAA,CAAgB,IAAI,CAAA;AACpB,EAAA,oBAAA,CAAqB,SAAS,aAAwC,CAAA;AACxE;AAMO,SAAS,MAAM,IAAA,EAAuC;AAC3D,EAAA,OAAO,IAAA;AACT","file":"three.js","sourcesContent":["/** The page-level default renderer of the three layers: `registerThree({ renderer })` sets it, a layer's own `renderer` wins. */\nexport type ThreeRendererKind = 'webgl' | 'webgpu';\n\nlet pageRenderer: ThreeRendererKind = 'webgl';\n\nexport function checkRendererKind(kind: unknown, where: string): asserts kind is ThreeRendererKind {\n if (kind !== 'webgl' && kind !== 'webgpu') throw new Error(`pixi-effects: ${where} must be 'webgl' or 'webgpu' (got ${JSON.stringify(kind)})`);\n}\nexport function setPageRenderer(kind: ThreeRendererKind): void { pageRenderer = kind; }\nexport function getPageRenderer(): ThreeRendererKind { return pageRenderer; }\n","/**\n * What lets a `three` layer live in the composition's space (`followCamera`, `followLights`): the composition's camera and lights, in three.\n *\n * The scene is in composition pixels with y flipped: a point the composition calls (x, y, z) is `new Vector3(x, -y, z)` here (the composition's y runs down, three's up;\n * +z is toward the viewer in both). A three camera with the composition camera's position, look-at point and vertical fov then projects that point to the pixel the\n * composition's own projection gives it (tests/three/spaceBridge.test.ts checks it to 1e-6 px).\n */\nimport { AmbientLight, Color, DirectionalLight, Fog, OrthographicCamera, PerspectiveCamera, PointLight, SRGBColorSpace, SpotLight, type Light, type Object3D, type Scene } from 'three';\nimport type { CameraState } from '../space/math';\nimport type { LightState } from '../space/lighting';\nimport type { FogState } from '../space/LitMaterial';\n\n/** The camera's near plane and far plane in composition pixels: the home camera sits about 740 px from the picture, a long dolly can be several thousand. */\nconst NEAR = 1;\nconst FAR = 20000;\n\n/** Put a three camera where the composition camera is. The aspect is the layer's (it must be the composition's: see `followCamera`). */\nexport function applyCameraState(camera: PerspectiveCamera, s: CameraState, aspect: number): void {\n camera.fov = s.fov;\n camera.aspect = aspect;\n camera.near = NEAR;\n camera.far = FAR;\n camera.up.set(0, 1, 0);\n camera.position.set(s.x, -s.y, s.z);\n const same = Math.hypot(s.lookAtX - s.x, s.lookAtY - s.y, s.lookAtZ - s.z) < 1e-9; // the composition then looks along -z\n camera.lookAt(same ? s.x : s.lookAtX, same ? -s.y : -s.lookAtY, same ? s.z - 1 : s.lookAtZ);\n camera.updateProjectionMatrix();\n camera.updateMatrixWorld();\n}\n\ninterface Entry { kind: LightState['kind']; light: Light; target: Object3D | null }\n\n/**\n * The composition's lights as three lights, one per light layer alive, in layer order. The objects are made once and moved every frame (a light that has ended is switched off,\n * not removed: the shader of a three layer must not be rebuilt as lights come and go).\n *\n * Intensity: three divides a diffuse surface by pi, so a light of intensity 1 is multiplied by pi to be \"as bright as the colour\" like a card's shading. Falloff: 'none' is no\n * attenuation; 'inverseSquare' is decay 2 with the intensity scaled so it is full at `radius` (it keeps rising inside it, where the composition's stays at 1); 'smooth' is three's\n * cut-off fitted to the composition's curve (see below). Shadows follow the light (castsShadows: the layer's own meshes cast and receive).\n */\nexport class LightMirror {\n private entries: Entry[] = [];\n /** True when a light alive casts shadows: the layer's renderer must have its shadow map on. */\n castsShadows = false;\n constructor(private readonly scene: Object3D, private readonly extent = 2000) {}\n\n update(lights: readonly LightState[]): void {\n this.castsShadows = lights.some((s) => s.castsShadows && s.kind !== 'ambient');\n lights.forEach((s, i) => {\n let e = this.entries[i];\n if (!e || e.kind !== s.kind) {\n if (e) this.remove(e);\n e = this.entries[i] = this.make(s.kind);\n }\n this.configure(e, s);\n });\n for (let i = lights.length; i < this.entries.length; i++) this.entries[i]!.light.visible = false;\n }\n\n dispose(): void {\n for (const e of this.entries) this.remove(e);\n this.entries = [];\n }\n\n private make(kind: LightState['kind']): Entry {\n const light: Light = kind === 'ambient' ? new AmbientLight() : kind === 'parallel' ? new DirectionalLight() : kind === 'spot' ? new SpotLight() : new PointLight();\n light.name = 'pixi-effects:composition-light';\n const target = (light as DirectionalLight | SpotLight).target ?? null;\n this.scene.add(light);\n if (target) this.scene.add(target);\n return { kind, light, target };\n }\n\n private remove(e: Entry): void {\n this.scene.remove(e.light);\n if (e.target) this.scene.remove(e.target);\n }\n\n private configure(e: Entry, s: LightState): void {\n const { light } = e;\n light.visible = true;\n light.color = (light.color ?? new Color()).setRGB(s.r, s.g, s.b, SRGBColorSpace);\n let intensity = s.intensity * Math.PI;\n if (s.kind !== 'ambient') {\n light.position.set(s.x, -s.y, s.z);\n e.target?.position.set(s.lookAtX, -s.lookAtY, s.lookAtZ);\n }\n if (s.kind === 'point' || s.kind === 'spot') {\n const l = light as PointLight | SpotLight;\n if (s.falloff === 'inverseSquare') { l.distance = 0; l.decay = 2; intensity *= s.radius * s.radius; }\n else if (s.falloff === 'smooth') {\n // The composition: 1 inside `radius`, a smoothstep down to 0 at radius + falloffDistance. three's cut-off distance D with decay 0 attenuates by saturate(1 - (d/D)^4)^2, a gentler curve that\n // starts to fall at once. A cut-off and a gain chosen from where the fall starts (p = radius / (radius + falloffDistance)) halve the largest difference over the range (0.15-0.40 with\n // D = radius + falloffDistance and no gain, 0.09-0.17 here for a fall that is not steep); a fall that is steep against its radius cannot be matched by three's curve.\n const reach = s.radius + Math.max(s.falloffDistance, 1e-3), p = s.radius / reach;\n l.distance = reach * (0.8 + 0.45 * p); l.decay = 0; intensity *= 0.87 + 0.45 * p;\n }\n else { l.distance = 0; l.decay = 0; }\n }\n if (s.kind === 'spot') {\n const l = light as SpotLight;\n l.angle = ((s.coneAngle / 2) * Math.PI) / 180;\n l.penumbra = s.coneFeather;\n }\n light.intensity = intensity;\n if (s.kind !== 'ambient') {\n const l = light as PointLight | SpotLight | DirectionalLight;\n l.castShadow = s.castsShadows;\n if (s.castsShadows) {\n l.shadow.mapSize.set(2048, 2048);\n l.shadow.intensity = s.shadowDarkness;\n l.shadow.radius = Math.max(1, s.shadowDiffusion / 4);\n // Scale-aware: three compares depths AFTER the perspective divide, so a bias of b is about b·d²/near world units at distance d from the light. A near plane of 1 px and a bias of\n // -0.0005 hid every caster within ~250 px of its receiver at 1280 x 720 (found by an AI trial). The near plane follows the size of the composition (~20 px at 1280 x 720) and the\n // bias is small, so the gap is about a pixel or two; normalBias (world units, along the surface normal) is a pixel or two too.\n l.shadow.bias = -0.00005;\n l.shadow.normalBias = this.extent / 1000;\n const cam = l.shadow.camera;\n cam.near = Math.max(1, this.extent / 128); cam.far = 20000;\n if (s.kind === 'parallel') { const o = cam as OrthographicCamera; o.left = -this.extent; o.right = this.extent; o.top = this.extent; o.bottom = -this.extent; }\n cam.updateProjectionMatrix();\n }\n }\n light.updateMatrixWorld?.();\n e.target?.updateMatrixWorld?.();\n }\n}\n\n/**\n * The composition camera's fog as the scene's `Fog`: the same colour, `near` and `far` (distances along the view, in composition pixels). three's Fog fades with `smoothstep` where the\n * composition's fades linearly, and has no amount below 1: close, not equal (see docs/dsl.md). The Fog is made when the camera has one and removed when it has not; a Fog the layer made\n * itself is never touched.\n */\nexport class FogMirror {\n private own: Fog | null = null;\n constructor(private readonly scene: Scene) {}\n\n update(fog: FogState | null): void {\n if (!fog) {\n if (this.own && this.scene.fog === this.own) this.scene.fog = null;\n this.own = null;\n return;\n }\n if (!this.own || this.scene.fog !== this.own) {\n if (this.scene.fog && this.scene.fog !== this.own) return; // the layer has its own fog: leave it\n this.own = new Fog(0x000000, fog.near, fog.far);\n this.scene.fog = this.own;\n }\n this.own.color.setRGB(fog.r, fog.g, fog.b, SRGBColorSpace);\n this.own.near = fog.near;\n this.own.far = fog.far;\n }\n\n dispose(): void { this.update(null); }\n}\n","/**\n * How many three layers a page can hold. Each `three` layer owns a renderer, and a browser keeps only so many live graphics contexts for a whole page: about 16 for WebGL, about 32 for\n * WebGPU (measured 2026-10-15 on Chrome: layers beyond it draw nothing, without an error). PixiJS and a `shader` layer use contexts of their own, so the warning comes a little before the\n * limit: more than 12 WebGL layers, more than 28 WebGPU layers.\n */\nexport type ThreeKind = 'webgl' | 'webgpu';\n\nconst WARN_ABOVE: Record<ThreeKind, number> = { webgl: 12, webgpu: 28 };\nconst LIMIT: Record<ThreeKind, string> = { webgl: 'about 16 WebGL contexts', webgpu: 'about 32 WebGPU contexts' };\nconst live: Record<ThreeKind, number> = { webgl: 0, webgpu: 0 };\nconst warned = new Set<ThreeKind>();\n\n/** A three layer made its renderer: count it, and say once per kind when the page holds too many. */\nexport function trackThree(kind: ThreeKind): void {\n live[kind]++;\n if (live[kind] > WARN_ABOVE[kind] && !warned.has(kind)) {\n warned.add(kind);\n console.warn(`pixi-effects: ${live[kind]} three layers are alive with renderer: '${kind}', and a browser keeps ${LIMIT[kind]} for the whole page; layers beyond that draw nothing, without an error. ` +\n `Put several objects in one three layer, destroy layers that are over, ` + (kind === 'webgl' ? `or use renderer: 'webgpu' for some (its limit is about 32)` : `or use renderer: 'webgl' for some of them (a different pool of contexts)`));\n }\n}\n\n/** A three layer let its renderer go. */\nexport function releaseThree(kind: ThreeKind): void {\n live[kind] = Math.max(0, live[kind] - 1);\n}\n\n/** What the page holds now, per renderer. */\nexport function threeBudget(): Record<ThreeKind, number> {\n return { ...live };\n}\n\n/** For tests: forget everything. */\nexport function resetThreeBudget(): void {\n live.webgl = live.webgpu = 0;\n warned.clear();\n}\n","import { Sprite, Texture } from 'pixi.js';\nimport { Box3, PerspectiveCamera, Raycaster, Scene, Vector2, Vector3, WebGLRenderer, type Camera, type Object3D } from 'three';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport { Sequence } from '../sequences/Base';\nimport { buildScope } from '../expr/Scope';\nimport { evaluateExpr } from '../expr/Parser';\nimport type { PathRouters } from '../core/Timeline';\nimport type { PropValue } from '../types';\nimport type { ThreeContext, ThreeSequenceSpec } from './types';\nimport { checkRendererKind, getPageRenderer } from './defaults';\nimport { applyCameraState, FogMirror, LightMirror } from './spaceBridge';\nimport { releaseThree, trackThree } from './budget';\nimport type { CanvasCheck } from '../sequences/Canvas';\n\n/** What makes a frame depend on more than the time (the same list as the canvas layer's). */\nconst NOT_PURE = /\\bMath\\s*\\.\\s*random\\s*\\(|\\bDate\\s*\\.\\s*now\\s*\\(|\\bperformance\\s*\\.\\s*now\\s*\\(|\\bnew\\s+Date\\s*\\(/;\n\nexport class ThreeSequence extends Sequence {\n private _renderer: WebGLRenderer | WebGPURenderer | null = null;\n /** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */\n renderer: 'webgl' | 'webgpu' | null = null;\n /** The backend under it: `'webgl'`, `'webgpu'`, or `'webgl2'` when three's WebGPURenderer found no WebGPU in this browser and used its own WebGL2 backend (the same picture). */\n backend: 'webgl' | 'webgpu' | 'webgl2' | null = null;\n private _gpu = false; // renderer: 'webgpu': async init and async render\n private _scene: Scene | null = null;\n private _camera: Camera | null = null;\n private _ctx: ThreeContext | null = null;\n private _objects: Record<string, object> = {};\n private _warnedUpdate = false;\n private _warnedNodeFrame = false;\n private _warnedPaths = new Set<string>();\n private _lightMirror: LightMirror | null = null;\n private _fogMirror: FogMirror | null = null;\n private _warnedSpace = new Set<string>();\n private _tracked = false;\n\n private get _threeSpec(): ThreeSequenceSpec {\n return this.spec as unknown as ThreeSequenceSpec;\n }\n\n protected override pathRouters(): PathRouters {\n return { three: (path) => this._resolveThreePath(path) };\n }\n\n async build(): Promise<void> {\n const spec = this._threeSpec;\n if (this.duration === undefined) {\n this.duration = this.parent?.duration ?? this.root.duration;\n }\n if (typeof spec.update === 'function' && NOT_PURE.test(spec.update.toString())) {\n console.warn(`pixi-effects: three layer${spec.name ? ` \"${spec.name}\"` : ''}: update calls Math.random, Date.now, performance.now or new Date, so it is not deterministic: the same frame would draw differently in playback, in a seek and in an export. Derive the value from t`);\n }\n\n // Resolve layer size. Expressions see the usual scope; intrinsic w/h are\n // still 0 here (same chicken-and-egg as shapes), so W/H/GW/GH carry it.\n const scope = buildScope(this, this.parent, this.root) as unknown as Record<string, number>;\n const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;\n const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;\n const resolution = spec.resolution ?? 1;\n\n // Offscreen canvas — never attached to the DOM. document.createElement\n // (not OffscreenCanvas) so PIXI's Texture.from and three both accept it.\n const canvas = document.createElement('canvas');\n const antialias = spec.antialias ?? true;\n const kind = spec.renderer ?? getPageRenderer();\n checkRendererKind(kind, \"a three layer's renderer\");\n this._gpu = kind === 'webgpu';\n this.renderer = kind;\n let renderer: WebGLRenderer | WebGPURenderer;\n if (this._gpu) {\n let mod: typeof import('three/webgpu');\n try { mod = await import('three/webgpu'); } catch (err) {\n throw new Error(`pixi-effects: renderer: 'webgpu' needs three 0.17x or later with \"three/webgpu\" in the import map (${err instanceof Error ? err.message : err})`);\n }\n renderer = new mod.WebGPURenderer({ canvas, alpha: true, antialias });\n this._renderer = renderer;\n this._track();\n // The device is made here: nothing may render before. Where there is no WebGPU three uses its own WebGL2 backend and says so with a warning: that is not a problem\n // (it draws the same picture), so it becomes `backend: 'webgl2'` instead of a line in the author's console.\n const warn = console.warn;\n let noGpu = false;\n console.warn = (...args: unknown[]) => { if (/WebGPU is not available/.test(String(args[0]))) noGpu = true; else warn.apply(console, args as []); };\n try { await renderer.init(); }\n catch (err) { this._disposeRenderer(); throw err; }\n finally { console.warn = warn; }\n this.backend = noGpu ? 'webgl2' : 'webgpu';\n } else {\n renderer = new WebGLRenderer({ canvas, alpha: true, antialias });\n this._renderer = renderer;\n this._track();\n let said = false;\n canvas.addEventListener('webglcontextlost', () => { // the browser took the context away: the layer draws nothing from now on\n if (said) return;\n said = true;\n console.warn(`pixi-effects: three layer${spec.name ? ` \"${spec.name}\"` : ''}: the browser took this layer's WebGL context away (a page keeps about 16 for all its layers, PixiJS and shader layers: too many were alive), so the layer draws nothing. Put several objects in one three layer, or destroy layers that are over`);\n });\n this.backend = 'webgl';\n }\n try {\n renderer.setSize(Math.round(width * resolution), Math.round(height * resolution), false);\n renderer.setClearColor(0x000000, 0);\n\n const scene = new Scene();\n const camera: Camera = new PerspectiveCamera(50, width / height, 0.1, 2000);\n const ctx: ThreeContext = { scene, camera, renderer, width, height };\n if (spec.followCamera) this._checkFollowShape(width, height, spec.name);\n\n let result: Awaited<ReturnType<ThreeSequenceSpec['setup']>>;\n try { result = await spec.setup(ctx); } catch (err) { throw this._gpu ? this._explainWebGpuError(err, spec.name) : err; }\n if (result?.camera) ctx.camera = result.camera;\n this._scene = scene;\n this._camera = ctx.camera;\n this._ctx = ctx;\n this._objects = { ...(result?.objects ?? {}) };\n if (!('camera' in this._objects)) this._objects.camera = this._camera;\n\n if (this._gpu) this._checkWebGpuMaterials(scene, spec.name);\n // Frame 0 so the texture is never blank before the first tick.\n this._draw(0);\n\n const texture = Texture.from(canvas);\n const sprite = new Sprite({ texture, label: spec.name });\n sprite.cullable = true;\n // Texture is canvas-sized (layer px × resolution); scale back to comp px.\n sprite.width = width;\n sprite.height = height;\n this.target = sprite;\n this.intrinsicWidth = width;\n this.intrinsicHeight = height;\n this.buildFilters();\n } catch (err) {\n this._disposeRenderer();\n throw err;\n }\n }\n\n /**\n * Per-frame sync hook. Movie._awaitVideoFrames duck-types on this method\n * (same contract as VideoSequence) and awaits it inside gotoFrame — the\n * single frame path shared by playback and export, which is what makes\n * three layers deterministic in both.\n */\n async awaitFrameAt(local: number): Promise<void> {\n if (!this._renderer || !this._scene || !this._camera || !this._ctx) return;\n const spec = this._threeSpec;\n const t = Math.max(0, Math.min(local, this.duration ?? local));\n this._followSpace(t);\n if (spec.update) {\n try {\n spec.update(t, this._ctx);\n } catch (err) {\n if (!this._warnedUpdate) {\n this._warnedUpdate = true;\n console.warn('pixi-effects: three update() threw (reported once) —', err);\n }\n }\n }\n this._draw(t);\n (this.target as Sprite | null)?.texture.source.update();\n }\n\n /**\n * `movie.pick`: a ray through the point (u, v) of the layer's picture (0..1, v down) from the layer's camera, and what it meets first: the object's name (its own, or its nearest\n * ancestor's that has one), where, and how far from the camera. Invisible objects and groups are not met. null when the ray meets nothing.\n */\n pickAt(u: number, v: number): { object: string; point: [number, number, number]; distance: number; object3d: Object3D } | null {\n const scene = this._scene, camera = this._camera;\n if (!scene || !camera) return null;\n scene.updateMatrixWorld();\n camera.updateMatrixWorld();\n const ray = new Raycaster();\n ray.setFromCamera(new Vector2(u * 2 - 1, -(v * 2 - 1)), camera);\n const visibleChain = (o: Object3D | null): boolean => { for (let n = o; n; n = n.parent) if (!n.visible) return false; return true; };\n for (const hit of ray.intersectObjects(scene.children, true)) {\n if (!visibleChain(hit.object)) continue;\n let name = '';\n for (let n: Object3D | null = hit.object; n && n !== scene; n = n.parent) if (n.name) { name = n.name; break; }\n return { object: name, point: hit.point.toArray() as [number, number, number], distance: hit.distance, object3d: hit.object };\n }\n return null;\n }\n\n /**\n * The determinism check (`check`, `movie.review()`): the scene drawn at a few moments in two orders, with one draw thrown away first, and the pictures compared, as the canvas layer\n * does. A layer whose same frame is not the same picture (a clock, `Math.random`, a mixer advanced with `update(dt)`, any state that builds up from call to call) is reported.\n * It runs the layer's own `update`, draws with its renderer and reads the picture from the renderer's canvas in the same task; the next real frame draws again, so nothing is left behind.\n */\n checkDeterminism(times: number[]): CanvasCheck {\n const none: CanvasCheck = { differs: [], drawMs: 0, threw: [] };\n const renderer = this._renderer, ctx = this._ctx;\n if (!renderer || !this._scene || !this._camera || !ctx) return none;\n const source = (renderer as unknown as { domElement: HTMLCanvasElement }).domElement;\n const w = source.width, h = source.height;\n const scratch = document.createElement('canvas');\n scratch.width = w; scratch.height = h;\n const g = scratch.getContext('2d', { willReadFrequently: true });\n if (!g) return none;\n const keep = w * h * 4 * times.length <= 96e6;\n const hash = (d: Uint8ClampedArray): number => { let x = 0x811c9dc5; for (let i = 0; i < d.length; i++) { x ^= d[i]!; x = Math.imul(x, 0x01000193); } return x >>> 0; };\n const ms: number[] = [];\n const threw = new Set<number>();\n const once = (t: number, timed: boolean): Uint8ClampedArray => {\n const from = performance.now();\n try {\n this._followSpace(t);\n this._threeSpec.update?.(t, ctx);\n this._draw(t);\n g.clearRect(0, 0, w, h);\n g.drawImage(source, 0, 0);\n } catch { threw.add(t); }\n if (timed) { g.getImageData(0, 0, 1, 1); ms.push(performance.now() - from); }\n return g.getImageData(0, 0, w, h).data;\n };\n for (const t of times) once(t, false); // the warm-up\n const first = times.map(t => { const d = once(t, true); return keep ? d.slice() : hash(d); });\n const second = [...times].reverse().map(t => once(t, false)).reverse();\n scratch.width = scratch.height = 1;\n const differs: CanvasCheck['differs'] = [];\n times.forEach((t, i) => {\n const a = first[i]!, b = second[i]!;\n if (typeof a === 'number') { if (a !== hash(b)) differs.push({ t, pixels: -1, maxDiff: -1 }); return; }\n let pixels = 0, maxDiff = 0;\n for (let k = 0; k < a.length; k++) { const d = Math.abs(a[k]! - b[k]!); if (d) { pixels++; if (d > maxDiff) maxDiff = d; } }\n if (pixels) differs.push({ t, pixels, maxDiff });\n });\n ms.sort((x, y) => x - y);\n return { differs: differs.filter(d => !threw.has(d.t)), drawMs: ms.length ? ms[Math.floor(ms.length / 2)]! : 0, threw: times.filter(t => threw.has(t)) };\n }\n\n /** `followCamera` / `followLights`: before each frame, ask the composition for its camera and lights at this moment (the layer's time on the composition's clock) and mirror them in the scene. */\n private _followSpace(t: number): void {\n const spec = this._threeSpec;\n if (!spec.followCamera && !spec.followLights && !spec.followFog) return;\n const ctx = this._ctx, scene = this._scene;\n if (!ctx || !scene) return;\n if (!this.parent?.spaceAt) {\n this._saidOnce('parent', `followCamera / followLights / followFog need the layer to sit in a composition that has a camera or a light to follow; this layer's parent cannot say (it keeps its own camera and lights)`, spec.name);\n return;\n }\n const space = this.parent.spaceAt((this.absoluteStart ?? this.at) + t);\n ctx.space = space;\n if (spec.followCamera) {\n const camera = ctx.camera as PerspectiveCamera;\n if (!camera.isPerspectiveCamera) this._saidOnce('camera', `followCamera needs a PerspectiveCamera (this layer's camera is a ${(ctx.camera as { type?: string }).type ?? 'different camera'}); it keeps it as it is`, spec.name);\n else applyCameraState(camera, space.camera, ctx.width / ctx.height);\n }\n if (spec.followLights) {\n const mirror = (this._lightMirror ??= new LightMirror(scene, Math.max(ctx.width, ctx.height) * 2));\n mirror.update(space.lights);\n if (!this._warnedSpace.has('inverseSquare')) this._checkInverseSquare(space.lights, scene, spec.name);\n if (mirror.castsShadows && !ctx.renderer.shadowMap.enabled) ctx.renderer.shadowMap.enabled = true;\n }\n if (spec.followFog) {\n if (space.fog && space.fog.amount !== 1) this._saidOnce('fogAmount', `followFog: the camera's fogAmount is ${space.fog.amount}, and three's Fog has no amount below 1: the layer uses the full amount (set fogColor to the colour you want at the far end, or leave followFog off and make the fog yourself from ctx.space.fog)`, spec.name);\n (this._fogMirror ??= new FogMirror(scene)).update(space.fog);\n }\n }\n\n /**\n * An inverse-square light is held at full strength inside its `radius` by the composition; three's decay-2 light keeps rising (4x at half the radius, 11x at a third). When the scene has\n * an object closer to such a light than 0.8 of its radius, say so once, with the way out. (The check is the scene's bounding box against the light's place: no object is measured.)\n */\n private _checkInverseSquare(lights: ReadonlyArray<{ kind: string; falloff: string; radius: number; x: number; y: number; z: number }>, scene: Scene, name: string | undefined): void {\n const near = lights.filter((l) => l.falloff === 'inverseSquare' && (l.kind === 'point' || l.kind === 'spot'));\n if (!near.length) return;\n const box = new Box3().setFromObject(scene);\n if (box.isEmpty()) return;\n for (const l of near) {\n const d = box.distanceToPoint(new Vector3(l.x, -l.y, l.z));\n if (d < 0.8 * l.radius) {\n this._saidOnce('inverseSquare', `followLights: a light with falloff 'inverseSquare' and radius ${l.radius} is only ${Math.round(d)} px from the nearest part of the scene. The composition holds such a light at full strength inside its radius; three's inverse-square light keeps rising there (${(Math.pow(l.radius / Math.max(d, 1), 2)).toFixed(1)}x at that distance), so those parts come out much brighter. Make the radius smaller than that distance, or use falloff 'smooth' (it is fitted to the composition's curve)`, name);\n return;\n }\n }\n }\n\n /** followCamera shows the whole composition through the layer's picture: a layer of another shape would show it squeezed or cut. Said once at build. */\n private _checkFollowShape(width: number, height: number, name: string | undefined): void {\n const p = this.parent;\n if (!p || !(p.width > 0 && p.height > 0)) return;\n if (Math.abs(width * p.height - height * p.width) <= 1e-3 * width * p.height) return;\n this._saidOnce('shape', `followCamera: the layer is ${width} x ${height} but the composition is ${p.width} x ${p.height}; the camera shows the whole composition, so the layer needs its aspect ratio (drop width / height to cover the composition)`, name);\n }\n\n private _saidOnce(key: string, message: string, name: string | undefined): void {\n if (this._warnedSpace.has(key)) return;\n this._warnedSpace.add(key);\n console.warn(`pixi-effects: three layer${name ? ` \"${name}\"` : ''}: ${message}`);\n }\n\n /**\n * One render of the scene at the layer-local time `t`. WebGPURenderer.render() needs `await init()` first (done in build); it queues the GPU work, and PixiJS reads the canvas after.\n *\n * Three's WebGPU node system updates the light uniforms (and its `time`) once per FRAME ID, and bumps that id in its own requestAnimationFrame loop only. Renders that\n * follow each other in one task (a seek, an export) would all show the lights of the last animation frame: a lamp keyframed with `three.lamp.intensity` would not move.\n * So before each render the layer advances the node frame itself, and gives `time` the layer's own time (not three's wall clock).\n */\n private _draw(t: number): void {\n if (!this._renderer || !this._scene || !this._camera) return;\n if (this._gpu) this._advanceNodeFrame(t);\n this._renderer.render(this._scene, this._camera);\n }\n\n /**\n * The author chose renderer: 'webgpu'. Three's WebGPU renderer turns materials into node materials: a ShaderMaterial / RawShaderMaterial cannot run there (three logs an error on\n * every render and draws a default material) and `onBeforeCompile` (a patch of the WebGL shader text) is ignored without a word. Stop, once, naming the first such material and the fix,\n * instead of drawing a picture that is wrong without saying so.\n */\n private _checkWebGpuMaterials(scene: Scene, layerName: string | undefined): void {\n const bad: string[] = [];\n const seen = new Set<unknown>();\n const check = (m: unknown): void => {\n if (!m || typeof m !== 'object' || seen.has(m)) return;\n seen.add(m);\n const mat = m as { type?: string; name?: string; isShaderMaterial?: boolean; isRawShaderMaterial?: boolean };\n const label = `${mat.name ? `\"${mat.name}\" ` : ''}${mat.type ?? 'material'}`;\n if (mat.isShaderMaterial || mat.isRawShaderMaterial) bad.push(`${label} is a ShaderMaterial (it cannot run on the WebGPU renderer)`);\n else if (Object.prototype.hasOwnProperty.call(mat, 'onBeforeCompile')) bad.push(`${label} sets onBeforeCompile (the WebGPU renderer ignores it)`);\n };\n scene.traverse?.((o: unknown) => {\n const mats = (o as { material?: unknown }).material;\n for (const m of Array.isArray(mats) ? mats : [mats]) check(m);\n });\n if (!bad.length) return;\n this._disposeRenderer();\n throw new Error(`pixi-effects: three layer${layerName ? ` \"${layerName}\"` : ''} with renderer: 'webgpu': ${bad[0]}${bad.length > 1 ? ` (and ${bad.length - 1} more)` : ''}. ` +\n `Add renderer: 'webgl' to this layer (or registerThree({ renderer: 'webgl' }) for the page), or write the look with three's node materials (TSL).`);\n }\n\n /** The one setup failure everybody meets on the WebGPU renderer: a PMREMGenerator imported from 'three' reads WebGL state the WebGPU renderer does not have. */\n private _explainWebGpuError(err: unknown, layerName: string | undefined): unknown {\n if (err instanceof TypeError && /reading 'buffers'|renderer\\.state/.test(err.message)) {\n return new Error(`pixi-effects: three layer${layerName ? ` \"${layerName}\"` : ''} with renderer: 'webgpu': setup used a WebGL-only helper, most likely a PMREMGenerator imported from 'three'. ` +\n `Import it from 'three/webgpu' (import * as THREE from 'three/webgpu'), or add renderer: 'webgl' to this layer.`, { cause: err });\n }\n return err;\n }\n\n private _advanceNodeFrame(t: number): void {\n const frame = (this._renderer as unknown as { _nodes?: { nodeFrame?: { update?: () => void; time: number; deltaTime: number } } })._nodes?.nodeFrame;\n if (!frame || typeof frame.update !== 'function') {\n if (!this._warnedNodeFrame) {\n this._warnedNodeFrame = true;\n console.warn(\"pixi-effects: this three has no node frame to advance (renderer: 'webgpu'): a light animated by keyframes may not follow the time in a seek or an export; use renderer: 'webgl' or report the three version\");\n }\n return;\n }\n frame.update();\n frame.time = t;\n frame.deltaTime = 1 / ((this.root as { frameRate?: number }).frameRate ?? 30);\n }\n\n private _resolveThreePath(path: string): { target: object; prop: string } | null {\n const segs = path.split('.');\n if (segs.length < 2) {\n this._warnPath(path, 'needs at least <object>.<prop>');\n return null;\n }\n let obj: unknown = this._objects[segs[0]!];\n if (obj == null) {\n this._warnPath(path, `unknown object \"${segs[0]}\" — expose it via setup's { objects }`);\n return null;\n }\n for (let i = 1; i < segs.length - 1; i++) {\n obj = (obj as Record<string, unknown>)[segs[i]!];\n if (obj == null) {\n this._warnPath(path, `\"${segs[i]}\" is undefined along the path`);\n return null;\n }\n }\n const prop = segs[segs.length - 1]!;\n if (typeof obj !== 'object' || !(prop in (obj as object))) {\n this._warnPath(path, `no property \"${prop}\"`);\n return null;\n }\n return { target: obj as object, prop };\n }\n\n private _warnPath(path: string, why: string): void {\n if (this._warnedPaths.has(path)) return;\n this._warnedPaths.add(path);\n console.warn(`pixi-effects: keyframe path three.${path} ${why}; skipped`);\n }\n\n /** Count this layer's renderer against the page's allowance of graphics contexts (given back when the renderer is disposed). */\n private _track(): void {\n this._tracked = true;\n trackThree(this._gpu ? 'webgpu' : 'webgl');\n }\n\n private _disposeRenderer(): void {\n if (!this._renderer) return;\n if (this._tracked) { this._tracked = false; releaseThree(this._gpu ? 'webgpu' : 'webgl'); }\n try {\n this._renderer.dispose();\n if (!this._gpu) (this._renderer as WebGLRenderer).forceContextLoss();\n } catch (err) {\n console.warn('pixi-effects: three renderer dispose threw —', err);\n }\n this._renderer = null;\n }\n\n override destroy(): void {\n const spec = this._threeSpec;\n if (this._ctx && spec.dispose) {\n try { spec.dispose(this._ctx); } catch (err) {\n console.warn('pixi-effects: three dispose() threw —', err);\n }\n }\n const texture = (this.target as Sprite | null)?.texture;\n this._lightMirror?.dispose();\n this._lightMirror = null;\n this._fogMirror?.dispose();\n this._fogMirror = null;\n this._disposeRenderer();\n this._scene = null;\n this._camera = null;\n this._ctx = null;\n this._objects = {};\n super.destroy();\n texture?.destroy(true); // canvas-backed source is per-sequence; safe to kill\n }\n}\n\nfunction resolveDim(v: PropValue | undefined, scope: Record<string, number>): number | undefined {\n if (v === undefined) return undefined;\n if (typeof v === 'number') return v;\n return evaluateExpr(v, scope);\n}\n","/**\n * Two helpers for a glTF model in a `three` layer's `setup` / `update` (the layer stays the free box; these are what is easy to get wrong by hand):\n *\n * const fox = await threeGltf('Fox.glb', { animation: 'Run' }); // in setup\n * ctx.scene.add(fox.object); threeFrameCamera(ctx.camera, fox.object);\n * ... update: (t) => fox.pose(t) // the clip at the layer's time: a function of t, never of a clock\n *\n * The loader is an addon: a page that never calls `threeGltf` never loads it (the import map needs `\"three/addons/\"` next to `\"three\"`).\n */\nimport { AnimationMixer, Box3, Group, LoopOnce, LoopRepeat, Vector3, type AnimationClip, type Camera, type Object3D, type PerspectiveCamera } from 'three';\n\nexport interface ThreeGltfOptions {\n /** A clip name, a clip index, or `false` (no animation: the model's bind pose). Default: the first clip, if the file has one. */\n animation?: string | number | false;\n /** The clip time is `t × speed + offset` (the layer's seconds). Defaults 1 and 0. */\n speed?: number;\n offset?: number;\n /** `true` (default): the clip repeats; `false`: it holds its last pose. */\n loop?: boolean;\n}\n\nexport interface ThreeGltfModel {\n /** Add this to `ctx.scene`. A group whose origin is the centre of the model's bounding box (bind pose): position, turn and `fit` it about its centre. */\n object: Group;\n /** The names of the clips the file has. */\n clips: string[];\n /** The size of the model's bounding box in the file's own units (bind pose, before `fit`). */\n size: Vector3;\n /** Pose the model at the layer's time `t` (seconds). `AnimationMixer.setTime` evaluates the clip from zero every call: a seek, an export and a repeat give the same pose. */\n pose(t: number): void;\n /** Scale `object` so the model's longest side is `px` (a model in metres in a scene in composition pixels). */\n fit(px: number): void;\n /** Stop the clip. Geometries, materials and textures are yours to dispose with the scene. */\n dispose(): void;\n}\n\nexport async function threeGltf(url: string, options: ThreeGltfOptions = {}): Promise<ThreeGltfModel> {\n const label = 'pixi-effects: threeGltf';\n if (typeof url !== 'string' || !url) throw new Error(`${label}: the first argument is the URL of a .glb or .gltf file`);\n let GLTFLoader: typeof import('three/addons/loaders/GLTFLoader.js').GLTFLoader;\n try { ({ GLTFLoader } = await import('three/addons/loaders/GLTFLoader.js')); } catch (err) {\n throw new Error(`${label}: needs \"three/addons/\" in the import map next to \"three\" (${err instanceof Error ? err.message : err})`);\n }\n let gltf: Awaited<ReturnType<InstanceType<typeof GLTFLoader>['loadAsync']>>;\n try { gltf = await new GLTFLoader().loadAsync(url); } catch (err) {\n throw new Error(`${label}: could not load \"${url}\" (${err instanceof Error ? err.message : err})`, { cause: err });\n }\n\n const clips: AnimationClip[] = gltf.animations ?? [];\n let clip: AnimationClip | undefined;\n const wanted = options.animation;\n if (wanted === false || (wanted === undefined && clips.length === 0)) clip = undefined;\n else if (wanted === undefined) clip = clips[0];\n else {\n clip = typeof wanted === 'number' ? clips[wanted] : clips.find((c) => c.name === wanted);\n if (!clip) throw new Error(`${label}: \"${url}\" has no animation ${JSON.stringify(wanted)}; its clips: ${clips.length ? clips.map((c, i) => `${i}: \"${c.name}\"`).join(', ') : '(none)'}`);\n }\n\n // The origin of the group is the centre of the box, so the model is placed and turned about its centre.\n const root: Object3D = gltf.scene;\n // A skinned mesh is always drawn. three culls a mesh by a bounding sphere, and a skinned mesh's sphere does not follow its animation or its place: a model that MOVES and throws a shadow\n // drew its shadow differently depending on the frames drawn before it (found on the Khronos Fox: `check` reported the layer as not a function of the time; with culling off the\n // pictures are the same in any order). The cost is that an off-screen model is still drawn.\n root.traverse((o) => { if ((o as { isSkinnedMesh?: boolean }).isSkinnedMesh) o.frustumCulled = false; });\n const object = new Group();\n object.add(root);\n const bounds = new Box3().setFromObject(root);\n const centre = bounds.getCenter(new Vector3());\n const size = bounds.getSize(new Vector3());\n root.position.sub(centre);\n\n let mixer: AnimationMixer | null = null;\n if (clip) {\n mixer = new AnimationMixer(root);\n const action = mixer.clipAction(clip);\n action.setLoop(options.loop === false ? LoopOnce : LoopRepeat, Infinity);\n action.clampWhenFinished = true;\n action.play();\n }\n const speed = options.speed ?? 1, offset = options.offset ?? 0;\n\n return {\n object,\n clips: clips.map((c) => c.name),\n size,\n pose: (t) => { mixer?.setTime(t * speed + offset); },\n fit: (px) => { object.scale.setScalar(px / Math.max(size.x, size.y, size.z, 1e-9)); },\n dispose: () => { mixer?.stopAllAction(); mixer?.uncacheRoot(root); mixer = null; },\n };\n}\n\nexport interface ThreeFrameCameraOptions {\n /** The direction the camera sits in from the centre of the model, any length. Default `[0.45, 0.3, 1]`: a three-quarter view, a little from the side and above. */\n direction?: [number, number, number];\n /** Free room around the model: 1.1 (the default) leaves 10 %. */\n margin?: number;\n}\n\n/**\n * Put `camera` where the whole of `object` (its bounding box now, with its scale and place) fits the frame, looking at its centre: the smallest distance at which the 8 corners of\n * the box all fit both the vertical and the horizontal field of view (a bounding sphere would leave a long model small and head-on). `near` and `far` follow the distance.\n * Uses the camera's own `fov` and `aspect`. For a clip that travels far, give your own camera: the box is the bind pose.\n */\nexport function threeFrameCamera(camera: PerspectiveCamera | Camera, object: Object3D, options: ThreeFrameCameraOptions = {}): void {\n const cam = camera as PerspectiveCamera;\n object.updateMatrixWorld(true);\n const bounds = new Box3().setFromObject(object);\n const centre = bounds.getCenter(new Vector3());\n const margin = options.margin ?? 1.1;\n const [dx, dy, dz] = options.direction ?? [0.45, 0.3, 1];\n const toCamera = new Vector3(dx, dy, dz).normalize();\n const right = new Vector3().crossVectors(new Vector3(0, 1, 0), toCamera);\n if (right.lengthSq() < 1e-12) right.set(1, 0, 0); // straight above or below: any right will do\n right.normalize();\n const up = new Vector3().crossVectors(toCamera, right);\n const tanV = Math.tan((cam.fov * Math.PI) / 360), tanH = tanV * cam.aspect;\n let distance = 1e-3;\n for (const x of [bounds.min.x, bounds.max.x]) for (const y of [bounds.min.y, bounds.max.y]) for (const z of [bounds.min.z, bounds.max.z]) {\n const r = new Vector3(x, y, z).sub(centre);\n distance = Math.max(distance, r.dot(toCamera) + (Math.abs(r.dot(right)) * margin) / tanH, r.dot(toCamera) + (Math.abs(r.dot(up)) * margin) / tanV);\n }\n cam.position.copy(centre).addScaledVector(toCamera, distance);\n cam.near = Math.max(distance / 100, 1e-4);\n cam.far = distance * 100;\n cam.lookAt(centre);\n cam.updateProjectionMatrix();\n}\n","/**\n * pixi-effects/three — optional three.js integration.\n *\n * Import this entry only when you use `type: 'three'` sequences; the core\n * `pixi-effects` entry never touches three.js. Call `registerThree()` once\n * before Movie.init builds a composition containing a three sequence.\n */\nimport { registerSequenceType, type SequenceCtor } from '../core/Composition';\nimport { ThreeSequence } from './ThreeSequence';\nimport { checkRendererKind, setPageRenderer, type ThreeRendererKind } from './defaults';\nimport type { SequenceSpec } from '../types';\nimport type { ThreeSequenceSpec } from './types';\n\nexport { ThreeSequence } from './ThreeSequence';\nexport { threeGltf, threeFrameCamera } from './gltf';\nexport type { ThreeGltfModel, ThreeGltfOptions, ThreeFrameCameraOptions } from './gltf';\nexport type { ThreeContext, ThreeSetupResult, ThreeSequenceSpec } from './types';\nexport type { ThreeRendererKind } from './defaults';\n\n/**\n * Register the 'three' sequence type. Explicit call so `sideEffects: false` bundlers can't drop it; calling it again is fine.\n * `registerThree({ renderer: 'webgpu' })` makes every three layer that does not name a `renderer` of its own use three's WebGPU renderer; the default is `'webgl'`\n * (the last call wins).\n */\nexport function registerThree(options: { renderer?: ThreeRendererKind } = {}): void {\n const kind = options.renderer ?? 'webgl';\n checkRendererKind(kind, \"registerThree's renderer\");\n setPageRenderer(kind);\n registerSequenceType('three', ThreeSequence as unknown as SequenceCtor);\n}\n\n/**\n * Typing helper: accepts a strongly-typed three spec and returns it as a\n * core SequenceSpec, keeping three.js types out of the core union.\n */\nexport function three(spec: ThreeSequenceSpec): SequenceSpec {\n return spec as unknown as SequenceSpec;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/three/defaults.ts","../src/three/spaceBridge.ts","../src/three/budget.ts","../src/three/ThreeSequence.ts","../src/three/gltf.ts","../src/three/index.ts"],"names":["PerspectiveCamera","Box3","Vector3"],"mappings":";;;;;;;AAGA,IAAI,YAAA,GAAkC,OAAA;AAE/B,SAAS,iBAAA,CAAkB,MAAe,KAAA,EAAkD;AACjG,EAAA,IAAI,IAAA,KAAS,OAAA,IAAW,IAAA,KAAS,QAAA,QAAgB,IAAI,KAAA,CAAM,CAAA,cAAA,EAAiB,KAAK,CAAA,kCAAA,EAAqC,IAAA,CAAK,SAAA,CAAU,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA;AAC/I;AACO,SAAS,gBAAgB,IAAA,EAA+B;AAAE,EAAA,YAAA,GAAe,IAAA;AAAM;AAC/E,SAAS,eAAA,GAAqC;AAAE,EAAA,OAAO,YAAA;AAAc;ACI5E,IAAM,IAAA,GAAO,CAAA;AACb,IAAM,GAAA,GAAM,GAAA;AAGL,SAAS,gBAAA,CAAiB,MAAA,EAA2B,CAAA,EAAgB,MAAA,EAAsB;AAChG,EAAA,MAAA,CAAO,MAAM,CAAA,CAAE,GAAA;AACf,EAAA,MAAA,CAAO,MAAA,GAAS,MAAA;AAChB,EAA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AA,CAAI,CAAA,CAAE,GAAA,CAAI,KAAK,CAAC,CAAA,GAAI,MAAA,GAAU,IAAA,EAAM,CAAA,CAAE,GAAA,CAAI,QAAQ,CAAA,GAAK,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,GAAA,CAAI,EAAE,CAAC,CAAA,GAAI,MAAA,GAAU,IAAI,CAAA;AAAA,EACnJ;AACA,EAAA,GAAA,CAAI,SAAS,IAAA,CAAK,MAAM,CAAA,CAAE,eAAA,CAAgB,UAAU,QAAQ,CAAA;AAC5D,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,QAAA,GAAW,KAAK,IAAI,CAAA;AACxC,EAAA,GAAA,CAAI,MAAM,QAAA,GAAW,GAAA;AACrB,EAAA,GAAA,CAAI,OAAO,MAAM,CAAA;AACjB,EAAA,GAAA,CAAI,sBAAA,EAAuB;AAC7B;;;ACtGO,SAAS,aAAA,CAAc,OAAA,GAA4C,EAAC,EAAS;AAClF,EAAA,MAAM,IAAA,GAAO,QAAQ,QAAA,IAAY,OAAA;AACjC,EAAA,iBAAA,CAAkB,MAAM,0BAA0B,CAAA;AAClD,EAAA,eAAA,CAAgB,IAAI,CAAA;AACpB,EAAA,oBAAA,CAAqB,SAAS,aAAwC,CAAA;AACxE;AAMO,SAAS,MAAM,IAAA,EAAuC;AAC3D,EAAA,OAAO,IAAA;AACT","file":"three.js","sourcesContent":["/** The page-level default renderer of the three layers: `registerThree({ renderer })` sets it, a layer's own `renderer` wins. */\nexport type ThreeRendererKind = 'webgl' | 'webgpu';\n\nlet pageRenderer: ThreeRendererKind = 'webgl';\n\nexport function checkRendererKind(kind: unknown, where: string): asserts kind is ThreeRendererKind {\n if (kind !== 'webgl' && kind !== 'webgpu') throw new Error(`pixi-effects: ${where} must be 'webgl' or 'webgpu' (got ${JSON.stringify(kind)})`);\n}\nexport function setPageRenderer(kind: ThreeRendererKind): void { pageRenderer = kind; }\nexport function getPageRenderer(): ThreeRendererKind { return pageRenderer; }\n","/**\n * What lets a `three` layer live in the composition's space (`followCamera`, `followLights`): the composition's camera and lights, in three.\n *\n * The scene is in composition pixels with y flipped: a point the composition calls (x, y, z) is `new Vector3(x, -y, z)` here (the composition's y runs down, three's up;\n * +z is toward the viewer in both). A three camera with the composition camera's position, look-at point and vertical fov then projects that point to the pixel the\n * composition's own projection gives it (tests/three/spaceBridge.test.ts checks it to 1e-6 px).\n */\nimport { AmbientLight, Color, DirectionalLight, Fog, OrthographicCamera, PerspectiveCamera, PointLight, SRGBColorSpace, SpotLight, type Light, type Object3D, type Scene } from 'three';\nimport type { CameraState } from '../space/math';\nimport type { LightState } from '../space/lighting';\nimport type { FogState } from '../space/LitMaterial';\n\n/** The camera's near plane and far plane in composition pixels: the home camera sits about 740 px from the picture, a long dolly can be several thousand. */\nconst NEAR = 1;\nconst FAR = 20000;\n\n/** Put a three camera where the composition camera is. The aspect is the layer's (it must be the composition's: see `followCamera`). */\nexport function applyCameraState(camera: PerspectiveCamera, s: CameraState, aspect: number): void {\n camera.fov = s.fov;\n camera.aspect = aspect;\n camera.near = NEAR;\n camera.far = FAR;\n camera.up.set(0, 1, 0);\n camera.position.set(s.x, -s.y, s.z);\n const same = Math.hypot(s.lookAtX - s.x, s.lookAtY - s.y, s.lookAtZ - s.z) < 1e-9; // the composition then looks along -z\n camera.lookAt(same ? s.x : s.lookAtX, same ? -s.y : -s.lookAtY, same ? s.z - 1 : s.lookAtZ);\n camera.updateProjectionMatrix();\n camera.updateMatrixWorld();\n}\n\ninterface Entry { kind: LightState['kind']; light: Light; target: Object3D | null }\n\n/**\n * The composition's lights as three lights, one per light layer alive, in layer order. The objects are made once and moved every frame (a light that has ended is switched off,\n * not removed: the shader of a three layer must not be rebuilt as lights come and go).\n *\n * Intensity: three divides a diffuse surface by pi, so a light of intensity 1 is multiplied by pi to be \"as bright as the colour\" like a card's shading. Falloff: 'none' is no\n * attenuation; 'inverseSquare' is decay 2 with the intensity scaled so it is full at `radius` (it keeps rising inside it, where the composition's stays at 1); 'smooth' is three's\n * cut-off fitted to the composition's curve (see below). Shadows follow the light (castsShadows: the layer's own meshes cast and receive).\n */\nexport class LightMirror {\n private entries: Entry[] = [];\n /** True when a light alive casts shadows: the layer's renderer must have its shadow map on. */\n castsShadows = false;\n constructor(private readonly scene: Object3D, private readonly extent = 2000) {}\n\n update(lights: readonly LightState[]): void {\n this.castsShadows = lights.some((s) => s.castsShadows && s.kind !== 'ambient');\n lights.forEach((s, i) => {\n let e = this.entries[i];\n if (!e || e.kind !== s.kind) {\n if (e) this.remove(e);\n e = this.entries[i] = this.make(s.kind);\n }\n this.configure(e, s);\n });\n for (let i = lights.length; i < this.entries.length; i++) this.entries[i]!.light.visible = false;\n }\n\n dispose(): void {\n for (const e of this.entries) this.remove(e);\n this.entries = [];\n }\n\n private make(kind: LightState['kind']): Entry {\n const light: Light = kind === 'ambient' ? new AmbientLight() : kind === 'parallel' ? new DirectionalLight() : kind === 'spot' ? new SpotLight() : new PointLight();\n light.name = 'pixi-effects:composition-light';\n const target = (light as DirectionalLight | SpotLight).target ?? null;\n this.scene.add(light);\n if (target) this.scene.add(target);\n return { kind, light, target };\n }\n\n private remove(e: Entry): void {\n this.scene.remove(e.light);\n if (e.target) this.scene.remove(e.target);\n }\n\n private configure(e: Entry, s: LightState): void {\n const { light } = e;\n light.visible = true;\n light.color = (light.color ?? new Color()).setRGB(s.r, s.g, s.b, SRGBColorSpace);\n let intensity = s.intensity * Math.PI;\n if (s.kind !== 'ambient') {\n light.position.set(s.x, -s.y, s.z);\n e.target?.position.set(s.lookAtX, -s.lookAtY, s.lookAtZ);\n }\n if (s.kind === 'point' || s.kind === 'spot') {\n const l = light as PointLight | SpotLight;\n if (s.falloff === 'inverseSquare') { l.distance = 0; l.decay = 2; intensity *= s.radius * s.radius; }\n else if (s.falloff === 'smooth') {\n // The composition: 1 inside `radius`, a smoothstep down to 0 at radius + falloffDistance. three's cut-off distance D with decay 0 attenuates by saturate(1 - (d/D)^4)^2, a gentler curve that\n // starts to fall at once. A cut-off and a gain chosen from where the fall starts (p = radius / (radius + falloffDistance)) halve the largest difference over the range (0.15-0.40 with\n // D = radius + falloffDistance and no gain, 0.09-0.17 here for a fall that is not steep); a fall that is steep against its radius cannot be matched by three's curve.\n const reach = s.radius + Math.max(s.falloffDistance, 1e-3), p = s.radius / reach;\n l.distance = reach * (0.8 + 0.45 * p); l.decay = 0; intensity *= 0.87 + 0.45 * p;\n }\n else { l.distance = 0; l.decay = 0; }\n }\n if (s.kind === 'spot') {\n const l = light as SpotLight;\n l.angle = ((s.coneAngle / 2) * Math.PI) / 180;\n l.penumbra = s.coneFeather;\n }\n light.intensity = intensity;\n if (s.kind !== 'ambient') {\n const l = light as PointLight | SpotLight | DirectionalLight;\n l.castShadow = s.castsShadows;\n if (s.castsShadows) {\n l.shadow.mapSize.set(2048, 2048);\n l.shadow.intensity = s.shadowDarkness;\n l.shadow.radius = Math.max(1, s.shadowDiffusion / 4);\n // Scale-aware: three compares depths AFTER the perspective divide, so a bias of b is about b·d²/near world units at distance d from the light. A near plane of 1 px and a bias of\n // -0.0005 hid every caster within ~250 px of its receiver at 1280 x 720 (found by an AI trial). The near plane follows the size of the composition (~20 px at 1280 x 720) and the\n // bias is small, so the gap is about a pixel or two; normalBias (world units, along the surface normal) is a pixel or two too.\n l.shadow.bias = -0.00005;\n l.shadow.normalBias = this.extent / 1000;\n const cam = l.shadow.camera;\n cam.near = Math.max(1, this.extent / 128); cam.far = 20000;\n if (s.kind === 'parallel') { const o = cam as OrthographicCamera; o.left = -this.extent; o.right = this.extent; o.top = this.extent; o.bottom = -this.extent; }\n cam.updateProjectionMatrix();\n }\n }\n light.updateMatrixWorld?.();\n e.target?.updateMatrixWorld?.();\n }\n}\n\n/**\n * The composition camera's fog as the scene's `Fog`: the same colour, `near` and `far` (distances along the view, in composition pixels). three's Fog fades with `smoothstep` where the\n * composition's fades linearly, and has no amount below 1: close, not equal (see docs/dsl.md). The Fog is made when the camera has one and removed when it has not; a Fog the layer made\n * itself is never touched.\n */\nexport class FogMirror {\n private own: Fog | null = null;\n constructor(private readonly scene: Scene) {}\n\n update(fog: FogState | null): void {\n if (!fog) {\n if (this.own && this.scene.fog === this.own) this.scene.fog = null;\n this.own = null;\n return;\n }\n if (!this.own || this.scene.fog !== this.own) {\n if (this.scene.fog && this.scene.fog !== this.own) return; // the layer has its own fog: leave it\n this.own = new Fog(0x000000, fog.near, fog.far);\n this.scene.fog = this.own;\n }\n this.own.color.setRGB(fog.r, fog.g, fog.b, SRGBColorSpace);\n this.own.near = fog.near;\n this.own.far = fog.far;\n }\n\n dispose(): void { this.update(null); }\n}\n","/**\n * How many three layers a page can hold. Each `three` layer owns a renderer, and a browser keeps only so many live graphics contexts for a whole page: about 16 for WebGL, about 32 for\n * WebGPU (measured 2026-10-15 on Chrome: layers beyond it draw nothing, without an error). PixiJS and a `shader` layer use contexts of their own, so the warning comes a little before the\n * limit: more than 12 WebGL layers, more than 28 WebGPU layers.\n */\nexport type ThreeKind = 'webgl' | 'webgpu';\n\nconst WARN_ABOVE: Record<ThreeKind, number> = { webgl: 12, webgpu: 28 };\nconst LIMIT: Record<ThreeKind, string> = { webgl: 'about 16 WebGL contexts', webgpu: 'about 32 WebGPU contexts' };\nconst live: Record<ThreeKind, number> = { webgl: 0, webgpu: 0 };\nconst warned = new Set<ThreeKind>();\n\n/** A three layer made its renderer: count it, and say once per kind when the page holds too many. */\nexport function trackThree(kind: ThreeKind): void {\n live[kind]++;\n if (live[kind] > WARN_ABOVE[kind] && !warned.has(kind)) {\n warned.add(kind);\n console.warn(`pixi-effects: ${live[kind]} three layers are alive with renderer: '${kind}', and a browser keeps ${LIMIT[kind]} for the whole page; layers beyond that draw nothing, without an error. ` +\n `Put several objects in one three layer, destroy layers that are over, ` + (kind === 'webgl' ? `or use renderer: 'webgpu' for some (its limit is about 32)` : `or use renderer: 'webgl' for some of them (a different pool of contexts)`));\n }\n}\n\n/** A three layer let its renderer go. */\nexport function releaseThree(kind: ThreeKind): void {\n live[kind] = Math.max(0, live[kind] - 1);\n}\n\n/** What the page holds now, per renderer. */\nexport function threeBudget(): Record<ThreeKind, number> {\n return { ...live };\n}\n\n/** For tests: forget everything. */\nexport function resetThreeBudget(): void {\n live.webgl = live.webgpu = 0;\n warned.clear();\n}\n","import { Sprite, Texture } from 'pixi.js';\nimport { Box3, PerspectiveCamera, Plane, Quaternion, Raycaster, Scene, Vector2, Vector3, WebGLRenderer, type Camera, type Object3D } from 'three';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport { Sequence } from '../sequences/Base';\nimport { buildScope } from '../expr/Scope';\nimport { evaluateExpr } from '../expr/Parser';\nimport type { PathRouters } from '../core/Timeline';\nimport type { PropValue } from '../types';\nimport type { ThreeContext, ThreeSequenceSpec } from './types';\nimport { checkRendererKind, getPageRenderer } from './defaults';\nimport { applyCameraState, FogMirror, LightMirror } from './spaceBridge';\nimport { releaseThree, trackThree } from './budget';\nimport type { CanvasCheck } from '../sequences/Canvas';\n\n/** What makes a frame depend on more than the time (the same list as the canvas layer's). */\nconst NOT_PURE = /\\bMath\\s*\\.\\s*random\\s*\\(|\\bDate\\s*\\.\\s*now\\s*\\(|\\bperformance\\s*\\.\\s*now\\s*\\(|\\bnew\\s+Date\\s*\\(/;\n\nexport class ThreeSequence extends Sequence {\n private _renderer: WebGLRenderer | WebGPURenderer | null = null;\n /** The renderer this layer draws with (`'webgl'` or `'webgpu'`), once it is built. */\n renderer: 'webgl' | 'webgpu' | null = null;\n /** The backend under it: `'webgl'`, `'webgpu'`, or `'webgl2'` when three's WebGPURenderer found no WebGPU in this browser and used its own WebGL2 backend (the same picture). */\n backend: 'webgl' | 'webgpu' | 'webgl2' | null = null;\n private _gpu = false; // renderer: 'webgpu': async init and async render\n private _scene: Scene | null = null;\n private _camera: Camera | null = null;\n private _ctx: ThreeContext | null = null;\n private _objects: Record<string, object> = {};\n private _warnedUpdate = false;\n private _warnedNodeFrame = false;\n private _warnedPaths = new Set<string>();\n private _lightMirror: LightMirror | null = null;\n private _fogMirror: FogMirror | null = null;\n private _warnedSpace = new Set<string>();\n private _tracked = false;\n /** Set when this layer lets its renderer go on purpose: the context loss that follows is its own doing, not the browser's. */\n private _closing = false;\n\n private get _threeSpec(): ThreeSequenceSpec {\n return this.spec as unknown as ThreeSequenceSpec;\n }\n\n protected override pathRouters(): PathRouters {\n return { three: (path) => this._resolveThreePath(path) };\n }\n\n async build(): Promise<void> {\n const spec = this._threeSpec;\n if (this.duration === undefined) {\n this.duration = this.parent?.duration ?? this.root.duration;\n }\n if (typeof spec.update === 'function' && NOT_PURE.test(spec.update.toString())) {\n console.warn(`pixi-effects: three layer${spec.name ? ` \"${spec.name}\"` : ''}: update calls Math.random, Date.now, performance.now or new Date, so it is not deterministic: the same frame would draw differently in playback, in a seek and in an export. Derive the value from t`);\n }\n\n // Resolve layer size. Expressions see the usual scope; intrinsic w/h are\n // still 0 here (same chicken-and-egg as shapes), so W/H/GW/GH carry it.\n const scope = buildScope(this, this.parent, this.root) as unknown as Record<string, number>;\n const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;\n const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;\n const resolution = spec.resolution ?? 1;\n\n // Offscreen canvas — never attached to the DOM. document.createElement\n // (not OffscreenCanvas) so PIXI's Texture.from and three both accept it.\n const canvas = document.createElement('canvas');\n const antialias = spec.antialias ?? true;\n const kind = spec.renderer ?? getPageRenderer();\n checkRendererKind(kind, \"a three layer's renderer\");\n this._gpu = kind === 'webgpu';\n this.renderer = kind;\n let renderer: WebGLRenderer | WebGPURenderer;\n if (this._gpu) {\n let mod: typeof import('three/webgpu');\n try { mod = await import('three/webgpu'); } catch (err) {\n throw new Error(`pixi-effects: renderer: 'webgpu' needs three 0.17x or later with \"three/webgpu\" in the import map (${err instanceof Error ? err.message : err})`);\n }\n renderer = new mod.WebGPURenderer({ canvas, alpha: true, antialias });\n this._renderer = renderer;\n this._track();\n // The device is made here: nothing may render before. Where there is no WebGPU three uses its own WebGL2 backend and says so with a warning: that is not a problem\n // (it draws the same picture), so it becomes `backend: 'webgl2'` instead of a line in the author's console.\n const warn = console.warn;\n let noGpu = false;\n console.warn = (...args: unknown[]) => { if (/WebGPU is not available/.test(String(args[0]))) noGpu = true; else warn.apply(console, args as []); };\n try { await renderer.init(); }\n catch (err) { this._disposeRenderer(); throw err; }\n finally { console.warn = warn; }\n this.backend = noGpu ? 'webgl2' : 'webgpu';\n } else {\n renderer = new WebGLRenderer({ canvas, alpha: true, antialias });\n this._renderer = renderer;\n this._track();\n let said = false;\n canvas.addEventListener('webglcontextlost', () => { // the browser took the context away: the layer draws nothing from now on\n if (said || this._closing) return; // not the browser's doing: this layer is letting its context go\n said = true;\n console.warn(`pixi-effects: three layer${spec.name ? ` \"${spec.name}\"` : ''}: the browser took this layer's WebGL context away (a page keeps about 16 for all its layers, PixiJS and shader layers: too many were alive), so the layer draws nothing. Put several objects in one three layer, or destroy layers that are over`);\n });\n this.backend = 'webgl';\n }\n try {\n renderer.setSize(Math.round(width * resolution), Math.round(height * resolution), false);\n renderer.setClearColor(0x000000, 0);\n\n const scene = new Scene();\n const camera: Camera = new PerspectiveCamera(50, width / height, 0.1, 2000);\n const ctx: ThreeContext = { scene, camera, renderer, width, height };\n if (spec.followCamera) this._checkFollowShape(width, height, spec.name);\n\n let result: Awaited<ReturnType<ThreeSequenceSpec['setup']>>;\n try { result = await spec.setup(ctx); } catch (err) { throw this._gpu ? this._explainWebGpuError(err, spec.name) : err; }\n if (result?.camera) ctx.camera = result.camera;\n this._scene = scene;\n this._camera = ctx.camera;\n this._ctx = ctx;\n this._objects = { ...(result?.objects ?? {}) };\n if (!('camera' in this._objects)) this._objects.camera = this._camera;\n\n if (this._gpu) this._checkWebGpuMaterials(scene, spec.name);\n // Frame 0 so the texture is never blank before the first tick.\n this._draw(0);\n\n const texture = Texture.from(canvas);\n const sprite = new Sprite({ texture, label: spec.name });\n sprite.cullable = true;\n // Texture is canvas-sized (layer px × resolution); scale back to comp px.\n sprite.width = width;\n sprite.height = height;\n this.target = sprite;\n this.intrinsicWidth = width;\n this.intrinsicHeight = height;\n this.buildFilters();\n } catch (err) {\n this._disposeRenderer();\n throw err;\n }\n }\n\n /**\n * Per-frame sync hook. Movie._awaitVideoFrames duck-types on this method\n * (same contract as VideoSequence) and awaits it inside gotoFrame — the\n * single frame path shared by playback and export, which is what makes\n * three layers deterministic in both.\n */\n async awaitFrameAt(local: number): Promise<void> {\n if (!this._renderer || !this._scene || !this._camera || !this._ctx) return;\n const spec = this._threeSpec;\n const t = Math.max(0, Math.min(local, this.duration ?? local));\n this._followSpace(t);\n if (spec.update) {\n try {\n spec.update(t, this._ctx);\n } catch (err) {\n if (!this._warnedUpdate) {\n this._warnedUpdate = true;\n console.warn('pixi-effects: three update() threw (reported once) —', err);\n }\n }\n }\n this._draw(t);\n (this.target as Sprite | null)?.texture.source.update();\n }\n\n /**\n * `movie.pick`: a ray through the point (u, v) of the layer's picture (0..1, v down) from the layer's camera, and what it meets first: the object's name (its own, or its nearest\n * ancestor's that has one), where, and how far from the camera. Invisible objects and groups are not met. null when the ray meets nothing.\n */\n pickAt(u: number, v: number): { object: string; point: [number, number, number]; distance: number; object3d: Object3D } | null {\n const scene = this._scene, camera = this._camera;\n if (!scene || !camera) return null;\n scene.updateMatrixWorld();\n camera.updateMatrixWorld();\n const ray = new Raycaster();\n ray.setFromCamera(new Vector2(u * 2 - 1, -(v * 2 - 1)), camera);\n const visibleChain = (o: Object3D | null): boolean => { for (let n = o; n; n = n.parent) if (!n.visible) return false; return true; };\n for (const hit of ray.intersectObjects(scene.children, true)) {\n if (!visibleChain(hit.object)) continue;\n let name = '';\n for (let n: Object3D | null = hit.object; n && n !== scene; n = n.parent) if (n.name) { name = n.name; break; }\n return { object: name, point: hit.point.toArray() as [number, number, number], distance: hit.distance, object3d: hit.object };\n }\n return null;\n }\n\n /**\n * `hit.three.grab(plane)`: drag a grabbed point of the scene. Returns a function of a point (u, v) of the layer's picture (0..1, v down) that gives where the pointer's ray through the layer's\n * camera meets a plane through the grabbed point, and how far that is from the grabbed point (`delta`): move the object by it and it follows the pointer exactly. `plane`: `'screen'` (facing the\n * camera: the default), `'floor'` (horizontal, the three y up), `'wall'` (z constant), or a normal `[x, y, z]`. null where the ray never meets it (a floor seen edge-on, behind the camera).\n */\n dragPlane(point: [number, number, number], plane: 'screen' | 'floor' | 'wall' | [number, number, number] = 'screen'): (u: number, v: number) => { point: [number, number, number]; delta: [number, number, number] } | null {\n const grabbed = new Vector3(...point);\n let normal: Vector3;\n if (plane === 'floor') normal = new Vector3(0, 1, 0);\n else if (plane === 'wall') normal = new Vector3(0, 0, 1);\n else if (Array.isArray(plane)) normal = new Vector3(...plane).normalize();\n else {\n const turn = new Quaternion();\n this._camera?.updateMatrixWorld();\n this._camera?.getWorldQuaternion(turn);\n normal = new Vector3(0, 0, 1).applyQuaternion(turn); // the camera looks along -z: its back is the plane's normal\n }\n const surface = new Plane().setFromNormalAndCoplanarPoint(normal, grabbed);\n return (u, v) => {\n const scene = this._scene, camera = this._camera;\n if (!scene || !camera) return null;\n scene.updateMatrixWorld();\n camera.updateMatrixWorld();\n const ray = new Raycaster();\n ray.setFromCamera(new Vector2(u * 2 - 1, -(v * 2 - 1)), camera);\n const at = ray.ray.intersectPlane(surface, new Vector3());\n if (!at) return null;\n return { point: at.toArray() as [number, number, number], delta: at.clone().sub(grabbed).toArray() as [number, number, number] };\n };\n }\n\n /**\n * The determinism check (`check`, `movie.review()`): the scene drawn at a few moments in two orders, with one draw thrown away first, and the pictures compared, as the canvas layer\n * does. A layer whose same frame is not the same picture (a clock, `Math.random`, a mixer advanced with `update(dt)`, any state that builds up from call to call) is reported.\n * It runs the layer's own `update`, draws with its renderer and reads the picture from the renderer's canvas in the same task; the next real frame draws again, so nothing is left behind.\n */\n checkDeterminism(times: number[]): CanvasCheck {\n const none: CanvasCheck = { differs: [], drawMs: 0, threw: [] };\n const renderer = this._renderer, ctx = this._ctx;\n if (!renderer || !this._scene || !this._camera || !ctx) return none;\n const source = (renderer as unknown as { domElement: HTMLCanvasElement }).domElement;\n const w = source.width, h = source.height;\n const scratch = document.createElement('canvas');\n scratch.width = w; scratch.height = h;\n const g = scratch.getContext('2d', { willReadFrequently: true });\n if (!g) return none;\n const keep = w * h * 4 * times.length <= 96e6;\n const hash = (d: Uint8ClampedArray): number => { let x = 0x811c9dc5; for (let i = 0; i < d.length; i++) { x ^= d[i]!; x = Math.imul(x, 0x01000193); } return x >>> 0; };\n const ms: number[] = [];\n const threw = new Set<number>();\n const once = (t: number, timed: boolean): Uint8ClampedArray => {\n const from = performance.now();\n try {\n this._followSpace(t);\n this._threeSpec.update?.(t, ctx);\n this._draw(t);\n g.clearRect(0, 0, w, h);\n g.drawImage(source, 0, 0);\n } catch { threw.add(t); }\n if (timed) { g.getImageData(0, 0, 1, 1); ms.push(performance.now() - from); }\n return g.getImageData(0, 0, w, h).data;\n };\n for (const t of times) once(t, false); // the warm-up\n const first = times.map(t => { const d = once(t, true); return keep ? d.slice() : hash(d); });\n const second = [...times].reverse().map(t => once(t, false)).reverse();\n scratch.width = scratch.height = 1;\n const differs: CanvasCheck['differs'] = [];\n times.forEach((t, i) => {\n const a = first[i]!, b = second[i]!;\n if (typeof a === 'number') { if (a !== hash(b)) differs.push({ t, pixels: -1, maxDiff: -1 }); return; }\n let pixels = 0, maxDiff = 0;\n for (let k = 0; k < a.length; k++) { const d = Math.abs(a[k]! - b[k]!); if (d) { pixels++; if (d > maxDiff) maxDiff = d; } }\n if (pixels) differs.push({ t, pixels, maxDiff });\n });\n ms.sort((x, y) => x - y);\n return { differs: differs.filter(d => !threw.has(d.t)), drawMs: ms.length ? ms[Math.floor(ms.length / 2)]! : 0, threw: times.filter(t => threw.has(t)) };\n }\n\n /** `followCamera` / `followLights`: before each frame, ask the composition for its camera and lights at this moment (the layer's time on the composition's clock) and mirror them in the scene. */\n private _followSpace(t: number): void {\n const spec = this._threeSpec;\n if (!spec.followCamera && !spec.followLights && !spec.followFog) return;\n const ctx = this._ctx, scene = this._scene;\n if (!ctx || !scene) return;\n if (!this.parent?.spaceAt) {\n this._saidOnce('parent', `followCamera / followLights / followFog need the layer to sit in a composition that has a camera or a light to follow; this layer's parent cannot say (it keeps its own camera and lights)`, spec.name);\n return;\n }\n const space = this.parent.spaceAt((this.absoluteStart ?? this.at) + t);\n ctx.space = space;\n if (spec.followCamera) {\n const camera = ctx.camera as PerspectiveCamera;\n if (!camera.isPerspectiveCamera) this._saidOnce('camera', `followCamera needs a PerspectiveCamera (this layer's camera is a ${(ctx.camera as { type?: string }).type ?? 'different camera'}); it keeps it as it is`, spec.name);\n else applyCameraState(camera, space.camera, ctx.width / ctx.height);\n }\n if (spec.followLights) {\n const mirror = (this._lightMirror ??= new LightMirror(scene, Math.max(ctx.width, ctx.height) * 2));\n mirror.update(space.lights);\n if (!this._warnedSpace.has('inverseSquare')) this._checkInverseSquare(space.lights, scene, spec.name);\n if (mirror.castsShadows && !ctx.renderer.shadowMap.enabled) ctx.renderer.shadowMap.enabled = true;\n }\n if (spec.followFog) {\n if (space.fog && space.fog.amount !== 1) this._saidOnce('fogAmount', `followFog: the camera's fogAmount is ${space.fog.amount}, and three's Fog has no amount below 1: the layer uses the full amount (set fogColor to the colour you want at the far end, or leave followFog off and make the fog yourself from ctx.space.fog)`, spec.name);\n (this._fogMirror ??= new FogMirror(scene)).update(space.fog);\n }\n }\n\n /**\n * An inverse-square light is held at full strength inside its `radius` by the composition; three's decay-2 light keeps rising (4x at half the radius, 11x at a third). When the scene has\n * an object closer to such a light than 0.8 of its radius, say so once, with the way out. (The check is the scene's bounding box against the light's place: no object is measured.)\n */\n private _checkInverseSquare(lights: ReadonlyArray<{ kind: string; falloff: string; radius: number; x: number; y: number; z: number }>, scene: Scene, name: string | undefined): void {\n const near = lights.filter((l) => l.falloff === 'inverseSquare' && (l.kind === 'point' || l.kind === 'spot'));\n if (!near.length) return;\n const box = new Box3().setFromObject(scene);\n if (box.isEmpty()) return;\n for (const l of near) {\n const d = box.distanceToPoint(new Vector3(l.x, -l.y, l.z));\n if (d < 0.8 * l.radius) {\n this._saidOnce('inverseSquare', `followLights: a light with falloff 'inverseSquare' and radius ${l.radius} is only ${Math.round(d)} px from the nearest part of the scene. The composition holds such a light at full strength inside its radius; three's inverse-square light keeps rising there (${(Math.pow(l.radius / Math.max(d, 1), 2)).toFixed(1)}x at that distance), so those parts come out much brighter. Make the radius smaller than that distance, or use falloff 'smooth' (it is fitted to the composition's curve)`, name);\n return;\n }\n }\n }\n\n /** followCamera shows the whole composition through the layer's picture: a layer of another shape would show it squeezed or cut. Said once at build. */\n private _checkFollowShape(width: number, height: number, name: string | undefined): void {\n const p = this.parent;\n if (!p || !(p.width > 0 && p.height > 0)) return;\n if (Math.abs(width * p.height - height * p.width) <= 1e-3 * width * p.height) return;\n this._saidOnce('shape', `followCamera: the layer is ${width} x ${height} but the composition is ${p.width} x ${p.height}; the camera shows the whole composition, so the layer needs its aspect ratio (drop width / height to cover the composition)`, name);\n }\n\n private _saidOnce(key: string, message: string, name: string | undefined): void {\n if (this._warnedSpace.has(key)) return;\n this._warnedSpace.add(key);\n console.warn(`pixi-effects: three layer${name ? ` \"${name}\"` : ''}: ${message}`);\n }\n\n /**\n * One render of the scene at the layer-local time `t`. WebGPURenderer.render() needs `await init()` first (done in build); it queues the GPU work, and PixiJS reads the canvas after.\n *\n * Three's WebGPU node system updates the light uniforms (and its `time`) once per FRAME ID, and bumps that id in its own requestAnimationFrame loop only. Renders that\n * follow each other in one task (a seek, an export) would all show the lights of the last animation frame: a lamp keyframed with `three.lamp.intensity` would not move.\n * So before each render the layer advances the node frame itself, and gives `time` the layer's own time (not three's wall clock).\n */\n private _draw(t: number): void {\n if (!this._renderer || !this._scene || !this._camera) return;\n if (this._gpu) this._advanceNodeFrame(t);\n this._renderer.render(this._scene, this._camera);\n }\n\n /**\n * The author chose renderer: 'webgpu'. Three's WebGPU renderer turns materials into node materials: a ShaderMaterial / RawShaderMaterial cannot run there (three logs an error on\n * every render and draws a default material) and `onBeforeCompile` (a patch of the WebGL shader text) is ignored without a word. Stop, once, naming the first such material and the fix,\n * instead of drawing a picture that is wrong without saying so.\n */\n private _checkWebGpuMaterials(scene: Scene, layerName: string | undefined): void {\n const bad: string[] = [];\n const seen = new Set<unknown>();\n const check = (m: unknown): void => {\n if (!m || typeof m !== 'object' || seen.has(m)) return;\n seen.add(m);\n const mat = m as { type?: string; name?: string; isShaderMaterial?: boolean; isRawShaderMaterial?: boolean };\n const label = `${mat.name ? `\"${mat.name}\" ` : ''}${mat.type ?? 'material'}`;\n if (mat.isShaderMaterial || mat.isRawShaderMaterial) bad.push(`${label} is a ShaderMaterial (it cannot run on the WebGPU renderer)`);\n else if (Object.prototype.hasOwnProperty.call(mat, 'onBeforeCompile')) bad.push(`${label} sets onBeforeCompile (the WebGPU renderer ignores it)`);\n };\n scene.traverse?.((o: unknown) => {\n const mats = (o as { material?: unknown }).material;\n for (const m of Array.isArray(mats) ? mats : [mats]) check(m);\n });\n if (!bad.length) return;\n this._disposeRenderer();\n throw new Error(`pixi-effects: three layer${layerName ? ` \"${layerName}\"` : ''} with renderer: 'webgpu': ${bad[0]}${bad.length > 1 ? ` (and ${bad.length - 1} more)` : ''}. ` +\n `Add renderer: 'webgl' to this layer (or registerThree({ renderer: 'webgl' }) for the page), or write the look with three's node materials (TSL).`);\n }\n\n /** The one setup failure everybody meets on the WebGPU renderer: a PMREMGenerator imported from 'three' reads WebGL state the WebGPU renderer does not have. */\n private _explainWebGpuError(err: unknown, layerName: string | undefined): unknown {\n if (err instanceof TypeError && /reading 'buffers'|renderer\\.state/.test(err.message)) {\n return new Error(`pixi-effects: three layer${layerName ? ` \"${layerName}\"` : ''} with renderer: 'webgpu': setup used a WebGL-only helper, most likely a PMREMGenerator imported from 'three'. ` +\n `Import it from 'three/webgpu' (import * as THREE from 'three/webgpu'), or add renderer: 'webgl' to this layer.`, { cause: err });\n }\n return err;\n }\n\n private _advanceNodeFrame(t: number): void {\n const frame = (this._renderer as unknown as { _nodes?: { nodeFrame?: { update?: () => void; time: number; deltaTime: number } } })._nodes?.nodeFrame;\n if (!frame || typeof frame.update !== 'function') {\n if (!this._warnedNodeFrame) {\n this._warnedNodeFrame = true;\n console.warn(\"pixi-effects: this three has no node frame to advance (renderer: 'webgpu'): a light animated by keyframes may not follow the time in a seek or an export; use renderer: 'webgl' or report the three version\");\n }\n return;\n }\n frame.update();\n frame.time = t;\n frame.deltaTime = 1 / ((this.root as { frameRate?: number }).frameRate ?? 30);\n }\n\n private _resolveThreePath(path: string): { target: object; prop: string } | null {\n const segs = path.split('.');\n if (segs.length < 2) {\n this._warnPath(path, 'needs at least <object>.<prop>');\n return null;\n }\n let obj: unknown = this._objects[segs[0]!];\n if (obj == null) {\n this._warnPath(path, `unknown object \"${segs[0]}\" — expose it via setup's { objects }`);\n return null;\n }\n for (let i = 1; i < segs.length - 1; i++) {\n obj = (obj as Record<string, unknown>)[segs[i]!];\n if (obj == null) {\n this._warnPath(path, `\"${segs[i]}\" is undefined along the path`);\n return null;\n }\n }\n const prop = segs[segs.length - 1]!;\n if (typeof obj !== 'object' || !(prop in (obj as object))) {\n this._warnPath(path, `no property \"${prop}\"`);\n return null;\n }\n return { target: obj as object, prop };\n }\n\n private _warnPath(path: string, why: string): void {\n if (this._warnedPaths.has(path)) return;\n this._warnedPaths.add(path);\n console.warn(`pixi-effects: keyframe path three.${path} ${why}; skipped`);\n }\n\n /** Count this layer's renderer against the page's allowance of graphics contexts (given back when the renderer is disposed). */\n private _track(): void {\n this._tracked = true;\n trackThree(this._gpu ? 'webgpu' : 'webgl');\n }\n\n private _disposeRenderer(): void {\n if (!this._renderer) return;\n this._closing = true;\n if (this._tracked) { this._tracked = false; releaseThree(this._gpu ? 'webgpu' : 'webgl'); }\n try {\n this._renderer.dispose();\n if (!this._gpu) (this._renderer as WebGLRenderer).forceContextLoss();\n } catch (err) {\n console.warn('pixi-effects: three renderer dispose threw —', err);\n }\n this._renderer = null;\n }\n\n override destroy(): void {\n const spec = this._threeSpec;\n if (this._ctx && spec.dispose) {\n try { spec.dispose(this._ctx); } catch (err) {\n console.warn('pixi-effects: three dispose() threw —', err);\n }\n }\n const texture = (this.target as Sprite | null)?.texture;\n this._lightMirror?.dispose();\n this._lightMirror = null;\n this._fogMirror?.dispose();\n this._fogMirror = null;\n this._disposeRenderer();\n this._scene = null;\n this._camera = null;\n this._ctx = null;\n this._objects = {};\n super.destroy();\n texture?.destroy(true); // canvas-backed source is per-sequence; safe to kill\n }\n}\n\nfunction resolveDim(v: PropValue | undefined, scope: Record<string, number>): number | undefined {\n if (v === undefined) return undefined;\n if (typeof v === 'number') return v;\n return evaluateExpr(v, scope);\n}\n","/**\n * Two helpers for a glTF model in a `three` layer's `setup` / `update` (the layer stays the free box; these are what is easy to get wrong by hand):\n *\n * const fox = await threeGltf('Fox.glb', { animation: 'Run' }); // in setup\n * ctx.scene.add(fox.object); threeFrameCamera(ctx.camera, fox.object);\n * ... update: (t) => fox.pose(t) // the clip at the layer's time: a function of t, never of a clock\n *\n * The loader is an addon: a page that never calls `threeGltf` never loads it (the import map needs `\"three/addons/\"` next to `\"three\"`).\n */\nimport { AnimationMixer, Box3, Group, LoopOnce, LoopRepeat, Vector3, type AnimationClip, type Camera, type Object3D, type PerspectiveCamera } from 'three';\n\nexport interface ThreeGltfOptions {\n /** A clip name, a clip index, or `false` (no animation: the model's bind pose). Default: the first clip, if the file has one. */\n animation?: string | number | false;\n /** The clip time is `t × speed + offset` (the layer's seconds). Defaults 1 and 0. */\n speed?: number;\n offset?: number;\n /** `true` (default): the clip repeats; `false`: it holds its last pose. */\n loop?: boolean;\n}\n\nexport interface ThreeGltfModel {\n /** Add this to `ctx.scene`. A group whose origin is the centre of the model's bounding box (bind pose): position, turn and `fit` it about its centre. */\n object: Group;\n /** The names of the clips the file has. */\n clips: string[];\n /** The size of the model's bounding box in the file's own units (bind pose, before `fit`). */\n size: Vector3;\n /** Pose the model at the layer's time `t` (seconds). `AnimationMixer.setTime` evaluates the clip from zero every call: a seek, an export and a repeat give the same pose. */\n pose(t: number): void;\n /** Scale `object` so the model's longest side is `px` (a model in metres in a scene in composition pixels). */\n fit(px: number): void;\n /** Stop the clip. Geometries, materials and textures are yours to dispose with the scene. */\n dispose(): void;\n}\n\nexport async function threeGltf(url: string, options: ThreeGltfOptions = {}): Promise<ThreeGltfModel> {\n const label = 'pixi-effects: threeGltf';\n if (typeof url !== 'string' || !url) throw new Error(`${label}: the first argument is the URL of a .glb or .gltf file`);\n let GLTFLoader: typeof import('three/addons/loaders/GLTFLoader.js').GLTFLoader;\n try { ({ GLTFLoader } = await import('three/addons/loaders/GLTFLoader.js')); } catch (err) {\n throw new Error(`${label}: needs \"three/addons/\" in the import map next to \"three\" (${err instanceof Error ? err.message : err})`);\n }\n let gltf: Awaited<ReturnType<InstanceType<typeof GLTFLoader>['loadAsync']>>;\n try { gltf = await new GLTFLoader().loadAsync(url); } catch (err) {\n throw new Error(`${label}: could not load \"${url}\" (${err instanceof Error ? err.message : err})`, { cause: err });\n }\n\n const clips: AnimationClip[] = gltf.animations ?? [];\n let clip: AnimationClip | undefined;\n const wanted = options.animation;\n if (wanted === false || (wanted === undefined && clips.length === 0)) clip = undefined;\n else if (wanted === undefined) clip = clips[0];\n else {\n clip = typeof wanted === 'number' ? clips[wanted] : clips.find((c) => c.name === wanted);\n if (!clip) throw new Error(`${label}: \"${url}\" has no animation ${JSON.stringify(wanted)}; its clips: ${clips.length ? clips.map((c, i) => `${i}: \"${c.name}\"`).join(', ') : '(none)'}`);\n }\n\n // The origin of the group is the centre of the box, so the model is placed and turned about its centre.\n const root: Object3D = gltf.scene;\n // A skinned mesh is always drawn. three culls a mesh by a bounding sphere, and a skinned mesh's sphere does not follow its animation or its place: a model that MOVES and throws a shadow\n // drew its shadow differently depending on the frames drawn before it (found on the Khronos Fox: `check` reported the layer as not a function of the time; with culling off the\n // pictures are the same in any order). The cost is that an off-screen model is still drawn.\n root.traverse((o) => { if ((o as { isSkinnedMesh?: boolean }).isSkinnedMesh) o.frustumCulled = false; });\n const object = new Group();\n object.add(root);\n const bounds = new Box3().setFromObject(root);\n const centre = bounds.getCenter(new Vector3());\n const size = bounds.getSize(new Vector3());\n root.position.sub(centre);\n\n let mixer: AnimationMixer | null = null;\n if (clip) {\n mixer = new AnimationMixer(root);\n const action = mixer.clipAction(clip);\n action.setLoop(options.loop === false ? LoopOnce : LoopRepeat, Infinity);\n action.clampWhenFinished = true;\n action.play();\n }\n const speed = options.speed ?? 1, offset = options.offset ?? 0;\n\n return {\n object,\n clips: clips.map((c) => c.name),\n size,\n pose: (t) => { mixer?.setTime(t * speed + offset); },\n fit: (px) => { object.scale.setScalar(px / Math.max(size.x, size.y, size.z, 1e-9)); },\n dispose: () => { mixer?.stopAllAction(); mixer?.uncacheRoot(root); mixer = null; },\n };\n}\n\nexport interface ThreeFrameCameraOptions {\n /** The direction the camera sits in from the centre of the model, any length. Default `[0.45, 0.3, 1]`: a three-quarter view, a little from the side and above. */\n direction?: [number, number, number];\n /** Free room around the model: 1.1 (the default) leaves 10 %. */\n margin?: number;\n}\n\n/**\n * Put `camera` where the whole of `object` (its bounding box now, with its scale and place) fits the frame, looking at its centre: the smallest distance at which the 8 corners of\n * the box all fit both the vertical and the horizontal field of view (a bounding sphere would leave a long model small and head-on). `near` and `far` follow the distance.\n * Uses the camera's own `fov` and `aspect`. For a clip that travels far, give your own camera: the box is the bind pose.\n */\nexport function threeFrameCamera(camera: PerspectiveCamera | Camera, object: Object3D, options: ThreeFrameCameraOptions = {}): void {\n const cam = camera as PerspectiveCamera;\n object.updateMatrixWorld(true);\n const bounds = new Box3().setFromObject(object);\n const centre = bounds.getCenter(new Vector3());\n const margin = options.margin ?? 1.1;\n const [dx, dy, dz] = options.direction ?? [0.45, 0.3, 1];\n const toCamera = new Vector3(dx, dy, dz).normalize();\n const right = new Vector3().crossVectors(new Vector3(0, 1, 0), toCamera);\n if (right.lengthSq() < 1e-12) right.set(1, 0, 0); // straight above or below: any right will do\n right.normalize();\n const up = new Vector3().crossVectors(toCamera, right);\n const tanV = Math.tan((cam.fov * Math.PI) / 360), tanH = tanV * cam.aspect;\n let distance = 1e-3;\n for (const x of [bounds.min.x, bounds.max.x]) for (const y of [bounds.min.y, bounds.max.y]) for (const z of [bounds.min.z, bounds.max.z]) {\n const r = new Vector3(x, y, z).sub(centre);\n distance = Math.max(distance, r.dot(toCamera) + (Math.abs(r.dot(right)) * margin) / tanH, r.dot(toCamera) + (Math.abs(r.dot(up)) * margin) / tanV);\n }\n cam.position.copy(centre).addScaledVector(toCamera, distance);\n cam.near = Math.max(distance / 100, 1e-4);\n cam.far = distance * 100;\n cam.lookAt(centre);\n cam.updateProjectionMatrix();\n}\n","/**\n * pixi-effects/three — optional three.js integration.\n *\n * Import this entry only when you use `type: 'three'` sequences; the core\n * `pixi-effects` entry never touches three.js. Call `registerThree()` once\n * before Movie.init builds a composition containing a three sequence.\n */\nimport { registerSequenceType, type SequenceCtor } from '../core/Composition';\nimport { ThreeSequence } from './ThreeSequence';\nimport { checkRendererKind, setPageRenderer, type ThreeRendererKind } from './defaults';\nimport type { SequenceSpec } from '../types';\nimport type { ThreeSequenceSpec } from './types';\n\nexport { ThreeSequence } from './ThreeSequence';\nexport { threeGltf, threeFrameCamera } from './gltf';\nexport type { ThreeGltfModel, ThreeGltfOptions, ThreeFrameCameraOptions } from './gltf';\nexport type { ThreeContext, ThreeSetupResult, ThreeSequenceSpec } from './types';\nexport type { ThreeRendererKind } from './defaults';\n\n/**\n * Register the 'three' sequence type. Explicit call so `sideEffects: false` bundlers can't drop it; calling it again is fine.\n * `registerThree({ renderer: 'webgpu' })` makes every three layer that does not name a `renderer` of its own use three's WebGPU renderer; the default is `'webgl'`\n * (the last call wins).\n */\nexport function registerThree(options: { renderer?: ThreeRendererKind } = {}): void {\n const kind = options.renderer ?? 'webgl';\n checkRendererKind(kind, \"registerThree's renderer\");\n setPageRenderer(kind);\n registerSequenceType('three', ThreeSequence as unknown as SequenceCtor);\n}\n\n/**\n * Typing helper: accepts a strongly-typed three spec and returns it as a\n * core SequenceSpec, keeping three.js types out of the core union.\n */\nexport function three(spec: ThreeSequenceSpec): SequenceSpec {\n return spec as unknown as SequenceSpec;\n}\n"]}
|
package/docs/api.md
CHANGED
|
@@ -96,6 +96,7 @@ interface RebuildReport { reason: 'vars' | 'resize' | 'rebuild'; ms: number; aud
|
|
|
96
96
|
- The new composition is built while the old one goes on; at the swap the movie keeps doing what it is doing at that moment: the same frame, playing or paused (a `pause()`, a seek or a `play()` you made during the build is kept), the poster if it was shown. A playing movie whose sound is unchanged (`audio: 'reused'`) is not stopped at all: the frame clock and the sound go on and only the picture is swapped, so rebuilds in a row (a pointer) do not hold the playhead back. When the sound changed, the movie stops and plays on from the same frame with the new sound. A `playUntil()` in flight ends. The canvas changes size at the swap, not before. A `render()` or `peek()` in flight is not interrupted: the swap waits for it.
|
|
97
97
|
- The sound is mixed only when it changed: `audio: 'reused'` means the same mix as before (the mix is the slow part, 0.6 to 0.8 s for a film; the rest takes about 20 ms). A time remap (`warp` / `sourceMap`) turns the cache off.
|
|
98
98
|
- Calls that arrive during a rebuild are joined: at most one rebuild runs and one waits, with the latest values. Safe to call from `pointermove` or `scroll`: a rebuild that leaves the sound alone takes tens of milliseconds (11 to 42 ms on four gallery pieces), one that mixes the sound again 0.6 to 0.8 s, so a slider that changes the sound will lag behind the hand.
|
|
99
|
+
- A rebuild builds every layer again, a `three` layer included (its `setup` runs again: a model is loaded again, a renderer made again): fine for a click, slow for what changes while the pointer moves in a three scene. For that, keep the object's place in a variable of the page, read it in the layer's `update`, and call `await movie.redraw()` (recipe `drag-3d`).
|
|
99
100
|
- A rebuild that fails (a bad expression, a missing asset, a size that is not pixels) rejects, emits `error` with `where: 'rebuild'`, and the movie goes on with what it had. A `destroy()` during a rebuild ends it the same way.
|
|
100
101
|
- To follow a window: observe a CSS-sized box around the canvas, not the canvas itself (the movie sets the canvas's pixel size): `new ResizeObserver(() => movie.resize(Math.round(box.clientWidth * devicePixelRatio), Math.round(box.clientHeight * devicePixelRatio))).observe(box)` (the `liquid-layout` recipe).
|
|
101
102
|
|
|
@@ -175,12 +176,31 @@ interface PickHit {
|
|
|
175
176
|
kind: 'flat' | 'card' | 'three'; // a 2D layer, a threeD layer (its projected card), a three layer
|
|
176
177
|
point: { x: number; y: number }; // the point asked about
|
|
177
178
|
local?: { x: number; y: number }; // a flat layer: the point in the layer's own pixels
|
|
178
|
-
three?: { object: string; point: [number, number, number]; distance: number; object3d: unknown
|
|
179
|
+
three?: { object: string; point: [number, number, number]; distance: number; object3d: unknown; // a three layer: what the ray met first
|
|
180
|
+
grab?: (plane?) => { move: (x, y) => { point, delta } | null } }; // drag it: see below
|
|
179
181
|
}
|
|
180
|
-
// options: { only?: string[], ignore?: string[] } layer names or paths
|
|
182
|
+
// options: { only?: string[], ignore?: string[], alpha?: number } layer names or paths; alpha: see below
|
|
181
183
|
```
|
|
182
184
|
|
|
183
|
-
|
|
185
|
+
A `three` layer covers its whole picture, but only what its ray meets is a hit: elsewhere the layers below are hit (a title, the background). `only` / `ignore` entries are layer names or paths, and a group's name (a nested composition) stands for everything in it: a card and its label are one target as `only: ['card']`.
|
|
186
|
+
|
|
187
|
+
How a layer is asked: a flat layer by its own shape (a rotated one by its rotated rectangle, a shape by its outline: a circle is hit inside the circle, not at the corners of its box), text, images and video by their box; a `threeD` layer by its projected quad (the card seen from behind is hit too; a `threeD` composition is one card: what is inside it is not asked); a `three` layer by a ray through its camera (with `followCamera` the composition's camera), skipping invisible objects: `hit.three.object` is the name of the object it met (its own, or its nearest ancestor's that has one) and `object3d` the live three object. A layer not alive at the frame, at alpha 0, hidden by a parent, or outside its mask is not hit; a group (a nested composition without `threeD`) is not a target, the layers in it are. **`{ alpha }` looks at the picture, not the box**: `movie.pick(x, y, { alpha: 0.1 })` leaves out a pixel of an image, a video or a `canvas` layer whose alpha is at or below 0.1 (a transparent corner of a logo, the clear part of a circle drawn on a canvas); without it the box is the picture and nothing is read. Shapes are always hit by their outline, text and `shader` layers by their box (a shader's WebGL picture cannot be read back safely). A picture that cannot be read (an image from another origin: load it with `crossorigin="anonymous"` or from the same site) stays a hit, with one warning. What is not here: touch with several fingers.
|
|
188
|
+
|
|
189
|
+
**Dragging an object of a `three` layer**: `hit.three.grab(plane)` fixes a plane through the point that was taken (`'screen'` facing the camera, the default; `'floor'` horizontal; `'wall'` with z constant; or a normal `[x, y, z]`), and `grab.move(x, y)` takes the pointer in canvas pixels and gives where its ray meets that plane (`point`) and how far that is from the point taken (`delta`; `null` where the ray never meets the plane: a floor seen edge-on). Move the object by `delta`, from where it was when it was taken, and it follows the pointer exactly. The ray is the layer's own camera's (with `followCamera`, the composition's). The layer's `update` should read where the object is from the page's own state, and the page calls `await movie.redraw()` to draw the frame again while the movie is paused (recipe `drag-3d`).
|
|
190
|
+
|
|
191
|
+
### `movie.redraw(): Promise<void>`
|
|
192
|
+
|
|
193
|
+
Draws the frame on screen again, quietly (no `seeking` / `seeked`). For a paused movie when something outside it that a layer reads has changed, such as a `three` layer whose `update` reads the page's own state. A playing movie needs no call: the next frame draws it.
|
|
194
|
+
|
|
195
|
+
Hover is `movie.hover` (below); drag and drop of a flat layer is the recipe `drag-drop`.
|
|
196
|
+
|
|
197
|
+
### `movie.hover(options?): () => void`
|
|
198
|
+
|
|
199
|
+
Which layer the pointer is over, as two callbacks, built on `pick`: `onEnter(hit)` when the layer under the pointer (or, in a `three` layer, the object: `hit.three.object`) changes to another, `onLeave(hit)` for the one it left, also when the pointer leaves the picture or the returned function is called. While the pointer rests inside the picture it is asked again on every frame, so a picture that moves under a still pointer is followed (the runner leaves, the cursor changes) with no pointer event in between. Options: `only` / `ignore` as for `pick`, `cursor` (`true` is `'pointer'`, or any CSS cursor: shown while something is hovered, put back otherwise). Returns the function that stops it. Pointer events cover a mouse, a pen and a finger (a touch is "entered" when it lands and "left" when it lifts). It is a page-side tool: an exported video has no pointer. A handler that throws is said once and does not stop the next hover.
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
const stop = movie.hover({ ignore: ['background'], cursor: true, onEnter: (hit) => glow(hit.name), onLeave: (hit) => unglow(hit.name) });
|
|
203
|
+
```
|
|
184
204
|
|
|
185
205
|
### `movie.inspectAudio(options?): AudioReport`
|
|
186
206
|
|