agentvfx 0.0.0-stage → 0.3.4
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/AGENTS.md +8 -0
- package/GEMINI.md +1 -0
- package/LICENSE +172 -0
- package/README.md +236 -2
- package/package.json +35 -4
- package/skills/agentvfx/LICENSE +172 -0
- package/skills/agentvfx/NOTICE +44 -0
- package/skills/agentvfx/SKILL.md +90 -0
- package/skills/agentvfx/engine/core/constants.mjs +84 -0
- package/skills/agentvfx/engine/core/flash-constants.mjs +23 -0
- package/skills/agentvfx/engine/core/flash.mjs +240 -0
- package/skills/agentvfx/engine/core/mark.mjs +28 -0
- package/skills/agentvfx/engine/core/palettes.mjs +36 -0
- package/skills/agentvfx/engine/core/schedule.mjs +85 -0
- package/skills/agentvfx/engine/core/templates.mjs +43 -0
- package/skills/agentvfx/engine/core/util.mjs +167 -0
- package/skills/agentvfx/engine/core/validate.mjs +334 -0
- package/skills/agentvfx/engine/node/analysis.mjs +172 -0
- package/skills/agentvfx/engine/node/audio.mjs +621 -0
- package/skills/agentvfx/engine/node/board.mjs +24 -0
- package/skills/agentvfx/engine/node/chrome.mjs +349 -0
- package/skills/agentvfx/engine/node/encode.mjs +110 -0
- package/skills/agentvfx/engine/node/eye.mjs +77 -0
- package/skills/agentvfx/engine/node/footage.mjs +129 -0
- package/skills/agentvfx/engine/node/frame-worker.mjs +39 -0
- package/skills/agentvfx/engine/node/host.mjs +31 -0
- package/skills/agentvfx/engine/node/job.mjs +181 -0
- package/skills/agentvfx/engine/node/png.mjs +112 -0
- package/skills/agentvfx/engine/node/render.mjs +161 -0
- package/skills/agentvfx/engine/node/stage-capture.mjs +187 -0
- package/skills/agentvfx/engine/node/stage-serve.mjs +72 -0
- package/skills/agentvfx/engine/node/stills.mjs +100 -0
- package/skills/agentvfx/engine/node/ws-server.mjs +132 -0
- package/skills/agentvfx/engine/web/gl.mjs +319 -0
- package/skills/agentvfx/engine/web/glsl-common.mjs +78 -0
- package/skills/agentvfx/engine/web/init.js +23 -0
- package/skills/agentvfx/engine/web/prelude.mjs +150 -0
- package/skills/agentvfx/engine/web/render.html +11 -0
- package/skills/agentvfx/engine/web/render.mjs +388 -0
- package/skills/agentvfx/engine/web/scale.mjs +15 -0
- package/skills/agentvfx/engine/web/text.mjs +158 -0
- package/skills/agentvfx/plates/terminalcore/README.md +61 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/crt.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/font.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/gallery.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/gallery_mats.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/gallery_room.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/materials.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/nodekit.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/room.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/shots.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/textures.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/__pycache__/wall.cpython-313.pyc +0 -0
- package/skills/agentvfx/plates/terminalcore/crt.py +143 -0
- package/skills/agentvfx/plates/terminalcore/font.py +80 -0
- package/skills/agentvfx/plates/terminalcore/gallery.py +61 -0
- package/skills/agentvfx/plates/terminalcore/gallery_mats.py +144 -0
- package/skills/agentvfx/plates/terminalcore/gallery_room.py +126 -0
- package/skills/agentvfx/plates/terminalcore/materials.py +170 -0
- package/skills/agentvfx/plates/terminalcore/nodekit.py +87 -0
- package/skills/agentvfx/plates/terminalcore/room.py +82 -0
- package/skills/agentvfx/plates/terminalcore/scene.py +219 -0
- package/skills/agentvfx/plates/terminalcore/shots.py +48 -0
- package/skills/agentvfx/plates/terminalcore/textures.py +79 -0
- package/skills/agentvfx/plates/terminalcore/wall.py +103 -0
- package/skills/agentvfx/references/plates.md +22 -0
- package/skills/agentvfx/references/template-format.md +149 -0
- package/skills/agentvfx/references/web.md +63 -0
- package/skills/agentvfx/runtime/agentvfx.js +708 -0
- package/skills/agentvfx/schemas/fx-score.schema.json +98 -0
- package/skills/agentvfx/scripts/export-web.mjs +155 -0
- package/skills/agentvfx/scripts/loop.mjs +129 -0
- package/skills/agentvfx/scripts/make-beat.mjs +133 -0
- package/skills/agentvfx/scripts/plate.mjs +82 -0
- package/skills/agentvfx/scripts/vfx.mjs +173 -0
- package/skills/agentvfx/templates/_test/feedback-counter/fx.json +11 -0
- package/skills/agentvfx/templates/_test/feedback-counter/main.frag +4 -0
- package/skills/agentvfx/templates/_test/feedback-counter/pass0.frag +4 -0
- package/skills/agentvfx/templates/_test/gradient/fx.json +23 -0
- package/skills/agentvfx/templates/_test/gradient/main.frag +5 -0
- package/skills/agentvfx/templates/_test/identity/fx.json +10 -0
- package/skills/agentvfx/templates/_test/identity/main.frag +4 -0
- package/skills/agentvfx/templates/_test/strobe/fx.json +14 -0
- package/skills/agentvfx/templates/_test/strobe/main.frag +6 -0
- package/skills/agentvfx/templates/_test/text-probe/fx.json +15 -0
- package/skills/agentvfx/templates/_test/text-probe/main.frag +6 -0
- package/skills/agentvfx/templates/brutal/NOTES.md +14 -0
- package/skills/agentvfx/templates/brutal/_src/boot-log/def.mjs +57 -0
- package/skills/agentvfx/templates/brutal/_src/boot-log/main.src.frag +129 -0
- package/skills/agentvfx/templates/brutal/_src/build.mjs +33 -0
- package/skills/agentvfx/templates/brutal/_src/halftone-field/def.mjs +72 -0
- package/skills/agentvfx/templates/brutal/_src/halftone-field/main.src.frag +94 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-left.src.glsl +100 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-right.src.glsl +61 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-tiles.src.glsl +153 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/def.mjs +82 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/main.src.frag +110 -0
- package/skills/agentvfx/templates/brutal/_src/hud-deck/pass0.src.frag +38 -0
- package/skills/agentvfx/templates/brutal/_src/shared/defs.mjs +28 -0
- package/skills/agentvfx/templates/brutal/_src/shared/icons.glsl +72 -0
- package/skills/agentvfx/templates/brutal/_src/shared/lib.glsl +115 -0
- package/skills/agentvfx/templates/brutal/_src/shared/screen.glsl +43 -0
- package/skills/agentvfx/templates/brutal/boot-log/demo-acid.json +1 -0
- package/skills/agentvfx/templates/brutal/boot-log/demo-phosphor.json +1 -0
- package/skills/agentvfx/templates/brutal/boot-log/demo-ultramarine.json +1 -0
- package/skills/agentvfx/templates/brutal/boot-log/fx.json +257 -0
- package/skills/agentvfx/templates/brutal/boot-log/main.frag +242 -0
- package/skills/agentvfx/templates/brutal/collage/_src/00-lib.glsl +73 -0
- package/skills/agentvfx/templates/brutal/collage/_src/10-spectrum-scope.glsl +73 -0
- package/skills/agentvfx/templates/brutal/collage/_src/20-meter-readout-cross.glsl +87 -0
- package/skills/agentvfx/templates/brutal/collage/_src/30-footage-fillers.glsl +92 -0
- package/skills/agentvfx/templates/brutal/collage/_src/40-editorial.glsl +232 -0
- package/skills/agentvfx/templates/brutal/collage/_src/50-typefx.glsl +163 -0
- package/skills/agentvfx/templates/brutal/collage/_src/60-scene-lib.glsl +104 -0
- package/skills/agentvfx/templates/brutal/collage/_src/61-scene-specimen.glsl +71 -0
- package/skills/agentvfx/templates/brutal/collage/_src/62-scene-wiring.glsl +96 -0
- package/skills/agentvfx/templates/brutal/collage/_src/63-scene-fieldcut.glsl +119 -0
- package/skills/agentvfx/templates/brutal/collage/_src/64-scene-pattern.glsl +64 -0
- package/skills/agentvfx/templates/brutal/collage/_src/641-scene-anatomy.glsl +49 -0
- package/skills/agentvfx/templates/brutal/collage/_src/642-scene-deck.glsl +78 -0
- package/skills/agentvfx/templates/brutal/collage/_src/643-scene-bootlog.glsl +60 -0
- package/skills/agentvfx/templates/brutal/collage/_src/644-scene-tunnel.glsl +48 -0
- package/skills/agentvfx/templates/brutal/collage/_src/645-scene-runner.glsl +42 -0
- package/skills/agentvfx/templates/brutal/collage/_src/646-scene-ascii.glsl +66 -0
- package/skills/agentvfx/templates/brutal/collage/_src/647-scene-cubewall.glsl +80 -0
- package/skills/agentvfx/templates/brutal/collage/_src/648-scene-vortex.glsl +46 -0
- package/skills/agentvfx/templates/brutal/collage/_src/649-scene-sticker.glsl +72 -0
- package/skills/agentvfx/templates/brutal/collage/_src/65-scene-main.glsl +1 -0
- package/skills/agentvfx/templates/brutal/collage/_src/650-scene-ribbon.glsl +55 -0
- package/skills/agentvfx/templates/brutal/collage/_src/651-scene-slab.glsl +38 -0
- package/skills/agentvfx/templates/brutal/collage/_src/652-scene-framedial.glsl +79 -0
- package/skills/agentvfx/templates/brutal/collage/_src/653-scene-tilt.glsl +40 -0
- package/skills/agentvfx/templates/brutal/collage/_src/654-scene-marquee.glsl +45 -0
- package/skills/agentvfx/templates/brutal/collage/_src/655-scene-lens.glsl +57 -0
- package/skills/agentvfx/templates/brutal/collage/_src/656-scene-liquid.glsl +35 -0
- package/skills/agentvfx/templates/brutal/collage/_src/657-scene-panelgrid.glsl +75 -0
- package/skills/agentvfx/templates/brutal/collage/_src/658-scene-mirror.glsl +49 -0
- package/skills/agentvfx/templates/brutal/collage/_src/66-scene-main.glsl +27 -0
- package/skills/agentvfx/templates/brutal/collage/_src/90-main.glsl +120 -0
- package/skills/agentvfx/templates/brutal/collage/_src/build.mjs +24 -0
- package/skills/agentvfx/templates/brutal/collage/_src/sync-presets.mjs +16 -0
- package/skills/agentvfx/templates/brutal/collage/demo-bone-lime.json +1 -0
- package/skills/agentvfx/templates/brutal/collage/demo-lime-sparse.json +1 -0
- package/skills/agentvfx/templates/brutal/collage/demo-orange-dense.json +1 -0
- package/skills/agentvfx/templates/brutal/collage/demo-ultra-slow.json +1 -0
- package/skills/agentvfx/templates/brutal/collage/fx.json +4882 -0
- package/skills/agentvfx/templates/brutal/collage/layout.mjs +97 -0
- package/skills/agentvfx/templates/brutal/collage/layouts.json +366 -0
- package/skills/agentvfx/templates/brutal/collage/main.frag +2367 -0
- package/skills/agentvfx/templates/brutal/collage/pass0.frag +265 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-acid.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-ascii.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-dither.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-orange.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-phosphor.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/demo-ultramarine.json +1 -0
- package/skills/agentvfx/templates/brutal/halftone-field/fx.json +474 -0
- package/skills/agentvfx/templates/brutal/halftone-field/main.frag +248 -0
- package/skills/agentvfx/templates/brutal/hud-deck/demo-acid.json +1 -0
- package/skills/agentvfx/templates/brutal/hud-deck/demo-night.json +1 -0
- package/skills/agentvfx/templates/brutal/hud-deck/demo-octagon.json +1 -0
- package/skills/agentvfx/templates/brutal/hud-deck/demo-ultramarine.json +1 -0
- package/skills/agentvfx/templates/brutal/hud-deck/fx.json +601 -0
- package/skills/agentvfx/templates/brutal/hud-deck/main.frag +645 -0
- package/skills/agentvfx/templates/brutal/hud-deck/pass0.frag +38 -0
- package/skills/agentvfx/templates/brutal/lattice/demo-cobalt-fine.json +1 -0
- package/skills/agentvfx/templates/brutal/lattice/demo-ink-yellow.json +1 -0
- package/skills/agentvfx/templates/brutal/lattice/demo-vermilion.json +1 -0
- package/skills/agentvfx/templates/brutal/lattice/demo-violet-slow.json +1 -0
- package/skills/agentvfx/templates/brutal/lattice/fx.json +130 -0
- package/skills/agentvfx/templates/brutal/lattice/main.frag +175 -0
- package/skills/agentvfx/templates/brutal/lattice/pass0.frag +29 -0
- package/skills/agentvfx/templates/glitch/block-glitch/demo-mosaic.json +1 -0
- package/skills/agentvfx/templates/glitch/block-glitch/demo-onset.json +1 -0
- package/skills/agentvfx/templates/glitch/block-glitch/demo-static.json +1 -0
- package/skills/agentvfx/templates/glitch/block-glitch/demo-tear.json +1 -0
- package/skills/agentvfx/templates/glitch/block-glitch/fx.json +54 -0
- package/skills/agentvfx/templates/glitch/block-glitch/main.frag +132 -0
- package/skills/agentvfx/templates/glitch/block-glitch/pass0.frag +12 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/NOTES.md +13 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/build-passes.mjs +162 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/demo-chunk.json +1 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/demo-hue.json +1 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/demo-kick.json +1 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/demo-streak.json +1 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/demo-vertical.json +1 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/fx.json +60 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/main.frag +83 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass0.frag +64 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass1.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass2.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass3.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass4.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass5.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass6.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass7.frag +66 -0
- package/skills/agentvfx/templates/glitch/pixel-sort/pass8.frag +66 -0
- package/skills/agentvfx/templates/glitch/rgb-split/demo-diagonal-stutter.json +1 -0
- package/skills/agentvfx/templates/glitch/rgb-split/demo-hard.json +1 -0
- package/skills/agentvfx/templates/glitch/rgb-split/demo-kick.json +1 -0
- package/skills/agentvfx/templates/glitch/rgb-split/demo-radial.json +1 -0
- package/skills/agentvfx/templates/glitch/rgb-split/fx.json +46 -0
- package/skills/agentvfx/templates/glitch/rgb-split/main.frag +76 -0
- package/skills/agentvfx/templates/glitch/vhs/demo-clean.json +1 -0
- package/skills/agentvfx/templates/glitch/vhs/demo-crash.json +1 -0
- package/skills/agentvfx/templates/glitch/vhs/demo-tape.json +1 -0
- package/skills/agentvfx/templates/glitch/vhs/demo-worn.json +1 -0
- package/skills/agentvfx/templates/glitch/vhs/fx.json +46 -0
- package/skills/agentvfx/templates/glitch/vhs/main.frag +96 -0
- package/skills/agentvfx/templates/impact/impact-1bit/demo-onebit-bayer.json +1 -0
- package/skills/agentvfx/templates/impact/impact-1bit/fx.json +45 -0
- package/skills/agentvfx/templates/impact/impact-1bit/main.frag +64 -0
- package/skills/agentvfx/templates/impact/impact-invert/demo-invert-snap.json +1 -0
- package/skills/agentvfx/templates/impact/impact-invert/fx.json +37 -0
- package/skills/agentvfx/templates/impact/impact-invert/main.frag +44 -0
- package/skills/agentvfx/templates/impact/punch-shake/demo-punch-hard.json +1 -0
- package/skills/agentvfx/templates/impact/punch-shake/fx.json +36 -0
- package/skills/agentvfx/templates/impact/punch-shake/main.frag +62 -0
- package/skills/agentvfx/templates/impact/rgb-hit/demo-rgb-slam.json +1 -0
- package/skills/agentvfx/templates/impact/rgb-hit/fx.json +39 -0
- package/skills/agentvfx/templates/impact/rgb-hit/main.frag +62 -0
- package/skills/agentvfx/templates/impact/signal-cut/demo-lime-hold.json +1 -0
- package/skills/agentvfx/templates/impact/signal-cut/demo-lime.json +1 -0
- package/skills/agentvfx/templates/impact/signal-cut/demo-orange.json +1 -0
- package/skills/agentvfx/templates/impact/signal-cut/demo-ultramarine.json +1 -0
- package/skills/agentvfx/templates/impact/signal-cut/fx.json +83 -0
- package/skills/agentvfx/templates/impact/signal-cut/main.frag +101 -0
- package/skills/agentvfx/templates/impact/signal-cut/pass0.frag +68 -0
- package/skills/agentvfx/templates/impact/speedline-burst/demo-speed-white.json +1 -0
- package/skills/agentvfx/templates/impact/speedline-burst/fx.json +44 -0
- package/skills/agentvfx/templates/impact/speedline-burst/main.frag +68 -0
- package/skills/agentvfx/templates/impact/strobe-burst/demo-strobe-white-16.json +1 -0
- package/skills/agentvfx/templates/impact/strobe-burst/fx.json +42 -0
- package/skills/agentvfx/templates/impact/strobe-burst/main.frag +43 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/demo-anamorphic-cinema.json +10 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/demo-data.json +10 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/fx.json +47 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/main.frag +45 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/pass0.frag +22 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/pass1.frag +16 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/pass2.frag +16 -0
- package/skills/agentvfx/templates/light/anamorphic-streak/pass3.frag +16 -0
- package/skills/agentvfx/templates/light/bloom-glow/demo-clip01-low.json +11 -0
- package/skills/agentvfx/templates/light/bloom-glow/demo-neon-night.json +10 -0
- package/skills/agentvfx/templates/light/bloom-glow/demo-phosphor.json +11 -0
- package/skills/agentvfx/templates/light/bloom-glow/fx.json +53 -0
- package/skills/agentvfx/templates/light/bloom-glow/main.frag +85 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass0.frag +21 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass1.frag +50 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass2.frag +44 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass3.frag +32 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass4.frag +48 -0
- package/skills/agentvfx/templates/light/bloom-glow/pass5.frag +46 -0
- package/skills/agentvfx/templates/light/god-rays/demo-golden-hour.json +10 -0
- package/skills/agentvfx/templates/light/god-rays/demo-point-lamp.json +10 -0
- package/skills/agentvfx/templates/light/god-rays/fx.json +39 -0
- package/skills/agentvfx/templates/light/god-rays/main.frag +54 -0
- package/skills/agentvfx/templates/light/lens-flare/demo-clip01-bar.json +11 -0
- package/skills/agentvfx/templates/light/lens-flare/demo-eye-bar.json +10 -0
- package/skills/agentvfx/templates/light/lens-flare/demo-sun-ghosts.json +10 -0
- package/skills/agentvfx/templates/light/lens-flare/fx.json +49 -0
- package/skills/agentvfx/templates/light/lens-flare/main.frag +86 -0
- package/skills/agentvfx/templates/light/lens-flare/pass0.frag +24 -0
- package/skills/agentvfx/templates/light/light-leak/demo-slit.json +10 -0
- package/skills/agentvfx/templates/light/light-leak/demo-vintage-burn.json +10 -0
- package/skills/agentvfx/templates/light/light-leak/fx.json +40 -0
- package/skills/agentvfx/templates/light/light-leak/main.frag +46 -0
- package/skills/agentvfx/templates/light/light-stage/fx.json +29 -0
- package/skills/agentvfx/templates/light/light-stage/main.frag +56 -0
- package/skills/agentvfx/templates/light/light-sweep/demo-hard-bar.json +12 -0
- package/skills/agentvfx/templates/light/light-sweep/demo-logo-sweep.json +10 -0
- package/skills/agentvfx/templates/light/light-sweep/demo-onset.json +11 -0
- package/skills/agentvfx/templates/light/light-sweep/fx.json +45 -0
- package/skills/agentvfx/templates/light/light-sweep/main.frag +29 -0
- package/skills/agentvfx/templates/light/light-sweep/pass0.frag +17 -0
- package/skills/agentvfx/templates/light/light-sweep/pass1.frag +15 -0
- package/skills/agentvfx/templates/light/neon-saber/demo-hairline.json +10 -0
- package/skills/agentvfx/templates/light/neon-saber/demo-saber-laser.json +10 -0
- package/skills/agentvfx/templates/light/neon-saber/fx.json +48 -0
- package/skills/agentvfx/templates/light/neon-saber/main.frag +27 -0
- package/skills/agentvfx/templates/light/neon-saber/pass0.frag +46 -0
- package/skills/agentvfx/templates/light/neon-saber/pass1.frag +15 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/demo-trail.json +1 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/fx.json +38 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/main.frag +19 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/pass0.frag +16 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/pass1.frag +20 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/pass2.frag +11 -0
- package/skills/agentvfx/templates/psychedelic/echo-flow/pass3.frag +4 -0
- package/skills/agentvfx/templates/psychedelic/hologram-scan/demo-cyan.json +1 -0
- package/skills/agentvfx/templates/psychedelic/hologram-scan/fx.json +36 -0
- package/skills/agentvfx/templates/psychedelic/hologram-scan/main.frag +30 -0
- package/skills/agentvfx/templates/psychedelic/kaleido-fold/demo-six.json +1 -0
- package/skills/agentvfx/templates/psychedelic/kaleido-fold/fx.json +37 -0
- package/skills/agentvfx/templates/psychedelic/kaleido-fold/main.frag +10 -0
- package/skills/agentvfx/templates/psychedelic/kaleido-fold/pass0.frag +34 -0
- package/skills/agentvfx/templates/psychedelic/mosh-melt/demo-classic.json +1 -0
- package/skills/agentvfx/templates/psychedelic/mosh-melt/fx.json +38 -0
- package/skills/agentvfx/templates/psychedelic/mosh-melt/main.frag +20 -0
- package/skills/agentvfx/templates/psychedelic/mosh-melt/pass0.frag +22 -0
- package/skills/agentvfx/templates/psychedelic/sacred/NOTES.md +13 -0
- package/skills/agentvfx/templates/psychedelic/sacred/demo-classic.json +1 -0
- package/skills/agentvfx/templates/psychedelic/sacred/demo-halo.json +1 -0
- package/skills/agentvfx/templates/psychedelic/sacred/demo-slow-tide.json +1 -0
- package/skills/agentvfx/templates/psychedelic/sacred/demo-thermal.json +1 -0
- package/skills/agentvfx/templates/psychedelic/sacred/fx.json +263 -0
- package/skills/agentvfx/templates/psychedelic/sacred/main.frag +109 -0
- package/skills/agentvfx/templates/psychedelic/sacred/pass0.frag +25 -0
- package/skills/agentvfx/templates/psychedelic/sacred/pass1.frag +23 -0
- package/skills/agentvfx/templates/psychedelic/tidal-bands/demo-classic.json +1 -0
- package/skills/agentvfx/templates/psychedelic/tidal-bands/fx.json +37 -0
- package/skills/agentvfx/templates/psychedelic/tidal-bands/main.frag +54 -0
- package/skills/agentvfx/templates/scope/_chrome.glsl +242 -0
- package/skills/agentvfx/templates/scope/goniometer/demo-boot-green.json +1 -0
- package/skills/agentvfx/templates/scope/goniometer/demo-field-lime.json +1 -0
- package/skills/agentvfx/templates/scope/goniometer/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/scope/goniometer/demo-glow-phosphor.json +1 -0
- package/skills/agentvfx/templates/scope/goniometer/demo-hud-black.json +1 -0
- package/skills/agentvfx/templates/scope/goniometer/fx.json +635 -0
- package/skills/agentvfx/templates/scope/goniometer/main.frag +33 -0
- package/skills/agentvfx/templates/scope/goniometer/pass0.frag +58 -0
- package/skills/agentvfx/templates/scope/goniometer/pass1.frag +43 -0
- package/skills/agentvfx/templates/scope/goniometer/pass2.frag +12 -0
- package/skills/agentvfx/templates/scope/goniometer/pass3.frag +12 -0
- package/skills/agentvfx/templates/scope/goniometer/pass4.frag +12 -0
- package/skills/agentvfx/templates/scope/goniometer/pass5.frag +12 -0
- package/skills/agentvfx/templates/scope/goniometer/pass6.frag +251 -0
- package/skills/agentvfx/templates/scope/scope-polar/demo-boot-green.json +1 -0
- package/skills/agentvfx/templates/scope/scope-polar/demo-field-lime.json +1 -0
- package/skills/agentvfx/templates/scope/scope-polar/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/scope/scope-polar/demo-glow-phosphor.json +1 -0
- package/skills/agentvfx/templates/scope/scope-polar/demo-hud-black.json +1 -0
- package/skills/agentvfx/templates/scope/scope-polar/fx.json +686 -0
- package/skills/agentvfx/templates/scope/scope-polar/main.frag +39 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass0.frag +84 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass1.frag +49 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass2.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass3.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass4.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass5.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-polar/pass6.frag +251 -0
- package/skills/agentvfx/templates/scope/scope-triggered/demo-boot-green.json +1 -0
- package/skills/agentvfx/templates/scope/scope-triggered/demo-field-lime.json +1 -0
- package/skills/agentvfx/templates/scope/scope-triggered/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/scope/scope-triggered/demo-glow-phosphor.json +1 -0
- package/skills/agentvfx/templates/scope/scope-triggered/demo-hud-black.json +1 -0
- package/skills/agentvfx/templates/scope/scope-triggered/fx.json +712 -0
- package/skills/agentvfx/templates/scope/scope-triggered/main.frag +36 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass0.frag +78 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass1.frag +50 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass2.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass3.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass4.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass5.frag +12 -0
- package/skills/agentvfx/templates/scope/scope-triggered/pass6.frag +251 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-boot-green.json +1 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-field-lime.json +1 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-glow-phosphor.json +1 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-hud-black.json +1 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/fx.json +595 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/main.frag +83 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/pass0.frag +52 -0
- package/skills/agentvfx/templates/scope/spectrogram-scroll/pass1.frag +251 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/demo-boot-green.json +1 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/demo-field-lime.json +1 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/demo-glow-phosphor.json +1 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/demo-hud-black.json +1 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/fx.json +642 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/main.frag +33 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass0.frag +56 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass1.frag +44 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass2.frag +12 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass3.frag +12 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass4.frag +12 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass5.frag +12 -0
- package/skills/agentvfx/templates/scope/xy-phosphor/pass6.frag +251 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-linear/fx.src.json +61 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-linear/main.src.frag +112 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-linear/pass0.src.frag +2 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-mirror/fx.src.json +51 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-mirror/main.src.frag +72 -0
- package/skills/agentvfx/templates/spectrum/_src/bars-mirror/pass0.src.frag +2 -0
- package/skills/agentvfx/templates/spectrum/_src/bass-circle/fx.src.json +56 -0
- package/skills/agentvfx/templates/spectrum/_src/bass-circle/main.src.frag +136 -0
- package/skills/agentvfx/templates/spectrum/_src/bass-circle/pass0.src.frag +2 -0
- package/skills/agentvfx/templates/spectrum/_src/build.mjs +68 -0
- package/skills/agentvfx/templates/spectrum/_src/label-bars/fx.src.json +54 -0
- package/skills/agentvfx/templates/spectrum/_src/label-bars/main.src.frag +102 -0
- package/skills/agentvfx/templates/spectrum/_src/label-bars/pass0.src.frag +2 -0
- package/skills/agentvfx/templates/spectrum/_src/shared/bars-fn.glsl +64 -0
- package/skills/agentvfx/templates/spectrum/_src/shared/bars-pass.glsl +22 -0
- package/skills/agentvfx/templates/spectrum/_src/shared/clock.glsl +7 -0
- package/skills/agentvfx/templates/spectrum/_src/shared/hud.glsl +50 -0
- package/skills/agentvfx/templates/spectrum/_src/shared/stage.glsl +74 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/fx.src.json +58 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/main.src.frag +119 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/pass0.src.frag +33 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/fx.src.json +56 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/main.src.frag +95 -0
- package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/pass0.src.frag +2 -0
- package/skills/agentvfx/templates/spectrum/_src/waveform-line/fx.src.json +60 -0
- package/skills/agentvfx/templates/spectrum/_src/waveform-line/main.src.frag +98 -0
- package/skills/agentvfx/templates/spectrum/_src/waveform-line/pass0.src.frag +43 -0
- package/skills/agentvfx/templates/spectrum/bars-linear/demo-graph-acid.json +1 -0
- package/skills/agentvfx/templates/spectrum/bars-linear/demo-graph-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/bars-linear/fx.json +632 -0
- package/skills/agentvfx/templates/spectrum/bars-linear/main.frag +233 -0
- package/skills/agentvfx/templates/spectrum/bars-linear/pass0.frag +91 -0
- package/skills/agentvfx/templates/spectrum/bars-mirror/demo-field-acid.json +1 -0
- package/skills/agentvfx/templates/spectrum/bars-mirror/demo-field-ultramarine.json +1 -0
- package/skills/agentvfx/templates/spectrum/bars-mirror/fx.json +539 -0
- package/skills/agentvfx/templates/spectrum/bars-mirror/main.frag +193 -0
- package/skills/agentvfx/templates/spectrum/bars-mirror/pass0.frag +91 -0
- package/skills/agentvfx/templates/spectrum/bass-circle/demo-bracket-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/bass-circle/demo-bracket-ultramarine.json +1 -0
- package/skills/agentvfx/templates/spectrum/bass-circle/fx.json +552 -0
- package/skills/agentvfx/templates/spectrum/bass-circle/main.frag +258 -0
- package/skills/agentvfx/templates/spectrum/bass-circle/pass0.frag +91 -0
- package/skills/agentvfx/templates/spectrum/label-bars/demo-deck-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/label-bars/demo-deck-ultramarine.json +1 -0
- package/skills/agentvfx/templates/spectrum/label-bars/fx.json +552 -0
- package/skills/agentvfx/templates/spectrum/label-bars/main.frag +223 -0
- package/skills/agentvfx/templates/spectrum/label-bars/pass0.frag +91 -0
- package/skills/agentvfx/templates/spectrum/spectrum-particles/demo-cloud-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/spectrum-particles/demo-cloud-ultramarine.json +1 -0
- package/skills/agentvfx/templates/spectrum/spectrum-particles/fx.json +584 -0
- package/skills/agentvfx/templates/spectrum/spectrum-particles/main.frag +240 -0
- package/skills/agentvfx/templates/spectrum/spectrum-particles/pass0.frag +101 -0
- package/skills/agentvfx/templates/spectrum/spectrum-radial/demo-starburst-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/spectrum-radial/demo-starburst-ultramarine.json +1 -0
- package/skills/agentvfx/templates/spectrum/spectrum-radial/fx.json +566 -0
- package/skills/agentvfx/templates/spectrum/spectrum-radial/main.frag +217 -0
- package/skills/agentvfx/templates/spectrum/spectrum-radial/pass0.frag +91 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/demo-strip-acid.json +1 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/demo-strip-black.json +1 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/fx.json +481 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/main.frag +219 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/pass0.frag +48 -0
- package/skills/agentvfx/templates/spectrum/waveform-line/pass1.frag +86 -0
- package/skills/agentvfx/test/_render_light.mjs +38 -0
- package/skills/agentvfx/test/audio-stereo.test.mjs +45 -0
- package/skills/agentvfx/test/audio.test.mjs +257 -0
- package/skills/agentvfx/test/brutal.test.mjs +190 -0
- package/skills/agentvfx/test/concept-collage-layout.test.mjs +236 -0
- package/skills/agentvfx/test/concept-collage-scenes.test.mjs +305 -0
- package/skills/agentvfx/test/concept-collage-typefx.test.mjs +153 -0
- package/skills/agentvfx/test/concept-collage.test.mjs +84 -0
- package/skills/agentvfx/test/concept-lattice.test.mjs +133 -0
- package/skills/agentvfx/test/concept-signal-cut.test.mjs +172 -0
- package/skills/agentvfx/test/credit-overlay.test.mjs +58 -0
- package/skills/agentvfx/test/credit.test.mjs +42 -0
- package/skills/agentvfx/test/doctor.test.mjs +31 -0
- package/skills/agentvfx/test/encode.test.mjs +22 -0
- package/skills/agentvfx/test/fixtures/r7-collage-LAYOUTS.json +5780 -0
- package/skills/agentvfx/test/fixtures/score-bad-duration.json +7 -0
- package/skills/agentvfx/test/fixtures/score-bad-safety.json +8 -0
- package/skills/agentvfx/test/fixtures/score-identity-footage.json +8 -0
- package/skills/agentvfx/test/fixtures/score-missing-template.json +7 -0
- package/skills/agentvfx/test/fixtures/score-ok.json +8 -0
- package/skills/agentvfx/test/fixtures/score-strobe-12hz.json +8 -0
- package/skills/agentvfx/test/fixtures/score-text-probe.json +1 -0
- package/skills/agentvfx/test/flash-audit.test.mjs +150 -0
- package/skills/agentvfx/test/flash.test.mjs +83 -0
- package/skills/agentvfx/test/footage.test.mjs +88 -0
- package/skills/agentvfx/test/glitch.test.mjs +272 -0
- package/skills/agentvfx/test/impact.test.mjs +231 -0
- package/skills/agentvfx/test/imports.test.mjs +39 -0
- package/skills/agentvfx/test/light.test.mjs +200 -0
- package/skills/agentvfx/test/loop.test.mjs +80 -0
- package/skills/agentvfx/test/psychedelic.test.mjs +99 -0
- package/skills/agentvfx/test/render.test.mjs +73 -0
- package/skills/agentvfx/test/sacred.test.mjs +175 -0
- package/skills/agentvfx/test/schema.test.mjs +103 -0
- package/skills/agentvfx/test/scope.test.mjs +306 -0
- package/skills/agentvfx/test/spectrum.test.mjs +165 -0
- package/skills/agentvfx/test/text.test.mjs +142 -0
- package/skills/agentvfx/test/web.test.mjs +397 -0
- package/skills/agentvfx/test-media/SOURCES.md +39 -0
- package/skills/agentvfx/test-media/beat-132.mp3 +0 -0
- package/skills/agentvfx/test-media/clip-01.mp4 +0 -0
- package/skills/agentvfx/test-media/clip-02.mp4 +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// agentvfx (agentvfx licence, see LICENSE). Command-line entry: `vfx.mjs <subcommand> ...`.
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { existsSync, mkdtempSync, readFileSync } from "node:fs";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { BlockedError, ChromeSession, findChrome, chromeVersion, stageFlags } from "../engine/node/chrome.mjs";
|
|
8
|
+
import { findFfmpeg, ffmpegVersion } from "../engine/node/encode.mjs";
|
|
9
|
+
import { EXIT } from "../engine/core/constants.mjs";
|
|
10
|
+
import { loadLibrary } from "../engine/core/templates.mjs";
|
|
11
|
+
import { validateScore, validateTemplate } from "../engine/core/validate.mjs";
|
|
12
|
+
import { runJob } from "../engine/node/job.mjs";
|
|
13
|
+
|
|
14
|
+
const out = (obj) => process.stdout.write(`${JSON.stringify(obj, null, 2)}\n`);
|
|
15
|
+
|
|
16
|
+
async function doctor() {
|
|
17
|
+
const report = { ok: false, chrome: null, chromeVersion: null, webgl2: false, renderer: null, extensions: {}, ffmpeg: null, blockers: [] };
|
|
18
|
+
const ffmpeg = findFfmpeg();
|
|
19
|
+
report.ffmpeg = ffmpeg ? ffmpegVersion(ffmpeg) : null;
|
|
20
|
+
if (!report.ffmpeg) report.blockers.push("BLOCKED_NO_FFMPEG_FOR_VIDEO: ffmpeg not found (set FFMPEG_PATH or install ffmpeg)");
|
|
21
|
+
const chrome = findChrome();
|
|
22
|
+
if (!chrome) {
|
|
23
|
+
report.blockers.push("BLOCKED_NO_CHROME: Chrome/Chromium not found (set CHROME_PATH or install Google Chrome)");
|
|
24
|
+
out(report);
|
|
25
|
+
return EXIT.BLOCKED_NO_CHROME;
|
|
26
|
+
}
|
|
27
|
+
report.chrome = chrome;
|
|
28
|
+
report.chromeVersion = chromeVersion(chrome);
|
|
29
|
+
const profileDir = mkdtempSync(path.join(tmpdir(), "agentvfx-doctor-"));
|
|
30
|
+
let session;
|
|
31
|
+
try {
|
|
32
|
+
session = await ChromeSession.launch({ chrome, flags: stageFlags({ width: 1920, height: 1080, rung: "gpu" }), profileDir, routes: () => null });
|
|
33
|
+
await session.openPage();
|
|
34
|
+
const probe = await session.evaluate(`(() => {
|
|
35
|
+
const gl = document.createElement('canvas').getContext('webgl2');
|
|
36
|
+
if (!gl) return { webgl2: false };
|
|
37
|
+
const dbg = gl.getExtension('WEBGL_debug_renderer_info');
|
|
38
|
+
const has = (n) => Boolean(gl.getExtension(n));
|
|
39
|
+
return {
|
|
40
|
+
webgl2: true,
|
|
41
|
+
renderer: dbg ? String(gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL)) : 'unknown',
|
|
42
|
+
extensions: { EXT_color_buffer_float: has('EXT_color_buffer_float'), OES_texture_float_linear: has('OES_texture_float_linear') },
|
|
43
|
+
maxTextureSize: gl.getParameter(gl.MAX_TEXTURE_SIZE),
|
|
44
|
+
};
|
|
45
|
+
})()`);
|
|
46
|
+
Object.assign(report, probe);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
report.blockers.push(error instanceof BlockedError ? error.message : `BLOCKED_NO_CHROME: ${error.message}`);
|
|
49
|
+
out(report);
|
|
50
|
+
return error instanceof BlockedError ? error.code : EXIT.BLOCKED_NO_CHROME;
|
|
51
|
+
} finally {
|
|
52
|
+
if (session) await session.close();
|
|
53
|
+
}
|
|
54
|
+
if (!report.webgl2) report.blockers.push("BLOCKED_NO_WEBGL2: no WebGL2 context on the GPU rung");
|
|
55
|
+
else {
|
|
56
|
+
if (!/ANGLE/u.test(report.renderer ?? "") || /swiftshader/iu.test(report.renderer ?? "")) report.blockers.push(`BLOCKED_NO_WEBGL2: renderer is not a GPU ANGLE backend (${report.renderer})`);
|
|
57
|
+
for (const [name, ok] of Object.entries(report.extensions)) if (!ok) report.blockers.push(`BLOCKED_NO_WEBGL2: ${name} missing`);
|
|
58
|
+
}
|
|
59
|
+
report.ok = report.blockers.length === 0;
|
|
60
|
+
out(report);
|
|
61
|
+
if (report.ok) return EXIT.OK;
|
|
62
|
+
return report.ffmpeg ? EXIT.BLOCKED_NO_WEBGL2 : EXIT.BLOCKED_NO_FFMPEG_FOR_VIDEO;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function list(args) {
|
|
66
|
+
const lib = loadLibrary({ includeTest: args.includes("--include-test") });
|
|
67
|
+
const rows = [...lib.values()].map((t) => ({
|
|
68
|
+
id: t.id, family: t.fx.X_AGENTVFX.family, input: t.fx.X_AGENTVFX.input, flash: t.fx.X_AGENTVFX.flash,
|
|
69
|
+
presets: Object.keys(t.fx.X_AGENTVFX.presets), description: t.fx.DESCRIPTION,
|
|
70
|
+
}));
|
|
71
|
+
if (args.includes("--json")) out(rows);
|
|
72
|
+
else for (const r of rows) process.stdout.write(`${r.family.padEnd(14)} ${r.id.padEnd(22)} ${r.input.padEnd(10)} ${r.presets.join(", ")}\n`);
|
|
73
|
+
return EXIT.OK;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function readScore(file) {
|
|
77
|
+
if (!file || !existsSync(file)) throw new BlockedError(EXIT.USAGE, `score file not found: ${file}`);
|
|
78
|
+
try {
|
|
79
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw new BlockedError(EXIT.SCORE_INVALID, `SCORE_INVALID: ${file} is not valid JSON (${error.message})`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function validate([file]) {
|
|
86
|
+
const lib = loadLibrary({ includeTest: true });
|
|
87
|
+
for (const [id, t] of lib) {
|
|
88
|
+
const r = validateTemplate(t.fx, id);
|
|
89
|
+
if (!r.ok) {
|
|
90
|
+
out({ ok: false, template: id, errors: r.errors });
|
|
91
|
+
return EXIT.SCORE_INVALID;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const r = validateScore(readScore(file), lib);
|
|
95
|
+
out(r.ok ? { ok: true, score: r.value } : { ok: false, errors: r.errors });
|
|
96
|
+
return r.ok ? EXIT.OK : EXIT.SCORE_INVALID;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function flag(args, name, fallback = null) {
|
|
100
|
+
const i = args.indexOf(name);
|
|
101
|
+
return i >= 0 && i + 1 < args.length ? args[i + 1] : fallback;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function render(args) {
|
|
105
|
+
const file = args[0];
|
|
106
|
+
const outDir = flag(args, "--out");
|
|
107
|
+
if (!file || !outDir) {
|
|
108
|
+
process.stderr.write("usage: vfx.mjs render <score.json> --out <dir> [--width W --height H] [--no-replay]\n");
|
|
109
|
+
return EXIT.USAGE;
|
|
110
|
+
}
|
|
111
|
+
const lib = loadLibrary({ includeTest: true });
|
|
112
|
+
const v = validateScore(readScore(file), lib);
|
|
113
|
+
if (!v.ok) {
|
|
114
|
+
out({ ok: false, errors: v.errors });
|
|
115
|
+
return EXIT.SCORE_INVALID;
|
|
116
|
+
}
|
|
117
|
+
const width = flag(args, "--width") ? Number(flag(args, "--width")) : undefined;
|
|
118
|
+
const height = flag(args, "--height") ? Number(flag(args, "--height")) : undefined;
|
|
119
|
+
const gate = await runJob(v.value, lib, { outDir: path.resolve(outDir), width, height, replay: !args.includes("--no-replay") });
|
|
120
|
+
out({
|
|
121
|
+
ok: gate.ok, film: gate.withheld ?? gate.render.film, frames: gate.render.frames, size: `${gate.render.width}x${gate.render.height}`, renderMs: gate.render.renderMs,
|
|
122
|
+
determinism: gate.determinism.pass ?? "not checked",
|
|
123
|
+
flash: { exceeds: gate.flash.exceeds, flashesPerSecondMax: gate.flash.flashesPerSecondMax, redFlashes: gate.flash.redFlashes },
|
|
124
|
+
safetyNotice: gate.safetyNotice?.file ?? null, safeVariant: gate.safeVariant ? { film: gate.safeVariant.withheld ?? gate.safeVariant.film, exceeds: gate.safeVariant.flash.exceeds } : null,
|
|
125
|
+
stills: { sheet: gate.stills.sheet, strips: gate.stills.strips.map((s) => s.file), poster: gate.stills.poster },
|
|
126
|
+
credit: gate.credit.text,
|
|
127
|
+
next: "open stills/sheet.png and every strip with Read before reporting; give the user the credit line from CREDIT.txt",
|
|
128
|
+
});
|
|
129
|
+
if (gate.determinism.pass === false) return EXIT.STAGE_NONDETERMINISTIC;
|
|
130
|
+
return gate.ok ? EXIT.OK : EXIT.GATE_FAIL_QA;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async function analyze(args) {
|
|
134
|
+
const file = args[0];
|
|
135
|
+
if (!file) {
|
|
136
|
+
process.stderr.write("usage: vfx.mjs analyze <audio> [--fps 30] [--out features.json]\n");
|
|
137
|
+
return EXIT.USAGE;
|
|
138
|
+
}
|
|
139
|
+
if (!existsSync(file)) throw new BlockedError(EXIT.BLOCKED_ASSET_MISSING, `BLOCKED_ASSET_MISSING: audio not found: ${file}`);
|
|
140
|
+
const { analyzeAudio, writeFeatures, summarize } = await import("../engine/node/audio.mjs");
|
|
141
|
+
const features = await analyzeAudio(file, { fps: Number(flag(args, "--fps", "30")) });
|
|
142
|
+
const outFile = flag(args, "--out", path.join(path.dirname(file), "features.json"));
|
|
143
|
+
await writeFeatures(features, outFile);
|
|
144
|
+
out({ ...summarize(features), features: outFile });
|
|
145
|
+
return EXIT.OK;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function exportWeb(args) {
|
|
149
|
+
const script = new URL("./export-web.mjs", import.meta.url).pathname;
|
|
150
|
+
const r = spawnSync(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
151
|
+
return r.status ?? 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const COMMANDS = { doctor, list, validate, render, analyze, "export-web": exportWeb };
|
|
155
|
+
|
|
156
|
+
async function main(argv) {
|
|
157
|
+
const [cmd, ...rest] = argv;
|
|
158
|
+
const fn = COMMANDS[cmd];
|
|
159
|
+
if (!fn) {
|
|
160
|
+
process.stderr.write(`usage: vfx.mjs <${Object.keys(COMMANDS).join("|")}> ...\n`);
|
|
161
|
+
return EXIT.USAGE;
|
|
162
|
+
}
|
|
163
|
+
return fn(rest);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
main(process.argv.slice(2)).then((code) => process.exit(code ?? 0), (error) => {
|
|
167
|
+
if (error instanceof BlockedError) {
|
|
168
|
+
process.stderr.write(`${error.message}\n`);
|
|
169
|
+
process.exit(error.code);
|
|
170
|
+
}
|
|
171
|
+
process.stderr.write(`${error.stack ?? error}\n`);
|
|
172
|
+
process.exit(1);
|
|
173
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DESCRIPTION": "Test template: a persistent buffer that adds inc per frame; output shows the count in sRGB code values.",
|
|
3
|
+
"ISFVSN": "2",
|
|
4
|
+
"CATEGORIES": ["test"],
|
|
5
|
+
"INPUTS": [{ "NAME": "inc", "TYPE": "float", "MIN": 0, "MAX": 1, "DEFAULT": 0.00392156862745098 }],
|
|
6
|
+
"PASSES": [{ "TARGET": "acc", "PERSISTENT": true, "FLOAT": true }, {}],
|
|
7
|
+
"X_AGENTVFX": {
|
|
8
|
+
"id": "test-feedback-counter", "family": "_test", "input": "generative", "spdx": "LicenseRef-agentvfx", "flash": "none",
|
|
9
|
+
"presets": { "one": { "inc": 0.00392156862745098 }, "two": { "inc": 0.00784313725490196 }, "zero": { "inc": 0 } }
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DESCRIPTION": "Test template: a moving linear-light gradient. Not listed in the gallery.",
|
|
3
|
+
"CREDIT": "agentvfx",
|
|
4
|
+
"ISFVSN": "2",
|
|
5
|
+
"CATEGORIES": ["test"],
|
|
6
|
+
"INPUTS": [
|
|
7
|
+
{ "NAME": "speed", "TYPE": "float", "MIN": 0, "MAX": 4, "DEFAULT": 1 },
|
|
8
|
+
{ "NAME": "tint", "TYPE": "color", "DEFAULT": [1, 0.2, 0.6, 1] }
|
|
9
|
+
],
|
|
10
|
+
"X_AGENTVFX": {
|
|
11
|
+
"id": "test-gradient",
|
|
12
|
+
"family": "_test",
|
|
13
|
+
"input": "generative",
|
|
14
|
+
"spdx": "LicenseRef-agentvfx",
|
|
15
|
+
"flash": "none",
|
|
16
|
+
"presets": {
|
|
17
|
+
"slow": { "speed": 0.25 },
|
|
18
|
+
"default": { "speed": 1 },
|
|
19
|
+
"fast": { "speed": 3, "tint": [0.2, 1, 0.4, 1] }
|
|
20
|
+
},
|
|
21
|
+
"credits": []
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DESCRIPTION": "Test template: passes inputImage through unchanged (black without input).",
|
|
3
|
+
"ISFVSN": "2",
|
|
4
|
+
"CATEGORIES": ["test"],
|
|
5
|
+
"INPUTS": [{ "NAME": "gain", "TYPE": "float", "MIN": 0, "MAX": 2, "DEFAULT": 1 }],
|
|
6
|
+
"X_AGENTVFX": {
|
|
7
|
+
"id": "test-identity", "family": "_test", "input": "either", "spdx": "LicenseRef-agentvfx", "flash": "none",
|
|
8
|
+
"presets": { "unity": { "gain": 1 }, "half": { "gain": 0.5 }, "double": { "gain": 2 } }
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DESCRIPTION": "Test template: full-frame strobe, on for the first half of each period (rate 0 = always on).",
|
|
3
|
+
"ISFVSN": "2",
|
|
4
|
+
"CATEGORIES": ["test"],
|
|
5
|
+
"INPUTS": [
|
|
6
|
+
{ "NAME": "rate", "TYPE": "float", "MIN": 0, "MAX": 30, "DEFAULT": 12 },
|
|
7
|
+
{ "NAME": "red", "TYPE": "bool", "DEFAULT": false }
|
|
8
|
+
],
|
|
9
|
+
"X_AGENTVFX": {
|
|
10
|
+
"id": "test-strobe", "family": "_test", "input": "generative", "spdx": "LicenseRef-agentvfx", "flash": "strobe",
|
|
11
|
+
"presets": { "hold": { "rate": 0 }, "slow": { "rate": 2 }, "fast": { "rate": 12 } },
|
|
12
|
+
"safeSubstitute": { "template": "test-identity", "params": { "rate": 1 } }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DESCRIPTION": "Test template: shows the engine text mask (R ink white, G box fill grey).",
|
|
3
|
+
"ISFVSN": "2",
|
|
4
|
+
"CATEGORIES": ["test"],
|
|
5
|
+
"INPUTS": [{ "NAME": "gain", "TYPE": "float", "MIN": 0, "MAX": 1, "DEFAULT": 1 }],
|
|
6
|
+
"X_AGENTVFX": {
|
|
7
|
+
"id": "test-text-probe", "family": "_test", "input": "generative", "spdx": "LicenseRef-agentvfx", "flash": "none",
|
|
8
|
+
"presets": { "a": { "gain": 1 }, "b": { "gain": 0.5 }, "c": { "gain": 0.8 } },
|
|
9
|
+
"text": [
|
|
10
|
+
{ "key": "title", "default": "TRACK TITLE", "x": 0.06, "y": 0.1, "size": 0.16, "font": "display", "style": "outline", "box": "tab" },
|
|
11
|
+
{ "key": "code", "default": "SIGNAL 0x7G75 ACCEPTED", "x": 0.06, "y": 0.6, "size": 0.07, "font": "mono", "reveal": "decode", "revealStart": 0.2, "revealDur": 1.6 },
|
|
12
|
+
{ "key": "bar", "default": "HEADLINE", "x": 0.94, "y": 0.78, "size": 0.1, "font": "grotesk", "align": "right", "box": "bar" }
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# brutal family (neo-brutalist HUD, halftone, boot log)
|
|
2
|
+
|
|
3
|
+
Templates here are generated: edit `_src/` and run `node templates/brutal/_src/build.mjs`.
|
|
4
|
+
|
|
5
|
+
- `_src/shared/lib.glsl`: design-unit helpers (1920x1080 layout units, `U` pixels per unit), SDFs, 3x5 digit font, cover-fit media sampling.
|
|
6
|
+
- `_src/shared/screen.glsl`: dot screen, 8x8 Bayer ordered dither, ASCII-cell glyph screen (needs `float lumAt(vec2 p)` from the including shader).
|
|
7
|
+
- `_src/shared/icons.glsl`: procedural outline glyph icons.
|
|
8
|
+
- `_src/<id>/def.mjs`: fx.json (inputs, presets, text items) and demo scores; `_src/<id>/*.src.frag` the passes.
|
|
9
|
+
|
|
10
|
+
Layout is authored for 16:9. Render with `--width 1920 --height 1080` (footage templates otherwise keep the clip aspect).
|
|
11
|
+
|
|
12
|
+
- `hud-deck`: media window (rect / rounded / octagon); `deckLayout` 0 = wide window over a bottom desk (labels, waveform, hatched spectrum) with a right rail (contour map, particle box, 16-step beat sequencer, micro code); `deckLayout` 1 = off-centre octagon window with a dial gauge, segment meter, readout column, pad matrix, bar meters, scan ruler, timeline and barcode strip. Text items are gated by layout in the shader (the text layer has no per-preset visibility).
|
|
13
|
+
- `halftone-field`: `screenMode` 0 dots, 1 ordered dither, 2 ASCII cells; `invert` for dark dots on a light field.
|
|
14
|
+
- `boot-log`: generative; `logDone` sets when the log finishes typing and the progress bar fills.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { c, f, hex } from "../shared/defs.mjs";
|
|
2
|
+
|
|
3
|
+
const mono = (key, def, x, y, size, extra = {}) => ({ key, default: def, x, y, size, font: "mono", ...extra });
|
|
4
|
+
|
|
5
|
+
const INPUTS = [
|
|
6
|
+
c("fieldColor", hex("#020503")), c("inkColor", hex("#39ff14")), c("hotColor", hex("#d9ffd2")),
|
|
7
|
+
f("logDone", 1, 3.5, 2.4), f("dustAmount", 0, 1, 0.8), f("streakAmount", 0, 1, 1), f("tearAmount", 0, 1, 0.6),
|
|
8
|
+
f("scanAmount", 0, 1, 0.35), f("flickerAmount", 0, 0.5, 0.12), f("vignette", 0, 1, 0.45), f("bloomAmount", 0, 2, 0.9),
|
|
9
|
+
f("letterbox", 0, 120, 46), f("introMs", 0, 3000, 500),
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const LOG = [
|
|
13
|
+
"AGENT//VFX BOOT 0x7G75", "MOUNT /ARCHIVE/COLD-04 ........ OK", "CACHE 4096K PAGES ......... ALIGNED", "RELAY NODE 7G-75 .......... LINKED",
|
|
14
|
+
"CHECKSUM 91C2 E81B ........ PASS", "LOAD SECTOR 0417 .......... 73%", "DECODE FRAME TABLE ........ OK", "SCAN 0x00F0..0x0FFF ...... CLEAN",
|
|
15
|
+
"SIGNAL BUS 04 ............. UP", "PHASE LOCK 48.000K ........ HELD", "SEED 0x4A7C ............... SET", "HANDSHAKE ACCEPTED ........ OK", "RUN //",
|
|
16
|
+
].join("\n");
|
|
17
|
+
|
|
18
|
+
const TEXT = [
|
|
19
|
+
mono("tagA", "AGENT//VFX // COLD ARCHIVE\nNODE 7G-75 BUILD 0417\nSECTOR 04 / SIGNAL OK", 0.111, 0.066, 0.0135, { lineHeight: 1.45 }),
|
|
20
|
+
mono("tagB", "BOOT 0x7G75\nREV 04.17.31", 0.9, 0.066, 0.0135, { align: "right", lineHeight: 1.45 }),
|
|
21
|
+
mono("log", LOG, 0.033, 0.245, 0.0245, { lineHeight: 1.18, reveal: "type", revealStart: 0.2, revealDur: 2.2 }),
|
|
22
|
+
mono("status", "BOOT SEQUENCE", 0.033, 0.848, 0.0135),
|
|
23
|
+
{ key: "headline", default: "NODE 7G ONLINE", x: 0.033, y: 0.69, size: 0.11, font: "display", style: "fill", reveal: "decode", revealStart: 2.5, revealDur: 0.9 },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const PHOSPHOR = {};
|
|
27
|
+
const ACID = { fieldColor: hex("#c8ff00"), inkColor: hex("#0b0b0c"), hotColor: hex("#0b0b0c"), bloomAmount: 0.35, scanAmount: 0.25, dustAmount: 1, vignette: 0.3 };
|
|
28
|
+
const ULTRA = { fieldColor: hex("#1414ff"), inkColor: hex("#dcd3ff"), hotColor: hex("#ffffff"), bloomAmount: 0.7, vignette: 0.35 };
|
|
29
|
+
const AMBER = { fieldColor: hex("#0a0600"), inkColor: hex("#ffb000"), hotColor: hex("#fff0c8"), bloomAmount: 1.1 };
|
|
30
|
+
|
|
31
|
+
const fx = {
|
|
32
|
+
DESCRIPTION: "Boot log: monospace kernel log typing over a field with a dot-matrix emblem, corner + marks, scrolling side readouts, a progress bar and a decode headline; scanlines, slight bloom, flicker and beat tears",
|
|
33
|
+
CREDIT: "agentvfx",
|
|
34
|
+
ISFVSN: "2",
|
|
35
|
+
CATEGORIES: ["brutal", "terminal", "audio"],
|
|
36
|
+
INPUTS,
|
|
37
|
+
X_AGENTVFX: {
|
|
38
|
+
id: "boot-log", family: "brutal", input: "generative", spdx: "LicenseRef-agentvfx", flash: "possible", fps: 30, palette: false,
|
|
39
|
+
presets: { phosphor: PHOSPHOR, acid: ACID, ultramarine: ULTRA, amber: AMBER },
|
|
40
|
+
audioBind: { tearAmount: "beat" },
|
|
41
|
+
safeSubstitute: { params: { tearAmount: 0, flickerAmount: 0 } },
|
|
42
|
+
text: TEXT,
|
|
43
|
+
credits: [
|
|
44
|
+
"Terminal boot-log grammar (original drawing; no names, marks, fonts or footage from other works)",
|
|
45
|
+
"3x5 digit font, dot-matrix emblem generator, CRT scanline / flicker / vignette and 8-tap bloom are original",
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const MUSIC = "test-media/beat-132.mp3";
|
|
51
|
+
const demo = (seed, labels, startSec) => ({ input: { audio: MUSIC, startSec }, durationSec: 4, seed, labels });
|
|
52
|
+
const demos = {
|
|
53
|
+
phosphor: demo(61, {}, 2),
|
|
54
|
+
acid: demo(62, { headline: "DECK 04 LINKED", tagA: "AGENT//VFX // ACID FIELD\nNODE 7G-75 BUILD 0418\nSECTOR 05 / SIGNAL OK" }, 4),
|
|
55
|
+
ultramarine: demo(63, { headline: "PLATE 77 READY", tagA: "AGENT//VFX // BLUE ARCHIVE\nNODE 3B-31 BUILD 0419\nSECTOR 06 / SIGNAL OK" }, 5),
|
|
56
|
+
};
|
|
57
|
+
export default { fx, demos };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// boot-log: monospace boot log typing over a field, dot-matrix emblem, corner + marks, side readouts,
|
|
2
|
+
// progress bar, then a decode headline. Scanlines, slight bloom, phosphor flicker and beat tears.
|
|
3
|
+
//@include lib.glsl
|
|
4
|
+
|
|
5
|
+
// dot-matrix emblem: a mirrored 13x13 cell pattern that re-rolls on beats, inside a bracket frame
|
|
6
|
+
float emblem(vec2 p, vec2 o, float pitch, float rollSeed) {
|
|
7
|
+
vec2 q = (p - o) / pitch;
|
|
8
|
+
vec2 id = floor(q);
|
|
9
|
+
if (id.x < 0.0 || id.y < 0.0 || id.x > 12.0 || id.y > 12.0) return 0.0;
|
|
10
|
+
vec2 m = vec2(abs(id.x - 6.0), id.y);
|
|
11
|
+
float reach = max(abs(id.x - 6.0), abs(id.y - 6.0));
|
|
12
|
+
float body = step(0.5, hash12(m + vec2(rollSeed * 1.7, 3.0)));
|
|
13
|
+
float rim = step(0.35, hash12(m + vec2(1.0, rollSeed)));
|
|
14
|
+
float on = mix(body, rim, step(5.5, reach));
|
|
15
|
+
on = max(on, step(reach, 1.5) * step(0.4, hash12(m + 9.0)));
|
|
16
|
+
vec2 f = fract(q) - 0.5;
|
|
17
|
+
return on * fillAA((length(f) - 0.34) * pitch);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// side readout column: rows of 4-digit codes that scroll and re-roll
|
|
21
|
+
float sideColumn(vec2 p, float x0, float y0, float seed, float cell) {
|
|
22
|
+
float rowH = 7.4 * cell;
|
|
23
|
+
float r = floor((p.y - y0) / rowH);
|
|
24
|
+
if (r < 0.0 || r > 38.0) return 0.0;
|
|
25
|
+
float scroll = floor(TIME * 6.0 + seed);
|
|
26
|
+
float v = floor(hash12(vec2(r + scroll, seed)) * 9999.0);
|
|
27
|
+
vec2 o = snapPx(vec2(x0, y0 + r * rowH));
|
|
28
|
+
float fade = step(0.18, hash12(vec2(r, seed + 4.0)));
|
|
29
|
+
return printNum(p - o, v, 4, 0, cell) * fade;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
float bloomTaps(vec2 uv, float rad) {
|
|
33
|
+
float s = 0.0;
|
|
34
|
+
for (int i = 0; i < 12; i++) {
|
|
35
|
+
float a = float(i) * 0.5236 + rad;
|
|
36
|
+
s += texture(TEXTMASK, uv + vec2(cos(a), sin(a)) * rad * U / RENDERSIZE).r;
|
|
37
|
+
}
|
|
38
|
+
return s * 0.0833;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void main() {
|
|
42
|
+
initDesign();
|
|
43
|
+
float W = designWidth();
|
|
44
|
+
float pulse = beatPulse(9.0);
|
|
45
|
+
float beatOn = step(0.3, pulse);
|
|
46
|
+
vec2 uv = vUv;
|
|
47
|
+
// beat tear: row blocks slide
|
|
48
|
+
float row = floor(D.y / 16.0);
|
|
49
|
+
float f2 = float(FRAMEINDEX / 2);
|
|
50
|
+
uv.x += beatOn * tearAmount * (hash12(vec2(row, f2)) - 0.5) * 0.06 * step(0.7, hash12(vec2(row, f2 + 5.0)));
|
|
51
|
+
|
|
52
|
+
vec4 tm = HAS_TEXT ? texture(TEXTMASK, uv) : vec4(0.0);
|
|
53
|
+
float bloom = HAS_TEXT ? 0.4 * bloomTaps(uv, 3.0) + 0.35 * bloomTaps(uv, 8.0) + 0.25 * bloomTaps(uv, 16.0) : 0.0;
|
|
54
|
+
float tInk = tm.r;
|
|
55
|
+
bool headlineZone = D.y > 740.0 && D.y < 930.0;
|
|
56
|
+
|
|
57
|
+
vec3 col = fieldColor.rgb;
|
|
58
|
+
float ink = 0.0;
|
|
59
|
+
float dim = 0.0;
|
|
60
|
+
|
|
61
|
+
// pixel dust (clustered) and glowing data streaks
|
|
62
|
+
vec2 dc = floor(D / 8.0);
|
|
63
|
+
float cluster = smoothstep(0.55, 0.8, fbm(dc * 0.07 + vec2(TIME * 0.05, 0.0), 3));
|
|
64
|
+
dim = max(dim, cluster * step(0.955, hash12(dc + floor(TIME * 8.0))) * dustAmount);
|
|
65
|
+
for (int k = 0; k < 3; k++) {
|
|
66
|
+
float seedK = floor(TIME * 9.0) + float(k) * 13.0;
|
|
67
|
+
float yS = 240.0 + 640.0 * hash12(vec2(seedK, 1.0));
|
|
68
|
+
float x0 = W * hash12(vec2(seedK, 2.0));
|
|
69
|
+
float len = 120.0 + 520.0 * hash12(vec2(seedK, 3.0));
|
|
70
|
+
float on = step(0.45, hash12(vec2(seedK, 4.0))) * step(x0, D.x) * step(D.x, x0 + len);
|
|
71
|
+
float core = strokeAA(D.y - yS, 1.6) * on;
|
|
72
|
+
dim = max(dim, core * streakAmount);
|
|
73
|
+
col += inkColor.rgb * exp(-abs(D.y - yS) * 0.12) * on * streakAmount * 0.18 * (1.0 + pulse);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// emblem + brackets
|
|
77
|
+
float rv = clamp((TIME * 1000.0 - introMs * 0.2) / 140.0, 0.0, 1.0);
|
|
78
|
+
float roll = floor(TIME * 2.0) + float(FRAMEINDEX / 8) * beatOn;
|
|
79
|
+
ink = max(ink, emblem(D, vec2(64.0, 64.0), 10.0, roll) * rv);
|
|
80
|
+
vec2 ec = vec2(64.0 + 65.0, 64.0 + 65.0);
|
|
81
|
+
vec2 eq = abs(D - ec) / 74.0;
|
|
82
|
+
ink = max(ink, strokeAA(sdBox(D - ec, vec2(74.0)), 1.5) * step(0.62, min(eq.x, eq.y)) * rv);
|
|
83
|
+
|
|
84
|
+
// corner + marks
|
|
85
|
+
for (int i = 0; i < 4; i++) {
|
|
86
|
+
vec2 c = vec2(i % 2 == 0 ? 36.0 : W - 36.0, i < 2 ? 74.0 : 1006.0);
|
|
87
|
+
ink = max(ink, plusMark(D - c, 10.0));
|
|
88
|
+
}
|
|
89
|
+
// side readouts (right and a thin left tick column)
|
|
90
|
+
float cell = cellPx(2.6);
|
|
91
|
+
dim = max(dim, sideColumn(D, W - 150.0, 262.0, 3.0, cell) * rv);
|
|
92
|
+
dim = max(dim, sideColumn(D, W - 90.0, 262.0, 11.0, cell) * rv * 0.7);
|
|
93
|
+
for (int i = 0; i < 24; i++) {
|
|
94
|
+
float yT = 262.0 + float(i) * 29.6;
|
|
95
|
+
dim = max(dim, strokeAA(sdSeg(D, vec2(W - 170.0, yT), vec2(W - 170.0 + (i % 4 == 0 ? 14.0 : 7.0), yT)), 1.2));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// progress bar: dot-matrix blocks, completes with the log
|
|
99
|
+
float prog = clamp((TIME - 0.2) / max(logDone - 0.2, 0.1), 0.0, 1.0);
|
|
100
|
+
vec2 bo = vec2(64.0, 936.0);
|
|
101
|
+
vec2 bp = D - bo;
|
|
102
|
+
float blocks = step(0.0, bp.x) * step(bp.x, 640.0) * step(0.0, bp.y) * step(bp.y, 16.0);
|
|
103
|
+
float bi = floor(bp.x / 10.0);
|
|
104
|
+
float full = step(bi, prog * 64.0 - 1.0);
|
|
105
|
+
float cellIn = step(fract(bp.x / 10.0), 0.78) * step(2.0, bp.y) * step(bp.y, 14.0);
|
|
106
|
+
ink = max(ink, blocks * cellIn * full);
|
|
107
|
+
dim = max(dim, blocks * cellIn * (1.0 - full) * 0.6);
|
|
108
|
+
ink = max(ink, strokeAA(sdBox(bp - vec2(320.0, 8.0), vec2(324.0, 12.0)), 1.3));
|
|
109
|
+
ink = max(ink, printNum(D - snapPx(vec2(700.0, 936.0)), floor(prog * 100.0), 2, 0, cellPx(3.2)) * 1.0);
|
|
110
|
+
|
|
111
|
+
col = mix(col, inkColor.rgb, clamp(dim, 0.0, 1.0) * 0.55);
|
|
112
|
+
float t = tInk * clamp((TIME * 1000.0 - introMs * 0.05) / 100.0, 0.0, 1.0);
|
|
113
|
+
vec3 textCol = headlineZone ? hotColor.rgb : inkColor.rgb;
|
|
114
|
+
col = mix(col, inkColor.rgb, clamp(ink, 0.0, 1.0));
|
|
115
|
+
col = mix(col, textCol, clamp(t, 0.0, 1.0));
|
|
116
|
+
col = mix(col, inkColor.rgb, clamp(bloom * bloomAmount, 0.0, 1.0) * (1.0 - t) * 0.6);
|
|
117
|
+
|
|
118
|
+
// CRT: scanlines, flicker, vignette, curved letterbox
|
|
119
|
+
float scan = 1.0 - scanAmount * 0.5 * (1.0 + sin(gl_FragCoord.y * 3.14159));
|
|
120
|
+
float flick = 1.0 - flickerAmount * hash12(vec2(float(FRAMEINDEX), 3.0)) * (0.4 + pulse);
|
|
121
|
+
vec2 vq = vUv * 2.0 - 1.0;
|
|
122
|
+
float vig = 1.0 - vignette * dot(vq * vec2(0.7, 0.9), vq * vec2(0.7, 0.9));
|
|
123
|
+
col *= scan * flick * vig;
|
|
124
|
+
float u2 = pow(2.0 * vUv.x - 1.0, 2.0);
|
|
125
|
+
float edge = letterbox * (1.0 - 0.5 * (1.0 - u2));
|
|
126
|
+
float yd = min(D.y, 1080.0 - D.y);
|
|
127
|
+
col = mix(vec3(0.0), col, clamp((yd - edge) * U + 0.5, 0.0, 1.0));
|
|
128
|
+
fragColor = vec4(col, 1.0);
|
|
129
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Brutal family build. GLSL has no #include, so each template's shaders are assembled here from
|
|
2
|
+
// _src/shared/*.glsl and its own *.src.glsl parts, and fx.json plus demo scores are written from def.mjs.
|
|
3
|
+
// Run: node templates/brutal/_src/build.mjs (the "_src" folder is never loaded as a template)
|
|
4
|
+
import { mkdirSync, readFileSync, readdirSync, existsSync, writeFileSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const SRC = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const OUT = path.resolve(SRC, "..");
|
|
10
|
+
|
|
11
|
+
function include(text, dir) {
|
|
12
|
+
return text.replace(/^\/\/@include (\S+)\s*$/gmu, (_, name) => {
|
|
13
|
+
const local = path.join(dir, name);
|
|
14
|
+
const file = existsSync(local) ? local : path.join(SRC, "shared", name);
|
|
15
|
+
return include(readFileSync(file, "utf8").trimEnd(), dir);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
for (const id of readdirSync(SRC)) {
|
|
20
|
+
const dir = path.join(SRC, id);
|
|
21
|
+
const defFile = path.join(dir, "def.mjs");
|
|
22
|
+
if (!existsSync(defFile)) continue;
|
|
23
|
+
const { fx, demos } = (await import(defFile)).default;
|
|
24
|
+
const out = path.join(OUT, id);
|
|
25
|
+
mkdirSync(out, { recursive: true });
|
|
26
|
+
writeFileSync(path.join(out, "fx.json"), `${JSON.stringify(fx, null, 2)}\n`);
|
|
27
|
+
for (const file of readdirSync(dir).filter((n) => n.endsWith(".src.frag"))) {
|
|
28
|
+
writeFileSync(path.join(out, file.replace(".src.frag", ".frag")), include(readFileSync(path.join(dir, file), "utf8"), dir));
|
|
29
|
+
}
|
|
30
|
+
for (const [preset, score] of Object.entries(demos)) {
|
|
31
|
+
writeFileSync(path.join(out, `demo-${preset}.json`), `${JSON.stringify({ version: 1, template: id, preset, ...score, out: `${id}-${preset}` })}\n`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { b, c, f, hex, l } from "../shared/defs.mjs";
|
|
2
|
+
|
|
3
|
+
const mono = (key, def, x, y, extra = {}) => ({ key, default: def, x, y, size: 0.0105, font: "mono", ...extra });
|
|
4
|
+
|
|
5
|
+
const INPUTS = [
|
|
6
|
+
c("fieldColor", hex("#1414ff")), c("dotColor", hex("#cbbdff")), c("inkColor", hex("#dcd3ff")), c("textColor", hex("#e8e2ff")),
|
|
7
|
+
c("barA", hex("#ff6ad5")), c("barB", hex("#00e5ff")),
|
|
8
|
+
l("screenMode", [0, 1, 2], ["dots", "ordered-dither", "ascii-cells"], 0),
|
|
9
|
+
f("cell", 4, 28, 10), f("dotAngle", 0, 1.5708, 0.7854), f("dotGain", 0.5, 1.6, 1.12), b("invert", false),
|
|
10
|
+
f("imgContrast", 0.5, 3, 1.5), f("imgBias", -0.5, 0.5, 0),
|
|
11
|
+
f("imgX", 0.2, 0.8, 0.5), f("imgY", 0.3, 0.7, 0.5), f("imgW", 0.4, 1, 0.9), f("imgH", 0.4, 1, 0.86),
|
|
12
|
+
f("frameAmount", 0, 1, 1), b("marks", true), f("barAmount", 0, 1, 1), f("barDensity", 0, 1, 0.55),
|
|
13
|
+
f("textKnock", 0, 1, 1), f("tearAmount", 0, 1, 0.3), f("kickGain", 0, 1, 0.8), f("reactivity", 0, 2, 1), f("introMs", 0, 3000, 500),
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const TEXT = [
|
|
17
|
+
{ key: "headline", default: "PLATE//77", x: 0.052, y: 0.105, size: 0.17, font: "tall", style: "fill", weight: 300, tracking: 0.03 },
|
|
18
|
+
mono("labelA", "NODE 7G-75 // PLATE 0417", 0.05, 0.022, { reveal: "type", revealStart: 0.3, revealDur: 1.2 }),
|
|
19
|
+
mono("labelB", "LV//VFX 45DEG 4.0S", 0.95, 0.022, { align: "right" }),
|
|
20
|
+
mono("labelC", "SCREEN 10PX / MONO / 1-TONE", 0.05, 0.9505),
|
|
21
|
+
mono("labelD", "FRAME 0417 / 0120", 0.95, 0.9505, { align: "right" }),
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const ULTRA = {};
|
|
25
|
+
const INK_BLUE = { fieldColor: hex("#0a0a9e"), dotColor: hex("#c4b5fd"), inkColor: hex("#c4b5fd"), textColor: hex("#d8ccff") };
|
|
26
|
+
const ACID = {
|
|
27
|
+
fieldColor: hex("#c8ff00"), dotColor: hex("#0b0b0c"), inkColor: hex("#0b0b0c"), textColor: hex("#0b0b0c"), invert: true,
|
|
28
|
+
barA: hex("#ff2e7e"), barB: hex("#1414ff"), imgContrast: 1.7,
|
|
29
|
+
};
|
|
30
|
+
const ORANGE = {
|
|
31
|
+
fieldColor: hex("#ff3c00"), dotColor: hex("#0b0b0c"), inkColor: hex("#0b0b0c"), textColor: hex("#0b0b0c"), invert: true,
|
|
32
|
+
barA: hex("#fff4e0"), barB: hex("#1414ff"), imgContrast: 1.7,
|
|
33
|
+
};
|
|
34
|
+
const PHOSPHOR = {
|
|
35
|
+
fieldColor: hex("#050805"), dotColor: hex("#39ff14"), inkColor: hex("#39ff14"), textColor: hex("#7dff5c"), dotGain: 1.0,
|
|
36
|
+
};
|
|
37
|
+
const DITHER = { screenMode: 1, cell: 9, imgContrast: 1.7 };
|
|
38
|
+
const ASCII = {
|
|
39
|
+
fieldColor: hex("#c8ff00"), dotColor: hex("#0b0b0c"), inkColor: hex("#0b0b0c"), textColor: hex("#0b0b0c"), invert: true,
|
|
40
|
+
barA: hex("#ff2e7e"), barB: hex("#1414ff"), screenMode: 2, cell: 8, imgContrast: 1.8,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const fx = {
|
|
44
|
+
DESCRIPTION: "Footage as a single-tone dot matrix on a full solid field: dot screen, ordered dither or ASCII cells, hairline frame, pink and cyan micro bars on the image edges and a tall thin headline",
|
|
45
|
+
CREDIT: "agentvfx",
|
|
46
|
+
ISFVSN: "2",
|
|
47
|
+
CATEGORIES: ["brutal", "halftone", "audio"],
|
|
48
|
+
INPUTS,
|
|
49
|
+
X_AGENTVFX: {
|
|
50
|
+
id: "halftone-field", family: "brutal", input: "either", spdx: "LicenseRef-agentvfx", flash: "possible", fps: 30, palette: false,
|
|
51
|
+
presets: { ultramarine: ULTRA, "ink-blue": INK_BLUE, acid: ACID, orange: ORANGE, phosphor: PHOSPHOR, dither: DITHER, ascii: ASCII },
|
|
52
|
+
audioBind: { dotGain: "bass", barAmount: "bands" },
|
|
53
|
+
safeSubstitute: { params: { tearAmount: 0, kickGain: 0 } },
|
|
54
|
+
text: TEXT,
|
|
55
|
+
credits: [
|
|
56
|
+
"Single-tone halftone / dot-matrix field grammar (original drawing; no images, marks or fonts from other works)",
|
|
57
|
+
"Dot screen: rotated square lattice, dot area follows tone (classic AM halftone); ordered dither: 8x8 Bayer index matrix (Bryce Bayer, 1973); ASCII cells: original procedural glyphs",
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const MUSIC = "test-media/beat-132.mp3";
|
|
63
|
+
const demo = (video, seed, labels, startSec) => ({ input: { video, audio: MUSIC, startSec }, durationSec: 4, seed, labels });
|
|
64
|
+
const demos = {
|
|
65
|
+
ultramarine: demo("test-media/clip-01.mp4", 51, { headline: "PLATE//77" }, 3),
|
|
66
|
+
acid: demo("test-media/clip-02.mp4", 52, { headline: "SIGNAL 04", labelA: "NODE 7G-75 // KRAIT 0075" }, 5),
|
|
67
|
+
orange: demo("test-media/clip-01.mp4", 53, { headline: "HEAT//31", labelA: "NODE 5C-31 // ORANGE 0031" }, 5),
|
|
68
|
+
phosphor: demo("test-media/clip-02.mp4", 54, { headline: "ECHO/DOT", labelA: "NODE 2P-12 // PHOS 0012" }, 5),
|
|
69
|
+
dither: demo("test-media/clip-01.mp4", 55, { headline: "BAYER 8", labelC: "SCREEN 9PX / ORDERED / 1-BIT" }, 2),
|
|
70
|
+
ascii: demo("test-media/clip-02.mp4", 56, { headline: "CELL//08", labelC: "SCREEN 12PX / GLYPH / 6-LEVEL" }, 5),
|
|
71
|
+
};
|
|
72
|
+
export default { fx, demos };
|