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.
Files changed (483) hide show
  1. package/AGENTS.md +8 -0
  2. package/GEMINI.md +1 -0
  3. package/LICENSE +172 -0
  4. package/README.md +236 -2
  5. package/package.json +35 -4
  6. package/skills/agentvfx/LICENSE +172 -0
  7. package/skills/agentvfx/NOTICE +44 -0
  8. package/skills/agentvfx/SKILL.md +90 -0
  9. package/skills/agentvfx/engine/core/constants.mjs +84 -0
  10. package/skills/agentvfx/engine/core/flash-constants.mjs +23 -0
  11. package/skills/agentvfx/engine/core/flash.mjs +240 -0
  12. package/skills/agentvfx/engine/core/mark.mjs +28 -0
  13. package/skills/agentvfx/engine/core/palettes.mjs +36 -0
  14. package/skills/agentvfx/engine/core/schedule.mjs +85 -0
  15. package/skills/agentvfx/engine/core/templates.mjs +43 -0
  16. package/skills/agentvfx/engine/core/util.mjs +167 -0
  17. package/skills/agentvfx/engine/core/validate.mjs +334 -0
  18. package/skills/agentvfx/engine/node/analysis.mjs +172 -0
  19. package/skills/agentvfx/engine/node/audio.mjs +621 -0
  20. package/skills/agentvfx/engine/node/board.mjs +24 -0
  21. package/skills/agentvfx/engine/node/chrome.mjs +349 -0
  22. package/skills/agentvfx/engine/node/encode.mjs +110 -0
  23. package/skills/agentvfx/engine/node/eye.mjs +77 -0
  24. package/skills/agentvfx/engine/node/footage.mjs +129 -0
  25. package/skills/agentvfx/engine/node/frame-worker.mjs +39 -0
  26. package/skills/agentvfx/engine/node/host.mjs +31 -0
  27. package/skills/agentvfx/engine/node/job.mjs +181 -0
  28. package/skills/agentvfx/engine/node/png.mjs +112 -0
  29. package/skills/agentvfx/engine/node/render.mjs +161 -0
  30. package/skills/agentvfx/engine/node/stage-capture.mjs +187 -0
  31. package/skills/agentvfx/engine/node/stage-serve.mjs +72 -0
  32. package/skills/agentvfx/engine/node/stills.mjs +100 -0
  33. package/skills/agentvfx/engine/node/ws-server.mjs +132 -0
  34. package/skills/agentvfx/engine/web/gl.mjs +319 -0
  35. package/skills/agentvfx/engine/web/glsl-common.mjs +78 -0
  36. package/skills/agentvfx/engine/web/init.js +23 -0
  37. package/skills/agentvfx/engine/web/prelude.mjs +150 -0
  38. package/skills/agentvfx/engine/web/render.html +11 -0
  39. package/skills/agentvfx/engine/web/render.mjs +388 -0
  40. package/skills/agentvfx/engine/web/scale.mjs +15 -0
  41. package/skills/agentvfx/engine/web/text.mjs +158 -0
  42. package/skills/agentvfx/plates/terminalcore/README.md +61 -0
  43. package/skills/agentvfx/plates/terminalcore/__pycache__/crt.cpython-313.pyc +0 -0
  44. package/skills/agentvfx/plates/terminalcore/__pycache__/font.cpython-313.pyc +0 -0
  45. package/skills/agentvfx/plates/terminalcore/__pycache__/gallery.cpython-313.pyc +0 -0
  46. package/skills/agentvfx/plates/terminalcore/__pycache__/gallery_mats.cpython-313.pyc +0 -0
  47. package/skills/agentvfx/plates/terminalcore/__pycache__/gallery_room.cpython-313.pyc +0 -0
  48. package/skills/agentvfx/plates/terminalcore/__pycache__/materials.cpython-313.pyc +0 -0
  49. package/skills/agentvfx/plates/terminalcore/__pycache__/nodekit.cpython-313.pyc +0 -0
  50. package/skills/agentvfx/plates/terminalcore/__pycache__/room.cpython-313.pyc +0 -0
  51. package/skills/agentvfx/plates/terminalcore/__pycache__/shots.cpython-313.pyc +0 -0
  52. package/skills/agentvfx/plates/terminalcore/__pycache__/textures.cpython-313.pyc +0 -0
  53. package/skills/agentvfx/plates/terminalcore/__pycache__/wall.cpython-313.pyc +0 -0
  54. package/skills/agentvfx/plates/terminalcore/crt.py +143 -0
  55. package/skills/agentvfx/plates/terminalcore/font.py +80 -0
  56. package/skills/agentvfx/plates/terminalcore/gallery.py +61 -0
  57. package/skills/agentvfx/plates/terminalcore/gallery_mats.py +144 -0
  58. package/skills/agentvfx/plates/terminalcore/gallery_room.py +126 -0
  59. package/skills/agentvfx/plates/terminalcore/materials.py +170 -0
  60. package/skills/agentvfx/plates/terminalcore/nodekit.py +87 -0
  61. package/skills/agentvfx/plates/terminalcore/room.py +82 -0
  62. package/skills/agentvfx/plates/terminalcore/scene.py +219 -0
  63. package/skills/agentvfx/plates/terminalcore/shots.py +48 -0
  64. package/skills/agentvfx/plates/terminalcore/textures.py +79 -0
  65. package/skills/agentvfx/plates/terminalcore/wall.py +103 -0
  66. package/skills/agentvfx/references/plates.md +22 -0
  67. package/skills/agentvfx/references/template-format.md +149 -0
  68. package/skills/agentvfx/references/web.md +63 -0
  69. package/skills/agentvfx/runtime/agentvfx.js +708 -0
  70. package/skills/agentvfx/schemas/fx-score.schema.json +98 -0
  71. package/skills/agentvfx/scripts/export-web.mjs +155 -0
  72. package/skills/agentvfx/scripts/loop.mjs +129 -0
  73. package/skills/agentvfx/scripts/make-beat.mjs +133 -0
  74. package/skills/agentvfx/scripts/plate.mjs +82 -0
  75. package/skills/agentvfx/scripts/vfx.mjs +173 -0
  76. package/skills/agentvfx/templates/_test/feedback-counter/fx.json +11 -0
  77. package/skills/agentvfx/templates/_test/feedback-counter/main.frag +4 -0
  78. package/skills/agentvfx/templates/_test/feedback-counter/pass0.frag +4 -0
  79. package/skills/agentvfx/templates/_test/gradient/fx.json +23 -0
  80. package/skills/agentvfx/templates/_test/gradient/main.frag +5 -0
  81. package/skills/agentvfx/templates/_test/identity/fx.json +10 -0
  82. package/skills/agentvfx/templates/_test/identity/main.frag +4 -0
  83. package/skills/agentvfx/templates/_test/strobe/fx.json +14 -0
  84. package/skills/agentvfx/templates/_test/strobe/main.frag +6 -0
  85. package/skills/agentvfx/templates/_test/text-probe/fx.json +15 -0
  86. package/skills/agentvfx/templates/_test/text-probe/main.frag +6 -0
  87. package/skills/agentvfx/templates/brutal/NOTES.md +14 -0
  88. package/skills/agentvfx/templates/brutal/_src/boot-log/def.mjs +57 -0
  89. package/skills/agentvfx/templates/brutal/_src/boot-log/main.src.frag +129 -0
  90. package/skills/agentvfx/templates/brutal/_src/build.mjs +33 -0
  91. package/skills/agentvfx/templates/brutal/_src/halftone-field/def.mjs +72 -0
  92. package/skills/agentvfx/templates/brutal/_src/halftone-field/main.src.frag +94 -0
  93. package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-left.src.glsl +100 -0
  94. package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-right.src.glsl +61 -0
  95. package/skills/agentvfx/templates/brutal/_src/hud-deck/deck-tiles.src.glsl +153 -0
  96. package/skills/agentvfx/templates/brutal/_src/hud-deck/def.mjs +82 -0
  97. package/skills/agentvfx/templates/brutal/_src/hud-deck/main.src.frag +110 -0
  98. package/skills/agentvfx/templates/brutal/_src/hud-deck/pass0.src.frag +38 -0
  99. package/skills/agentvfx/templates/brutal/_src/shared/defs.mjs +28 -0
  100. package/skills/agentvfx/templates/brutal/_src/shared/icons.glsl +72 -0
  101. package/skills/agentvfx/templates/brutal/_src/shared/lib.glsl +115 -0
  102. package/skills/agentvfx/templates/brutal/_src/shared/screen.glsl +43 -0
  103. package/skills/agentvfx/templates/brutal/boot-log/demo-acid.json +1 -0
  104. package/skills/agentvfx/templates/brutal/boot-log/demo-phosphor.json +1 -0
  105. package/skills/agentvfx/templates/brutal/boot-log/demo-ultramarine.json +1 -0
  106. package/skills/agentvfx/templates/brutal/boot-log/fx.json +257 -0
  107. package/skills/agentvfx/templates/brutal/boot-log/main.frag +242 -0
  108. package/skills/agentvfx/templates/brutal/collage/_src/00-lib.glsl +73 -0
  109. package/skills/agentvfx/templates/brutal/collage/_src/10-spectrum-scope.glsl +73 -0
  110. package/skills/agentvfx/templates/brutal/collage/_src/20-meter-readout-cross.glsl +87 -0
  111. package/skills/agentvfx/templates/brutal/collage/_src/30-footage-fillers.glsl +92 -0
  112. package/skills/agentvfx/templates/brutal/collage/_src/40-editorial.glsl +232 -0
  113. package/skills/agentvfx/templates/brutal/collage/_src/50-typefx.glsl +163 -0
  114. package/skills/agentvfx/templates/brutal/collage/_src/60-scene-lib.glsl +104 -0
  115. package/skills/agentvfx/templates/brutal/collage/_src/61-scene-specimen.glsl +71 -0
  116. package/skills/agentvfx/templates/brutal/collage/_src/62-scene-wiring.glsl +96 -0
  117. package/skills/agentvfx/templates/brutal/collage/_src/63-scene-fieldcut.glsl +119 -0
  118. package/skills/agentvfx/templates/brutal/collage/_src/64-scene-pattern.glsl +64 -0
  119. package/skills/agentvfx/templates/brutal/collage/_src/641-scene-anatomy.glsl +49 -0
  120. package/skills/agentvfx/templates/brutal/collage/_src/642-scene-deck.glsl +78 -0
  121. package/skills/agentvfx/templates/brutal/collage/_src/643-scene-bootlog.glsl +60 -0
  122. package/skills/agentvfx/templates/brutal/collage/_src/644-scene-tunnel.glsl +48 -0
  123. package/skills/agentvfx/templates/brutal/collage/_src/645-scene-runner.glsl +42 -0
  124. package/skills/agentvfx/templates/brutal/collage/_src/646-scene-ascii.glsl +66 -0
  125. package/skills/agentvfx/templates/brutal/collage/_src/647-scene-cubewall.glsl +80 -0
  126. package/skills/agentvfx/templates/brutal/collage/_src/648-scene-vortex.glsl +46 -0
  127. package/skills/agentvfx/templates/brutal/collage/_src/649-scene-sticker.glsl +72 -0
  128. package/skills/agentvfx/templates/brutal/collage/_src/65-scene-main.glsl +1 -0
  129. package/skills/agentvfx/templates/brutal/collage/_src/650-scene-ribbon.glsl +55 -0
  130. package/skills/agentvfx/templates/brutal/collage/_src/651-scene-slab.glsl +38 -0
  131. package/skills/agentvfx/templates/brutal/collage/_src/652-scene-framedial.glsl +79 -0
  132. package/skills/agentvfx/templates/brutal/collage/_src/653-scene-tilt.glsl +40 -0
  133. package/skills/agentvfx/templates/brutal/collage/_src/654-scene-marquee.glsl +45 -0
  134. package/skills/agentvfx/templates/brutal/collage/_src/655-scene-lens.glsl +57 -0
  135. package/skills/agentvfx/templates/brutal/collage/_src/656-scene-liquid.glsl +35 -0
  136. package/skills/agentvfx/templates/brutal/collage/_src/657-scene-panelgrid.glsl +75 -0
  137. package/skills/agentvfx/templates/brutal/collage/_src/658-scene-mirror.glsl +49 -0
  138. package/skills/agentvfx/templates/brutal/collage/_src/66-scene-main.glsl +27 -0
  139. package/skills/agentvfx/templates/brutal/collage/_src/90-main.glsl +120 -0
  140. package/skills/agentvfx/templates/brutal/collage/_src/build.mjs +24 -0
  141. package/skills/agentvfx/templates/brutal/collage/_src/sync-presets.mjs +16 -0
  142. package/skills/agentvfx/templates/brutal/collage/demo-bone-lime.json +1 -0
  143. package/skills/agentvfx/templates/brutal/collage/demo-lime-sparse.json +1 -0
  144. package/skills/agentvfx/templates/brutal/collage/demo-orange-dense.json +1 -0
  145. package/skills/agentvfx/templates/brutal/collage/demo-ultra-slow.json +1 -0
  146. package/skills/agentvfx/templates/brutal/collage/fx.json +4882 -0
  147. package/skills/agentvfx/templates/brutal/collage/layout.mjs +97 -0
  148. package/skills/agentvfx/templates/brutal/collage/layouts.json +366 -0
  149. package/skills/agentvfx/templates/brutal/collage/main.frag +2367 -0
  150. package/skills/agentvfx/templates/brutal/collage/pass0.frag +265 -0
  151. package/skills/agentvfx/templates/brutal/halftone-field/demo-acid.json +1 -0
  152. package/skills/agentvfx/templates/brutal/halftone-field/demo-ascii.json +1 -0
  153. package/skills/agentvfx/templates/brutal/halftone-field/demo-dither.json +1 -0
  154. package/skills/agentvfx/templates/brutal/halftone-field/demo-orange.json +1 -0
  155. package/skills/agentvfx/templates/brutal/halftone-field/demo-phosphor.json +1 -0
  156. package/skills/agentvfx/templates/brutal/halftone-field/demo-ultramarine.json +1 -0
  157. package/skills/agentvfx/templates/brutal/halftone-field/fx.json +474 -0
  158. package/skills/agentvfx/templates/brutal/halftone-field/main.frag +248 -0
  159. package/skills/agentvfx/templates/brutal/hud-deck/demo-acid.json +1 -0
  160. package/skills/agentvfx/templates/brutal/hud-deck/demo-night.json +1 -0
  161. package/skills/agentvfx/templates/brutal/hud-deck/demo-octagon.json +1 -0
  162. package/skills/agentvfx/templates/brutal/hud-deck/demo-ultramarine.json +1 -0
  163. package/skills/agentvfx/templates/brutal/hud-deck/fx.json +601 -0
  164. package/skills/agentvfx/templates/brutal/hud-deck/main.frag +645 -0
  165. package/skills/agentvfx/templates/brutal/hud-deck/pass0.frag +38 -0
  166. package/skills/agentvfx/templates/brutal/lattice/demo-cobalt-fine.json +1 -0
  167. package/skills/agentvfx/templates/brutal/lattice/demo-ink-yellow.json +1 -0
  168. package/skills/agentvfx/templates/brutal/lattice/demo-vermilion.json +1 -0
  169. package/skills/agentvfx/templates/brutal/lattice/demo-violet-slow.json +1 -0
  170. package/skills/agentvfx/templates/brutal/lattice/fx.json +130 -0
  171. package/skills/agentvfx/templates/brutal/lattice/main.frag +175 -0
  172. package/skills/agentvfx/templates/brutal/lattice/pass0.frag +29 -0
  173. package/skills/agentvfx/templates/glitch/block-glitch/demo-mosaic.json +1 -0
  174. package/skills/agentvfx/templates/glitch/block-glitch/demo-onset.json +1 -0
  175. package/skills/agentvfx/templates/glitch/block-glitch/demo-static.json +1 -0
  176. package/skills/agentvfx/templates/glitch/block-glitch/demo-tear.json +1 -0
  177. package/skills/agentvfx/templates/glitch/block-glitch/fx.json +54 -0
  178. package/skills/agentvfx/templates/glitch/block-glitch/main.frag +132 -0
  179. package/skills/agentvfx/templates/glitch/block-glitch/pass0.frag +12 -0
  180. package/skills/agentvfx/templates/glitch/pixel-sort/NOTES.md +13 -0
  181. package/skills/agentvfx/templates/glitch/pixel-sort/build-passes.mjs +162 -0
  182. package/skills/agentvfx/templates/glitch/pixel-sort/demo-chunk.json +1 -0
  183. package/skills/agentvfx/templates/glitch/pixel-sort/demo-hue.json +1 -0
  184. package/skills/agentvfx/templates/glitch/pixel-sort/demo-kick.json +1 -0
  185. package/skills/agentvfx/templates/glitch/pixel-sort/demo-streak.json +1 -0
  186. package/skills/agentvfx/templates/glitch/pixel-sort/demo-vertical.json +1 -0
  187. package/skills/agentvfx/templates/glitch/pixel-sort/fx.json +60 -0
  188. package/skills/agentvfx/templates/glitch/pixel-sort/main.frag +83 -0
  189. package/skills/agentvfx/templates/glitch/pixel-sort/pass0.frag +64 -0
  190. package/skills/agentvfx/templates/glitch/pixel-sort/pass1.frag +66 -0
  191. package/skills/agentvfx/templates/glitch/pixel-sort/pass2.frag +66 -0
  192. package/skills/agentvfx/templates/glitch/pixel-sort/pass3.frag +66 -0
  193. package/skills/agentvfx/templates/glitch/pixel-sort/pass4.frag +66 -0
  194. package/skills/agentvfx/templates/glitch/pixel-sort/pass5.frag +66 -0
  195. package/skills/agentvfx/templates/glitch/pixel-sort/pass6.frag +66 -0
  196. package/skills/agentvfx/templates/glitch/pixel-sort/pass7.frag +66 -0
  197. package/skills/agentvfx/templates/glitch/pixel-sort/pass8.frag +66 -0
  198. package/skills/agentvfx/templates/glitch/rgb-split/demo-diagonal-stutter.json +1 -0
  199. package/skills/agentvfx/templates/glitch/rgb-split/demo-hard.json +1 -0
  200. package/skills/agentvfx/templates/glitch/rgb-split/demo-kick.json +1 -0
  201. package/skills/agentvfx/templates/glitch/rgb-split/demo-radial.json +1 -0
  202. package/skills/agentvfx/templates/glitch/rgb-split/fx.json +46 -0
  203. package/skills/agentvfx/templates/glitch/rgb-split/main.frag +76 -0
  204. package/skills/agentvfx/templates/glitch/vhs/demo-clean.json +1 -0
  205. package/skills/agentvfx/templates/glitch/vhs/demo-crash.json +1 -0
  206. package/skills/agentvfx/templates/glitch/vhs/demo-tape.json +1 -0
  207. package/skills/agentvfx/templates/glitch/vhs/demo-worn.json +1 -0
  208. package/skills/agentvfx/templates/glitch/vhs/fx.json +46 -0
  209. package/skills/agentvfx/templates/glitch/vhs/main.frag +96 -0
  210. package/skills/agentvfx/templates/impact/impact-1bit/demo-onebit-bayer.json +1 -0
  211. package/skills/agentvfx/templates/impact/impact-1bit/fx.json +45 -0
  212. package/skills/agentvfx/templates/impact/impact-1bit/main.frag +64 -0
  213. package/skills/agentvfx/templates/impact/impact-invert/demo-invert-snap.json +1 -0
  214. package/skills/agentvfx/templates/impact/impact-invert/fx.json +37 -0
  215. package/skills/agentvfx/templates/impact/impact-invert/main.frag +44 -0
  216. package/skills/agentvfx/templates/impact/punch-shake/demo-punch-hard.json +1 -0
  217. package/skills/agentvfx/templates/impact/punch-shake/fx.json +36 -0
  218. package/skills/agentvfx/templates/impact/punch-shake/main.frag +62 -0
  219. package/skills/agentvfx/templates/impact/rgb-hit/demo-rgb-slam.json +1 -0
  220. package/skills/agentvfx/templates/impact/rgb-hit/fx.json +39 -0
  221. package/skills/agentvfx/templates/impact/rgb-hit/main.frag +62 -0
  222. package/skills/agentvfx/templates/impact/signal-cut/demo-lime-hold.json +1 -0
  223. package/skills/agentvfx/templates/impact/signal-cut/demo-lime.json +1 -0
  224. package/skills/agentvfx/templates/impact/signal-cut/demo-orange.json +1 -0
  225. package/skills/agentvfx/templates/impact/signal-cut/demo-ultramarine.json +1 -0
  226. package/skills/agentvfx/templates/impact/signal-cut/fx.json +83 -0
  227. package/skills/agentvfx/templates/impact/signal-cut/main.frag +101 -0
  228. package/skills/agentvfx/templates/impact/signal-cut/pass0.frag +68 -0
  229. package/skills/agentvfx/templates/impact/speedline-burst/demo-speed-white.json +1 -0
  230. package/skills/agentvfx/templates/impact/speedline-burst/fx.json +44 -0
  231. package/skills/agentvfx/templates/impact/speedline-burst/main.frag +68 -0
  232. package/skills/agentvfx/templates/impact/strobe-burst/demo-strobe-white-16.json +1 -0
  233. package/skills/agentvfx/templates/impact/strobe-burst/fx.json +42 -0
  234. package/skills/agentvfx/templates/impact/strobe-burst/main.frag +43 -0
  235. package/skills/agentvfx/templates/light/anamorphic-streak/demo-anamorphic-cinema.json +10 -0
  236. package/skills/agentvfx/templates/light/anamorphic-streak/demo-data.json +10 -0
  237. package/skills/agentvfx/templates/light/anamorphic-streak/fx.json +47 -0
  238. package/skills/agentvfx/templates/light/anamorphic-streak/main.frag +45 -0
  239. package/skills/agentvfx/templates/light/anamorphic-streak/pass0.frag +22 -0
  240. package/skills/agentvfx/templates/light/anamorphic-streak/pass1.frag +16 -0
  241. package/skills/agentvfx/templates/light/anamorphic-streak/pass2.frag +16 -0
  242. package/skills/agentvfx/templates/light/anamorphic-streak/pass3.frag +16 -0
  243. package/skills/agentvfx/templates/light/bloom-glow/demo-clip01-low.json +11 -0
  244. package/skills/agentvfx/templates/light/bloom-glow/demo-neon-night.json +10 -0
  245. package/skills/agentvfx/templates/light/bloom-glow/demo-phosphor.json +11 -0
  246. package/skills/agentvfx/templates/light/bloom-glow/fx.json +53 -0
  247. package/skills/agentvfx/templates/light/bloom-glow/main.frag +85 -0
  248. package/skills/agentvfx/templates/light/bloom-glow/pass0.frag +21 -0
  249. package/skills/agentvfx/templates/light/bloom-glow/pass1.frag +50 -0
  250. package/skills/agentvfx/templates/light/bloom-glow/pass2.frag +44 -0
  251. package/skills/agentvfx/templates/light/bloom-glow/pass3.frag +32 -0
  252. package/skills/agentvfx/templates/light/bloom-glow/pass4.frag +48 -0
  253. package/skills/agentvfx/templates/light/bloom-glow/pass5.frag +46 -0
  254. package/skills/agentvfx/templates/light/god-rays/demo-golden-hour.json +10 -0
  255. package/skills/agentvfx/templates/light/god-rays/demo-point-lamp.json +10 -0
  256. package/skills/agentvfx/templates/light/god-rays/fx.json +39 -0
  257. package/skills/agentvfx/templates/light/god-rays/main.frag +54 -0
  258. package/skills/agentvfx/templates/light/lens-flare/demo-clip01-bar.json +11 -0
  259. package/skills/agentvfx/templates/light/lens-flare/demo-eye-bar.json +10 -0
  260. package/skills/agentvfx/templates/light/lens-flare/demo-sun-ghosts.json +10 -0
  261. package/skills/agentvfx/templates/light/lens-flare/fx.json +49 -0
  262. package/skills/agentvfx/templates/light/lens-flare/main.frag +86 -0
  263. package/skills/agentvfx/templates/light/lens-flare/pass0.frag +24 -0
  264. package/skills/agentvfx/templates/light/light-leak/demo-slit.json +10 -0
  265. package/skills/agentvfx/templates/light/light-leak/demo-vintage-burn.json +10 -0
  266. package/skills/agentvfx/templates/light/light-leak/fx.json +40 -0
  267. package/skills/agentvfx/templates/light/light-leak/main.frag +46 -0
  268. package/skills/agentvfx/templates/light/light-stage/fx.json +29 -0
  269. package/skills/agentvfx/templates/light/light-stage/main.frag +56 -0
  270. package/skills/agentvfx/templates/light/light-sweep/demo-hard-bar.json +12 -0
  271. package/skills/agentvfx/templates/light/light-sweep/demo-logo-sweep.json +10 -0
  272. package/skills/agentvfx/templates/light/light-sweep/demo-onset.json +11 -0
  273. package/skills/agentvfx/templates/light/light-sweep/fx.json +45 -0
  274. package/skills/agentvfx/templates/light/light-sweep/main.frag +29 -0
  275. package/skills/agentvfx/templates/light/light-sweep/pass0.frag +17 -0
  276. package/skills/agentvfx/templates/light/light-sweep/pass1.frag +15 -0
  277. package/skills/agentvfx/templates/light/neon-saber/demo-hairline.json +10 -0
  278. package/skills/agentvfx/templates/light/neon-saber/demo-saber-laser.json +10 -0
  279. package/skills/agentvfx/templates/light/neon-saber/fx.json +48 -0
  280. package/skills/agentvfx/templates/light/neon-saber/main.frag +27 -0
  281. package/skills/agentvfx/templates/light/neon-saber/pass0.frag +46 -0
  282. package/skills/agentvfx/templates/light/neon-saber/pass1.frag +15 -0
  283. package/skills/agentvfx/templates/psychedelic/echo-flow/demo-trail.json +1 -0
  284. package/skills/agentvfx/templates/psychedelic/echo-flow/fx.json +38 -0
  285. package/skills/agentvfx/templates/psychedelic/echo-flow/main.frag +19 -0
  286. package/skills/agentvfx/templates/psychedelic/echo-flow/pass0.frag +16 -0
  287. package/skills/agentvfx/templates/psychedelic/echo-flow/pass1.frag +20 -0
  288. package/skills/agentvfx/templates/psychedelic/echo-flow/pass2.frag +11 -0
  289. package/skills/agentvfx/templates/psychedelic/echo-flow/pass3.frag +4 -0
  290. package/skills/agentvfx/templates/psychedelic/hologram-scan/demo-cyan.json +1 -0
  291. package/skills/agentvfx/templates/psychedelic/hologram-scan/fx.json +36 -0
  292. package/skills/agentvfx/templates/psychedelic/hologram-scan/main.frag +30 -0
  293. package/skills/agentvfx/templates/psychedelic/kaleido-fold/demo-six.json +1 -0
  294. package/skills/agentvfx/templates/psychedelic/kaleido-fold/fx.json +37 -0
  295. package/skills/agentvfx/templates/psychedelic/kaleido-fold/main.frag +10 -0
  296. package/skills/agentvfx/templates/psychedelic/kaleido-fold/pass0.frag +34 -0
  297. package/skills/agentvfx/templates/psychedelic/mosh-melt/demo-classic.json +1 -0
  298. package/skills/agentvfx/templates/psychedelic/mosh-melt/fx.json +38 -0
  299. package/skills/agentvfx/templates/psychedelic/mosh-melt/main.frag +20 -0
  300. package/skills/agentvfx/templates/psychedelic/mosh-melt/pass0.frag +22 -0
  301. package/skills/agentvfx/templates/psychedelic/sacred/NOTES.md +13 -0
  302. package/skills/agentvfx/templates/psychedelic/sacred/demo-classic.json +1 -0
  303. package/skills/agentvfx/templates/psychedelic/sacred/demo-halo.json +1 -0
  304. package/skills/agentvfx/templates/psychedelic/sacred/demo-slow-tide.json +1 -0
  305. package/skills/agentvfx/templates/psychedelic/sacred/demo-thermal.json +1 -0
  306. package/skills/agentvfx/templates/psychedelic/sacred/fx.json +263 -0
  307. package/skills/agentvfx/templates/psychedelic/sacred/main.frag +109 -0
  308. package/skills/agentvfx/templates/psychedelic/sacred/pass0.frag +25 -0
  309. package/skills/agentvfx/templates/psychedelic/sacred/pass1.frag +23 -0
  310. package/skills/agentvfx/templates/psychedelic/tidal-bands/demo-classic.json +1 -0
  311. package/skills/agentvfx/templates/psychedelic/tidal-bands/fx.json +37 -0
  312. package/skills/agentvfx/templates/psychedelic/tidal-bands/main.frag +54 -0
  313. package/skills/agentvfx/templates/scope/_chrome.glsl +242 -0
  314. package/skills/agentvfx/templates/scope/goniometer/demo-boot-green.json +1 -0
  315. package/skills/agentvfx/templates/scope/goniometer/demo-field-lime.json +1 -0
  316. package/skills/agentvfx/templates/scope/goniometer/demo-field-ultramarine.json +1 -0
  317. package/skills/agentvfx/templates/scope/goniometer/demo-glow-phosphor.json +1 -0
  318. package/skills/agentvfx/templates/scope/goniometer/demo-hud-black.json +1 -0
  319. package/skills/agentvfx/templates/scope/goniometer/fx.json +635 -0
  320. package/skills/agentvfx/templates/scope/goniometer/main.frag +33 -0
  321. package/skills/agentvfx/templates/scope/goniometer/pass0.frag +58 -0
  322. package/skills/agentvfx/templates/scope/goniometer/pass1.frag +43 -0
  323. package/skills/agentvfx/templates/scope/goniometer/pass2.frag +12 -0
  324. package/skills/agentvfx/templates/scope/goniometer/pass3.frag +12 -0
  325. package/skills/agentvfx/templates/scope/goniometer/pass4.frag +12 -0
  326. package/skills/agentvfx/templates/scope/goniometer/pass5.frag +12 -0
  327. package/skills/agentvfx/templates/scope/goniometer/pass6.frag +251 -0
  328. package/skills/agentvfx/templates/scope/scope-polar/demo-boot-green.json +1 -0
  329. package/skills/agentvfx/templates/scope/scope-polar/demo-field-lime.json +1 -0
  330. package/skills/agentvfx/templates/scope/scope-polar/demo-field-ultramarine.json +1 -0
  331. package/skills/agentvfx/templates/scope/scope-polar/demo-glow-phosphor.json +1 -0
  332. package/skills/agentvfx/templates/scope/scope-polar/demo-hud-black.json +1 -0
  333. package/skills/agentvfx/templates/scope/scope-polar/fx.json +686 -0
  334. package/skills/agentvfx/templates/scope/scope-polar/main.frag +39 -0
  335. package/skills/agentvfx/templates/scope/scope-polar/pass0.frag +84 -0
  336. package/skills/agentvfx/templates/scope/scope-polar/pass1.frag +49 -0
  337. package/skills/agentvfx/templates/scope/scope-polar/pass2.frag +12 -0
  338. package/skills/agentvfx/templates/scope/scope-polar/pass3.frag +12 -0
  339. package/skills/agentvfx/templates/scope/scope-polar/pass4.frag +12 -0
  340. package/skills/agentvfx/templates/scope/scope-polar/pass5.frag +12 -0
  341. package/skills/agentvfx/templates/scope/scope-polar/pass6.frag +251 -0
  342. package/skills/agentvfx/templates/scope/scope-triggered/demo-boot-green.json +1 -0
  343. package/skills/agentvfx/templates/scope/scope-triggered/demo-field-lime.json +1 -0
  344. package/skills/agentvfx/templates/scope/scope-triggered/demo-field-ultramarine.json +1 -0
  345. package/skills/agentvfx/templates/scope/scope-triggered/demo-glow-phosphor.json +1 -0
  346. package/skills/agentvfx/templates/scope/scope-triggered/demo-hud-black.json +1 -0
  347. package/skills/agentvfx/templates/scope/scope-triggered/fx.json +712 -0
  348. package/skills/agentvfx/templates/scope/scope-triggered/main.frag +36 -0
  349. package/skills/agentvfx/templates/scope/scope-triggered/pass0.frag +78 -0
  350. package/skills/agentvfx/templates/scope/scope-triggered/pass1.frag +50 -0
  351. package/skills/agentvfx/templates/scope/scope-triggered/pass2.frag +12 -0
  352. package/skills/agentvfx/templates/scope/scope-triggered/pass3.frag +12 -0
  353. package/skills/agentvfx/templates/scope/scope-triggered/pass4.frag +12 -0
  354. package/skills/agentvfx/templates/scope/scope-triggered/pass5.frag +12 -0
  355. package/skills/agentvfx/templates/scope/scope-triggered/pass6.frag +251 -0
  356. package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-boot-green.json +1 -0
  357. package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-field-lime.json +1 -0
  358. package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-field-ultramarine.json +1 -0
  359. package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-glow-phosphor.json +1 -0
  360. package/skills/agentvfx/templates/scope/spectrogram-scroll/demo-hud-black.json +1 -0
  361. package/skills/agentvfx/templates/scope/spectrogram-scroll/fx.json +595 -0
  362. package/skills/agentvfx/templates/scope/spectrogram-scroll/main.frag +83 -0
  363. package/skills/agentvfx/templates/scope/spectrogram-scroll/pass0.frag +52 -0
  364. package/skills/agentvfx/templates/scope/spectrogram-scroll/pass1.frag +251 -0
  365. package/skills/agentvfx/templates/scope/xy-phosphor/demo-boot-green.json +1 -0
  366. package/skills/agentvfx/templates/scope/xy-phosphor/demo-field-lime.json +1 -0
  367. package/skills/agentvfx/templates/scope/xy-phosphor/demo-field-ultramarine.json +1 -0
  368. package/skills/agentvfx/templates/scope/xy-phosphor/demo-glow-phosphor.json +1 -0
  369. package/skills/agentvfx/templates/scope/xy-phosphor/demo-hud-black.json +1 -0
  370. package/skills/agentvfx/templates/scope/xy-phosphor/fx.json +642 -0
  371. package/skills/agentvfx/templates/scope/xy-phosphor/main.frag +33 -0
  372. package/skills/agentvfx/templates/scope/xy-phosphor/pass0.frag +56 -0
  373. package/skills/agentvfx/templates/scope/xy-phosphor/pass1.frag +44 -0
  374. package/skills/agentvfx/templates/scope/xy-phosphor/pass2.frag +12 -0
  375. package/skills/agentvfx/templates/scope/xy-phosphor/pass3.frag +12 -0
  376. package/skills/agentvfx/templates/scope/xy-phosphor/pass4.frag +12 -0
  377. package/skills/agentvfx/templates/scope/xy-phosphor/pass5.frag +12 -0
  378. package/skills/agentvfx/templates/scope/xy-phosphor/pass6.frag +251 -0
  379. package/skills/agentvfx/templates/spectrum/_src/bars-linear/fx.src.json +61 -0
  380. package/skills/agentvfx/templates/spectrum/_src/bars-linear/main.src.frag +112 -0
  381. package/skills/agentvfx/templates/spectrum/_src/bars-linear/pass0.src.frag +2 -0
  382. package/skills/agentvfx/templates/spectrum/_src/bars-mirror/fx.src.json +51 -0
  383. package/skills/agentvfx/templates/spectrum/_src/bars-mirror/main.src.frag +72 -0
  384. package/skills/agentvfx/templates/spectrum/_src/bars-mirror/pass0.src.frag +2 -0
  385. package/skills/agentvfx/templates/spectrum/_src/bass-circle/fx.src.json +56 -0
  386. package/skills/agentvfx/templates/spectrum/_src/bass-circle/main.src.frag +136 -0
  387. package/skills/agentvfx/templates/spectrum/_src/bass-circle/pass0.src.frag +2 -0
  388. package/skills/agentvfx/templates/spectrum/_src/build.mjs +68 -0
  389. package/skills/agentvfx/templates/spectrum/_src/label-bars/fx.src.json +54 -0
  390. package/skills/agentvfx/templates/spectrum/_src/label-bars/main.src.frag +102 -0
  391. package/skills/agentvfx/templates/spectrum/_src/label-bars/pass0.src.frag +2 -0
  392. package/skills/agentvfx/templates/spectrum/_src/shared/bars-fn.glsl +64 -0
  393. package/skills/agentvfx/templates/spectrum/_src/shared/bars-pass.glsl +22 -0
  394. package/skills/agentvfx/templates/spectrum/_src/shared/clock.glsl +7 -0
  395. package/skills/agentvfx/templates/spectrum/_src/shared/hud.glsl +50 -0
  396. package/skills/agentvfx/templates/spectrum/_src/shared/stage.glsl +74 -0
  397. package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/fx.src.json +58 -0
  398. package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/main.src.frag +119 -0
  399. package/skills/agentvfx/templates/spectrum/_src/spectrum-particles/pass0.src.frag +33 -0
  400. package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/fx.src.json +56 -0
  401. package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/main.src.frag +95 -0
  402. package/skills/agentvfx/templates/spectrum/_src/spectrum-radial/pass0.src.frag +2 -0
  403. package/skills/agentvfx/templates/spectrum/_src/waveform-line/fx.src.json +60 -0
  404. package/skills/agentvfx/templates/spectrum/_src/waveform-line/main.src.frag +98 -0
  405. package/skills/agentvfx/templates/spectrum/_src/waveform-line/pass0.src.frag +43 -0
  406. package/skills/agentvfx/templates/spectrum/bars-linear/demo-graph-acid.json +1 -0
  407. package/skills/agentvfx/templates/spectrum/bars-linear/demo-graph-black.json +1 -0
  408. package/skills/agentvfx/templates/spectrum/bars-linear/fx.json +632 -0
  409. package/skills/agentvfx/templates/spectrum/bars-linear/main.frag +233 -0
  410. package/skills/agentvfx/templates/spectrum/bars-linear/pass0.frag +91 -0
  411. package/skills/agentvfx/templates/spectrum/bars-mirror/demo-field-acid.json +1 -0
  412. package/skills/agentvfx/templates/spectrum/bars-mirror/demo-field-ultramarine.json +1 -0
  413. package/skills/agentvfx/templates/spectrum/bars-mirror/fx.json +539 -0
  414. package/skills/agentvfx/templates/spectrum/bars-mirror/main.frag +193 -0
  415. package/skills/agentvfx/templates/spectrum/bars-mirror/pass0.frag +91 -0
  416. package/skills/agentvfx/templates/spectrum/bass-circle/demo-bracket-black.json +1 -0
  417. package/skills/agentvfx/templates/spectrum/bass-circle/demo-bracket-ultramarine.json +1 -0
  418. package/skills/agentvfx/templates/spectrum/bass-circle/fx.json +552 -0
  419. package/skills/agentvfx/templates/spectrum/bass-circle/main.frag +258 -0
  420. package/skills/agentvfx/templates/spectrum/bass-circle/pass0.frag +91 -0
  421. package/skills/agentvfx/templates/spectrum/label-bars/demo-deck-black.json +1 -0
  422. package/skills/agentvfx/templates/spectrum/label-bars/demo-deck-ultramarine.json +1 -0
  423. package/skills/agentvfx/templates/spectrum/label-bars/fx.json +552 -0
  424. package/skills/agentvfx/templates/spectrum/label-bars/main.frag +223 -0
  425. package/skills/agentvfx/templates/spectrum/label-bars/pass0.frag +91 -0
  426. package/skills/agentvfx/templates/spectrum/spectrum-particles/demo-cloud-black.json +1 -0
  427. package/skills/agentvfx/templates/spectrum/spectrum-particles/demo-cloud-ultramarine.json +1 -0
  428. package/skills/agentvfx/templates/spectrum/spectrum-particles/fx.json +584 -0
  429. package/skills/agentvfx/templates/spectrum/spectrum-particles/main.frag +240 -0
  430. package/skills/agentvfx/templates/spectrum/spectrum-particles/pass0.frag +101 -0
  431. package/skills/agentvfx/templates/spectrum/spectrum-radial/demo-starburst-black.json +1 -0
  432. package/skills/agentvfx/templates/spectrum/spectrum-radial/demo-starburst-ultramarine.json +1 -0
  433. package/skills/agentvfx/templates/spectrum/spectrum-radial/fx.json +566 -0
  434. package/skills/agentvfx/templates/spectrum/spectrum-radial/main.frag +217 -0
  435. package/skills/agentvfx/templates/spectrum/spectrum-radial/pass0.frag +91 -0
  436. package/skills/agentvfx/templates/spectrum/waveform-line/demo-strip-acid.json +1 -0
  437. package/skills/agentvfx/templates/spectrum/waveform-line/demo-strip-black.json +1 -0
  438. package/skills/agentvfx/templates/spectrum/waveform-line/fx.json +481 -0
  439. package/skills/agentvfx/templates/spectrum/waveform-line/main.frag +219 -0
  440. package/skills/agentvfx/templates/spectrum/waveform-line/pass0.frag +48 -0
  441. package/skills/agentvfx/templates/spectrum/waveform-line/pass1.frag +86 -0
  442. package/skills/agentvfx/test/_render_light.mjs +38 -0
  443. package/skills/agentvfx/test/audio-stereo.test.mjs +45 -0
  444. package/skills/agentvfx/test/audio.test.mjs +257 -0
  445. package/skills/agentvfx/test/brutal.test.mjs +190 -0
  446. package/skills/agentvfx/test/concept-collage-layout.test.mjs +236 -0
  447. package/skills/agentvfx/test/concept-collage-scenes.test.mjs +305 -0
  448. package/skills/agentvfx/test/concept-collage-typefx.test.mjs +153 -0
  449. package/skills/agentvfx/test/concept-collage.test.mjs +84 -0
  450. package/skills/agentvfx/test/concept-lattice.test.mjs +133 -0
  451. package/skills/agentvfx/test/concept-signal-cut.test.mjs +172 -0
  452. package/skills/agentvfx/test/credit-overlay.test.mjs +58 -0
  453. package/skills/agentvfx/test/credit.test.mjs +42 -0
  454. package/skills/agentvfx/test/doctor.test.mjs +31 -0
  455. package/skills/agentvfx/test/encode.test.mjs +22 -0
  456. package/skills/agentvfx/test/fixtures/r7-collage-LAYOUTS.json +5780 -0
  457. package/skills/agentvfx/test/fixtures/score-bad-duration.json +7 -0
  458. package/skills/agentvfx/test/fixtures/score-bad-safety.json +8 -0
  459. package/skills/agentvfx/test/fixtures/score-identity-footage.json +8 -0
  460. package/skills/agentvfx/test/fixtures/score-missing-template.json +7 -0
  461. package/skills/agentvfx/test/fixtures/score-ok.json +8 -0
  462. package/skills/agentvfx/test/fixtures/score-strobe-12hz.json +8 -0
  463. package/skills/agentvfx/test/fixtures/score-text-probe.json +1 -0
  464. package/skills/agentvfx/test/flash-audit.test.mjs +150 -0
  465. package/skills/agentvfx/test/flash.test.mjs +83 -0
  466. package/skills/agentvfx/test/footage.test.mjs +88 -0
  467. package/skills/agentvfx/test/glitch.test.mjs +272 -0
  468. package/skills/agentvfx/test/impact.test.mjs +231 -0
  469. package/skills/agentvfx/test/imports.test.mjs +39 -0
  470. package/skills/agentvfx/test/light.test.mjs +200 -0
  471. package/skills/agentvfx/test/loop.test.mjs +80 -0
  472. package/skills/agentvfx/test/psychedelic.test.mjs +99 -0
  473. package/skills/agentvfx/test/render.test.mjs +73 -0
  474. package/skills/agentvfx/test/sacred.test.mjs +175 -0
  475. package/skills/agentvfx/test/schema.test.mjs +103 -0
  476. package/skills/agentvfx/test/scope.test.mjs +306 -0
  477. package/skills/agentvfx/test/spectrum.test.mjs +165 -0
  478. package/skills/agentvfx/test/text.test.mjs +142 -0
  479. package/skills/agentvfx/test/web.test.mjs +397 -0
  480. package/skills/agentvfx/test-media/SOURCES.md +39 -0
  481. package/skills/agentvfx/test-media/beat-132.mp3 +0 -0
  482. package/skills/agentvfx/test-media/clip-01.mp4 +0 -0
  483. package/skills/agentvfx/test-media/clip-02.mp4 +0 -0
@@ -0,0 +1,170 @@
1
+ """Procedural PBR materials: board-formed concrete, polished floor, plastics, steel, rubber, LEDs, CRT glass+phosphor."""
2
+ import math as pymath
3
+
4
+ from nodekit import fresh, finish, math, remap, mix, vmath, rgb, principled, node
5
+
6
+
7
+ def _ao(nt, dist=0.08):
8
+ return node(nt, "ShaderNodeAmbientOcclusion", {"Distance": dist}, samples=4).outputs["AO"]
9
+
10
+
11
+ def _position_axes(nt):
12
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
13
+ sep = node(nt, "ShaderNodeSeparateXYZ", {"Vector": pos})
14
+ horiz = math(nt, "ADD", sep.outputs["X"], sep.outputs["Y"])
15
+ return pos, horiz, sep.outputs["Z"], sep.outputs["X"], sep.outputs["Y"]
16
+
17
+
18
+ def concrete(name="concrete", polished=False, tone=0.16):
19
+ m, nt = fresh(name)
20
+ pos, h, z, x, y = _position_axes(nt)
21
+ along = y if polished else h
22
+ across = x if polished else z
23
+ patches = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 0.7), "Detail": 8.0, "Roughness": 0.62}).outputs["Fac"]
24
+ fine = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 70.0), "Detail": 6.0, "Roughness": 0.7}).outputs["Fac"]
25
+ pores = node(nt, "ShaderNodeTexVoronoi", {"Vector": vmath(nt, "SCALE", pos, 38.0)}, feature="F1").outputs["Distance"]
26
+ streak_in = node(nt, "ShaderNodeCombineXYZ", {"X": math(nt, "MULTIPLY", along, 6.0), "Y": 0.0, "Z": math(nt, "MULTIPLY", across, 0.5)})
27
+ streaks = node(nt, "ShaderNodeTexNoise", {"Vector": streak_in.outputs[0], "Detail": 5.0}).outputs["Fac"]
28
+ board_s = math(nt, "DIVIDE", across, 0.32)
29
+ board_fr = math(nt, "FRACT", board_s)
30
+ board_id = math(nt, "FLOOR", board_s)
31
+ board_rnd = node(nt, "ShaderNodeTexWhiteNoise", {"W": board_id}, noise_dimensions="1D").outputs["Value"]
32
+ groove = remap(nt, board_fr, 0.0, 0.05, 1.0, 0.0)
33
+ joint_s = math(nt, "DIVIDE", along, 2.4)
34
+ joint = remap(nt, math(nt, "FRACT", joint_s), 0.0, 0.01, 1.0, 0.0)
35
+ if polished:
36
+ groove = math(nt, "MULTIPLY", groove, 0.0)
37
+ joint = remap(nt, math(nt, "FRACT", math(nt, "DIVIDE", along, 1.8)), 0.0, 0.004, 1.0, 0.0)
38
+ joint = math(nt, "MAXIMUM", joint, remap(nt, math(nt, "FRACT", math(nt, "DIVIDE", across, 1.8)), 0.0, 0.004, 1.0, 0.0))
39
+ grid = node(nt, "ShaderNodeTexVoronoi", {"Vector": node(nt, "ShaderNodeCombineXYZ", {"X": math(nt, "DIVIDE", along, 1.2), "Y": math(nt, "DIVIDE", across, 1.2), "Z": 0.0}).outputs[0], "Randomness": 0.0}, feature="F1").outputs["Distance"]
40
+ holes = remap(nt, grid, 0.055, 0.04, 0.0, 1.0)
41
+ if polished:
42
+ holes = math(nt, "MULTIPLY", holes, 0.0)
43
+
44
+ height = math(nt, "ADD", math(nt, "MULTIPLY", fine, 0.5), math(nt, "MULTIPLY", patches, 0.5))
45
+ height = math(nt, "SUBTRACT", height, math(nt, "MULTIPLY", math(nt, "MAXIMUM", groove, joint), 0.55))
46
+ height = math(nt, "SUBTRACT", height, math(nt, "MULTIPLY", holes, 1.2))
47
+ height = math(nt, "ADD", height, math(nt, "MULTIPLY", pores, 0.15))
48
+ bump = node(nt, "ShaderNodeBump", {"Height": height, "Strength": 0.25 if polished else 0.55, "Distance": 0.012}).outputs["Normal"]
49
+
50
+ tone_v = math(nt, "MULTIPLY", remap(nt, patches, 0.3, 0.7, 0.55, 1.35), math(nt, "ADD", 0.82, math(nt, "MULTIPLY", board_rnd, 0.3 if not polished else 0.0)))
51
+ tone_v = math(nt, "MULTIPLY", tone_v, remap(nt, streaks, 0.35, 0.7, 1.15, 0.6))
52
+ tone_v = math(nt, "MULTIPLY", tone_v, math(nt, "SUBTRACT", 1.0, math(nt, "MULTIPLY", math(nt, "MAXIMUM", groove, joint), 0.55)))
53
+ tone_v = math(nt, "MULTIPLY", tone_v, math(nt, "SUBTRACT", 1.0, math(nt, "MULTIPLY", holes, 0.85)))
54
+ tone_v = math(nt, "MULTIPLY", tone_v, math(nt, "ADD", 0.45, math(nt, "MULTIPLY", _ao(nt, 0.6), 0.55)))
55
+ base = vmath(nt, "MULTIPLY", rgb(nt, tone * 0.93, tone * 0.97, tone * 1.02), vmath(nt, "SCALE", rgb(nt, 1, 1, 1), tone_v))
56
+ rough = math(nt, "ADD", 0.55 if not polished else 0.06, math(nt, "MULTIPLY", math(nt, "SUBTRACT", fine, 0.5), 0.5 if not polished else 0.2))
57
+ if polished:
58
+ rough = math(nt, "ADD", rough, math(nt, "MULTIPLY", remap(nt, patches, 0.45, 0.7), 0.3))
59
+ b = principled(nt, Base_Color=base, Roughness=math(nt, "MAXIMUM", rough, 0.05, clamp=True), Normal=bump, Specular_IOR_Level=0.5 if not polished else 0.8)
60
+ finish(nt, b)
61
+ return m
62
+
63
+
64
+ def plastic(name="plastic", palette=((0.035, 0.037, 0.04), (0.24, 0.225, 0.19), (0.05, 0.06, 0.055))):
65
+ """Colour picked per object via Object Info random so one material serves many monitors."""
66
+ m, nt = fresh(name)
67
+ r = node(nt, "ShaderNodeObjectInfo").outputs["Random"]
68
+ c0, c1, c2 = (rgb(nt, *c) for c in palette)
69
+ col = mix(nt, remap(nt, r, 0.5, 0.52, 0.0, 1.0, smooth=False), c0, c1)
70
+ col = mix(nt, remap(nt, r, 0.82, 0.84, 0.0, 1.0, smooth=False), col, c2)
71
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
72
+ grain = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 260.0), "Detail": 3.0}).outputs["Fac"]
73
+ blot = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 5.0), "Detail": 4.0}).outputs["Fac"]
74
+ ao = _ao(nt, 0.05)
75
+ col = vmath(nt, "MULTIPLY", col, vmath(nt, "SCALE", rgb(nt, 1, 1, 1), math(nt, "MULTIPLY", math(nt, "ADD", 0.5, math(nt, "MULTIPLY", ao, 0.5)), remap(nt, blot, 0.3, 0.7, 0.8, 1.15))))
76
+ bump = node(nt, "ShaderNodeBump", {"Height": grain, "Strength": 0.1, "Distance": 0.0004}).outputs["Normal"]
77
+ rough = math(nt, "ADD", 0.38, math(nt, "MULTIPLY", blot, 0.25))
78
+ finish(nt, principled(nt, Base_Color=col, Roughness=rough, Normal=bump, Specular_IOR_Level=0.5))
79
+ return m
80
+
81
+
82
+ def steel(name="steel", tone=0.32):
83
+ m, nt = fresh(name)
84
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
85
+ brushed = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "MULTIPLY", pos, (90.0, 2.0, 2.0)), "Detail": 3.0}).outputs["Fac"]
86
+ patina = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 3.0), "Detail": 6.0}).outputs["Fac"]
87
+ col = vmath(nt, "SCALE", rgb(nt, tone, tone * 1.02, tone * 1.06), math(nt, "MULTIPLY", remap(nt, patina, 0.3, 0.7, 0.5, 1.2), math(nt, "ADD", 0.5, math(nt, "MULTIPLY", _ao(nt, 0.1), 0.5))))
88
+ bump = node(nt, "ShaderNodeBump", {"Height": brushed, "Strength": 0.08, "Distance": 0.0005}).outputs["Normal"]
89
+ finish(nt, principled(nt, Base_Color=col, Metallic=1.0, Roughness=math(nt, "ADD", 0.28, math(nt, "MULTIPLY", patina, 0.3)), Normal=bump))
90
+ return m
91
+
92
+
93
+ def rubber(name="rubber", tint=(0.012, 0.012, 0.013)):
94
+ m, nt = fresh(name)
95
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
96
+ n1 = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 90.0), "Detail": 3.0}).outputs["Fac"]
97
+ bump = node(nt, "ShaderNodeBump", {"Height": n1, "Strength": 0.1, "Distance": 0.0006}).outputs["Normal"]
98
+ finish(nt, principled(nt, Base_Color=tint, Roughness=0.42, Normal=bump, Sheen_Weight=0.2, Sheen_Roughness=0.5, Specular_IOR_Level=0.55))
99
+ return m
100
+
101
+
102
+ def led(name, color, power):
103
+ m, nt = fresh(name)
104
+ finish(nt, principled(nt, Base_Color=(0.01, 0.01, 0.01), Emission_Color=color, Emission_Strength=power, Roughness=0.2))
105
+ return m
106
+
107
+
108
+ def led_random(name, power):
109
+ """Status LED whose colour (green / amber / red / cyan) is chosen per object."""
110
+ m, nt = fresh(name)
111
+ r = node(nt, "ShaderNodeObjectInfo").outputs["Random"]
112
+ col = mix(nt, remap(nt, r, 0.40, 0.41, 0.0, 1.0, smooth=False), rgb(nt, 0.1, 1.0, 0.2), rgb(nt, 1.0, 0.45, 0.05))
113
+ col = mix(nt, remap(nt, r, 0.75, 0.76, 0.0, 1.0, smooth=False), col, rgb(nt, 1.0, 0.04, 0.03))
114
+ col = mix(nt, remap(nt, r, 0.92, 0.93, 0.0, 1.0, smooth=False), col, rgb(nt, 0.1, 0.7, 1.0))
115
+ finish(nt, principled(nt, Base_Color=(0.01, 0.01, 0.01), Emission_Color=col, Emission_Strength=power, Roughness=0.2))
116
+ return m
117
+
118
+
119
+ def vent_black(name="vent_black"):
120
+ m, nt = fresh(name)
121
+ finish(nt, principled(nt, Base_Color=(0.004, 0.004, 0.004), Roughness=0.7))
122
+ return m
123
+
124
+
125
+ def screen(name, image, tint, anim, rows_visible=0.5, lines=140.0, strength=5.0, zoom=1.0):
126
+ """CRT glass over phosphor: emissive scrolling image * scanlines * vignette, glossy dusty glass on top.
127
+
128
+ anim: dict of Value nodes the caller keys per frame -> {'scroll': Value node, 'time': Value node}.
129
+ """
130
+ m, nt = fresh(name)
131
+ uv = node(nt, "ShaderNodeUVMap").outputs["UV"]
132
+ sep = node(nt, "ShaderNodeSeparateXYZ", {"Vector": uv})
133
+ u, v = sep.outputs["X"], sep.outputs["Y"]
134
+ rnd = node(nt, "ShaderNodeObjectInfo").outputs["Random"]
135
+ scroll = node(nt, "ShaderNodeValue")
136
+ scroll.label = "scroll"
137
+ tnode = node(nt, "ShaderNodeValue")
138
+ tnode.label = "time"
139
+ anim["scroll"], anim["time"] = scroll, tnode
140
+ off_y = math(nt, "ADD", scroll.outputs[0], math(nt, "MULTIPLY", math(nt, "FLOOR", math(nt, "MULTIPLY", rnd, 64.0)), 1.0 / 64.0))
141
+ pu = math(nt, "ADD", math(nt, "MULTIPLY", u, 0.94 * zoom), 0.0)
142
+ pv = math(nt, "ADD", math(nt, "MULTIPLY", v, rows_visible * zoom), off_y)
143
+ coords = node(nt, "ShaderNodeCombineXYZ", {"X": pu, "Y": pv, "Z": 0.0}).outputs[0]
144
+ tex = node(nt, "ShaderNodeTexImage", {"Vector": coords}, image=image, interpolation="Linear", extension="REPEAT")
145
+ lum = tex.outputs["Color"]
146
+ lum = node(nt, "ShaderNodeSeparateColor", {"Color": lum}).outputs["Red"]
147
+
148
+ scan = math(nt, "ADD", 0.62, math(nt, "MULTIPLY", math(nt, "SINE", math(nt, "MULTIPLY", v, lines * 2.0 * pymath.pi)), 0.38))
149
+ du, dv = math(nt, "SUBTRACT", u, 0.5), math(nt, "SUBTRACT", v, 0.5)
150
+ r2 = math(nt, "ADD", math(nt, "MULTIPLY", du, du), math(nt, "MULTIPLY", dv, dv))
151
+ vign = remap(nt, r2, 0.62, 0.05, 0.25, 1.0)
152
+ edge = math(nt, "MULTIPLY", remap(nt, math(nt, "MINIMUM", u, math(nt, "SUBTRACT", 1.0, u)), 0.0, 0.035), remap(nt, math(nt, "MINIMUM", v, math(nt, "SUBTRACT", 1.0, v)), 0.0, 0.035))
153
+
154
+ t = tnode.outputs[0]
155
+ phase = math(nt, "MULTIPLY", rnd, 6.2832)
156
+ flick = math(nt, "ADD", 1.0, math(nt, "MULTIPLY", math(nt, "ADD", math(nt, "SINE", math(nt, "ADD", math(nt, "MULTIPLY", t, 53.0), phase)), math(nt, "SINE", math(nt, "ADD", math(nt, "MULTIPLY", t, 17.3), math(nt, "MULTIPLY", phase, 2.3)))), 0.035))
157
+ bar_pos = math(nt, "FRACT", math(nt, "ADD", math(nt, "MULTIPLY", t, 0.19), rnd))
158
+ d = math(nt, "ABSOLUTE", math(nt, "SUBTRACT", math(nt, "FRACT", math(nt, "ADD", math(nt, "SUBTRACT", v, bar_pos), 0.5)), 0.5))
159
+ bar = math(nt, "ADD", 1.0, remap(nt, d, 0.14, 0.0, 0.0, 0.35))
160
+
161
+ raster = math(nt, "ADD", 0.03,math(nt, "MULTIPLY", lum, 1.0))
162
+ lit = math(nt, "MULTIPLY", math(nt, "MULTIPLY", raster, scan), math(nt, "MULTIPLY", math(nt, "MULTIPLY", vign, edge), math(nt, "MULTIPLY", flick, bar)))
163
+ emit = vmath(nt, "MULTIPLY", rgb(nt, *tint), vmath(nt, "SCALE", rgb(nt, 1, 1, 1), lit))
164
+
165
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
166
+ dust = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 22.0), "Detail": 5.0}).outputs["Fac"]
167
+ smudge = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 6.0), "Detail": 3.0}).outputs["Fac"]
168
+ rough = math(nt, "ADD", 0.035, math(nt, "MULTIPLY", math(nt, "MULTIPLY", remap(nt, smudge, 0.4, 0.75), remap(nt, dust, 0.4, 0.8)), 0.16))
169
+ finish(nt, principled(nt, Base_Color=(0.004, 0.005, 0.004), Roughness=rough, IOR=1.52, Specular_IOR_Level=0.7, Emission_Color=emit, Emission_Strength=strength))
170
+ return m
@@ -0,0 +1,87 @@
1
+ """Tiny shader-node helpers: build node graphs as expressions (sockets or plain numbers in, sockets out)."""
2
+ import bpy
3
+
4
+
5
+ def fresh(name):
6
+ m = bpy.data.materials.new(name)
7
+ m.use_nodes = True
8
+ nt = m.node_tree
9
+ nt.nodes.clear()
10
+ return m, nt
11
+
12
+
13
+ def _set(sock, v):
14
+ if isinstance(v, bpy.types.NodeSocket):
15
+ sock.node.id_data.links.new(v, sock)
16
+ elif sock.type == "RGBA" and not isinstance(v, (int, float)) and len(v) == 3:
17
+ sock.default_value = (*v, 1.0)
18
+ else:
19
+ sock.default_value = v
20
+
21
+
22
+ def node(nt, idname, ins=None, **props):
23
+ n = nt.nodes.new(idname)
24
+ for k, v in props.items():
25
+ setattr(n, k, v)
26
+ for k, v in (ins or {}).items():
27
+ _set(n.inputs[k], v)
28
+ return n
29
+
30
+
31
+ def math(nt, op, a, b=None, c=None, clamp=False):
32
+ n = nt.nodes.new("ShaderNodeMath")
33
+ n.operation = op
34
+ n.use_clamp = clamp
35
+ for i, v in enumerate((a, b, c)):
36
+ if v is not None:
37
+ _set(n.inputs[i], v)
38
+ return n.outputs[0]
39
+
40
+
41
+ def remap(nt, v, lo, hi, out_lo=0.0, out_hi=1.0, smooth=True):
42
+ n = nt.nodes.new("ShaderNodeMapRange")
43
+ n.interpolation_type = "SMOOTHSTEP" if smooth else "LINEAR"
44
+ n.clamp = True
45
+ for k, x in (("Value", v), ("From Min", lo), ("From Max", hi), ("To Min", out_lo), ("To Max", out_hi)):
46
+ _set(n.inputs[k], x)
47
+ return n.outputs["Result"]
48
+
49
+
50
+ def mix(nt, fac, a, b):
51
+ n = nt.nodes.new("ShaderNodeMix")
52
+ n.data_type = "RGBA"
53
+ on = lambda name: next(i for i in n.inputs if i.name == name and i.type == "RGBA")
54
+ _set(n.inputs[0], fac)
55
+ _set(on("A"), a)
56
+ _set(on("B"), b)
57
+ return next(o for o in n.outputs if o.type == "RGBA")
58
+
59
+
60
+ def vmath(nt, op, a, b=None):
61
+ n = nt.nodes.new("ShaderNodeVectorMath")
62
+ n.operation = op
63
+ _set(n.inputs[0], a)
64
+ if b is not None:
65
+ _set(n.inputs["Scale"] if op == "SCALE" else n.inputs[1], b)
66
+ return n.outputs[0] if op not in ("DOT_PRODUCT", "LENGTH", "DISTANCE") else n.outputs["Value"]
67
+
68
+
69
+ def rgb(nt, r, g, b):
70
+ n = nt.nodes.new("ShaderNodeRGB")
71
+ n.outputs[0].default_value = (r, g, b, 1.0)
72
+ return n.outputs[0]
73
+
74
+
75
+ def principled(nt, **ins):
76
+ n = nt.nodes.new("ShaderNodeBsdfPrincipled")
77
+ for k, v in ins.items():
78
+ _set(n.inputs[k.replace("_", " ")], v)
79
+ return n
80
+
81
+
82
+ def finish(nt, shader, volume=None):
83
+ out = nt.nodes.new("ShaderNodeOutputMaterial")
84
+ out.target = "CYCLES"
85
+ nt.links.new(shader.outputs[0], out.inputs["Surface"])
86
+ if volume is not None:
87
+ nt.links.new(volume, out.inputs["Volume"])
@@ -0,0 +1,82 @@
1
+ """Brutalist room shell, haze world, and the single cold key light (slit window on the left wall)."""
2
+ import math
3
+
4
+ import bmesh
5
+ import bpy
6
+ from mathutils import Matrix, Vector
7
+
8
+ from nodekit import fresh, finish, math as nmath, remap, node, rgb, vmath
9
+
10
+ # Room: x -5.5..5.5, y -12..0.62 (wall niche back at y=0.62), z 0..4.6
11
+ BACK_Y = 0.62
12
+ CEIL_Z = 4.6
13
+
14
+
15
+ def add_box(coll, name, center, size, mat, bevel=0.0):
16
+ bm = bmesh.new()
17
+ bmesh.ops.create_cube(bm, size=1.0, matrix=Matrix.Translation(center) @ Matrix.Diagonal((*size, 1.0)))
18
+ if bevel:
19
+ bmesh.ops.bevel(bm, geom=list(bm.edges), offset=bevel, segments=2, affect="EDGES")
20
+ me = bpy.data.meshes.new(name)
21
+ bm.to_mesh(me)
22
+ bm.free()
23
+ me.materials.append(mat)
24
+ ob = bpy.data.objects.new(name, me)
25
+ coll.objects.link(ob)
26
+ return ob
27
+
28
+
29
+ def build_room(coll, mats):
30
+ conc, floor = mats["concrete"], mats["floor"]
31
+ add_box(coll, "floor", (0, -5.69, -0.25), (11.2, 12.62, 0.5), floor)
32
+ add_box(coll, "ceiling", (0, -5.69, CEIL_Z + 0.4), (11.2, 12.62, 0.8), conc)
33
+ add_box(coll, "back_wall", (0, BACK_Y + 0.4, CEIL_Z / 2), (11.2, 0.8, CEIL_Z + 1.0), conc)
34
+ add_box(coll, "right_wall", (5.5 + 0.4, -5.69, CEIL_Z / 2), (0.8, 12.62, CEIL_Z + 1.0), conc)
35
+ add_box(coll, "front_wall", (0, -12.4, CEIL_Z / 2), (11.2, 0.8, CEIL_Z + 1.0), conc)
36
+ # left wall with a full-height slit window at y = -5.0
37
+ add_box(coll, "left_wall_a", (-5.9, -8.75, CEIL_Z / 2), (0.8, 6.5, CEIL_Z + 1.0), conc)
38
+ add_box(coll, "left_wall_b", (-5.9, -1.69, CEIL_Z / 2), (0.8, 6.22, CEIL_Z + 1.0), conc)
39
+ for i, (x, z, w) in enumerate(((-2.3, 2.2, 6.0), (1.5, 0.55, 3.0), (-4.9, 1.6, 0.06))):
40
+ add_box(coll, f"strip_{i}", (x, -11.96, z), (w, 0.05, 0.07 if w > 1 else 2.2), mats["strip"])
41
+ # brutalist piers + lintel framing the monitor niche
42
+ for sx in (-1, 1):
43
+ add_box(coll, f"pier_{sx}", (sx * 3.35, -0.35, CEIL_Z / 2), (1.0, 1.95, CEIL_Z), conc, 0.012)
44
+ add_box(coll, "lintel", (0, -0.35, 3.55), (5.7, 1.95, 0.9), conc, 0.012)
45
+ add_box(coll, "plinth", (0, -0.3, 0.12), (5.7, 1.8, 0.24), conc, 0.01)
46
+
47
+
48
+ def build_world_and_light(scene, coll, strength=1.0, haze=1.0, shot="wall"):
49
+ world = bpy.data.worlds.new("haze")
50
+ scene.world = world
51
+ world.use_nodes = True
52
+ nt = world.node_tree
53
+ nt.nodes.clear()
54
+ bg = node(nt, "ShaderNodeBackground", {"Color": (0.002, 0.003, 0.006, 1.0), "Strength": 1.0})
55
+ out = node(nt, "ShaderNodeOutputWorld")
56
+ nt.links.new(bg.outputs[0], out.inputs["Surface"])
57
+ pos = node(nt, "ShaderNodeNewGeometry").outputs["Position"]
58
+ wisp = node(nt, "ShaderNodeTexNoise", {"Vector": vmath(nt, "SCALE", pos, 0.35), "Detail": 3.0}).outputs["Fac"]
59
+ dens = nmath(nt, "MULTIPLY", remap(nt, wisp, 0.25, 0.75, 0.5, 1.5), 0.008 * haze)
60
+ vol = node(nt, "ShaderNodeVolumeScatter", {"Density": dens, "Anisotropy": 0.3, "Color": (0.8, 0.88, 1.0, 1.0)})
61
+ nt.links.new(vol.outputs[0], out.inputs["Volume"])
62
+
63
+ key = bpy.data.lights.new("key", "AREA")
64
+ key.shape = "RECTANGLE"
65
+ key.size, key.size_y = 3.6, 0.6
66
+ key.color = (0.55, 0.72, 1.0)
67
+ key.energy = 1500.0 * strength
68
+ key.spread = math.radians(35)
69
+ ko = bpy.data.objects.new("key", key)
70
+ ko.location = (-7.1, -5.55, 2.2)
71
+ ko.rotation_euler = (0.0, math.radians(-90), math.radians(18))
72
+ coll.objects.link(ko)
73
+ if shot == "closeup":
74
+ spot = bpy.data.lights.new("key_close", "SPOT")
75
+ spot.color, spot.energy = (0.6, 0.78, 1.0), 420.0 * strength
76
+ spot.spot_size, spot.spot_blend, spot.shadow_soft_size = math.radians(30), 0.7, 0.08
77
+ so = bpy.data.objects.new("key_close", spot)
78
+ so.location = (1.6, -2.2, 3.0)
79
+ direction = Vector((0.0, -0.05, 1.55)) - Vector(so.location)
80
+ so.rotation_euler = direction.to_track_quat("-Z", "Y").to_euler()
81
+ coll.objects.link(so)
82
+ return ko
@@ -0,0 +1,219 @@
1
+ """Terminalcore plate: procedural CRT-wall brutalist room rendered with Cycles (Metal GPU, OIDN).
2
+
3
+ Run: blender -b --factory-startup --python scene.py -- --shot wall --out DIR [--width 640 --height 360
4
+ --seconds 4 --fps 30 --samples 48 --frame N --exposure 0 --bloom 1]
5
+ Use scripts/plate.mjs for the full render + H.264 encode.
6
+ """
7
+ import argparse
8
+ import math
9
+ import os
10
+ import random
11
+ import sys
12
+ import time
13
+
14
+ import bpy
15
+ from mathutils import Quaternion
16
+
17
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
18
+
19
+ import gallery # noqa: E402
20
+ import materials as M # noqa: E402
21
+ import room # noqa: E402
22
+ import shots # noqa: E402
23
+ import textures # noqa: E402
24
+ import wall # noqa: E402
25
+
26
+
27
+ def parse():
28
+ ap = argparse.ArgumentParser()
29
+ ap.add_argument("--shot", default="wall")
30
+ ap.add_argument("--out", required=True)
31
+ ap.add_argument("--width", type=int, default=640)
32
+ ap.add_argument("--height", type=int, default=360)
33
+ ap.add_argument("--seconds", type=float, default=4.0)
34
+ ap.add_argument("--fps", type=int, default=30)
35
+ ap.add_argument("--samples", type=int, default=40)
36
+ ap.add_argument("--quality", choices=("preview", "final"), default="preview", help="final: tight adaptive threshold, accurate denoise, camera motion blur")
37
+ ap.add_argument("--frame", type=int, default=0, help="render only this 1-based frame to still_<n>.png")
38
+ ap.add_argument("--exposure", type=float, default=None)
39
+ ap.add_argument("--bloom", type=float, default=None)
40
+ ap.add_argument("--key", type=float, default=1.0, help="key light strength multiplier")
41
+ ap.add_argument("--haze", type=float, default=None, help="volumetric haze density multiplier")
42
+ a = ap.parse_args(sys.argv[sys.argv.index("--") + 1:])
43
+ gallery = a.shot == "gallery"
44
+ for name, wall_default, gallery_default in (("exposure", -0.3, 0.15), ("bloom", 1.0, 0.5), ("haze", 1.4, 1.8)):
45
+ if getattr(a, name) is None:
46
+ setattr(a, name, gallery_default if gallery else wall_default)
47
+ return a
48
+
49
+
50
+ def setup_render(scene, a):
51
+ scene.render.engine = "CYCLES"
52
+ cy = scene.cycles
53
+ prefs = bpy.context.preferences.addons["cycles"].preferences
54
+ prefs.compute_device_type = "METAL"
55
+ prefs.get_devices()
56
+ for d in prefs.devices:
57
+ d.use = d.type == "METAL"
58
+ cy.device = "GPU"
59
+ cy.samples = a.samples
60
+ final = a.quality == "final"
61
+ cy.use_adaptive_sampling = True
62
+ cy.adaptive_threshold = 0.01 if final else 0.03
63
+ cy.use_denoising = True
64
+ cy.denoiser = "OPENIMAGEDENOISE"
65
+ cy.denoising_use_gpu = True
66
+ if final:
67
+ cy.denoising_prefilter = "ACCURATE"
68
+ cy.denoising_quality = "HIGH"
69
+ scene.render.use_motion_blur = True
70
+ scene.render.motion_blur_shutter = 0.5
71
+ scene.render.motion_blur_position = "CENTER"
72
+ cy.max_bounces, cy.diffuse_bounces, cy.glossy_bounces = 6, 3, 4
73
+ cy.transmission_bounces, cy.volume_bounces, cy.transparent_max_bounces = 2, 1, 4
74
+ cy.sample_clamp_indirect = 8.0
75
+ cy.sample_clamp_direct = 0.0
76
+ cy.blur_glossy = 0.3
77
+ cy.volume_step_rate = 1.5
78
+ cy.volume_max_steps = 256
79
+ scene.render.use_persistent_data = True
80
+ scene.render.resolution_x, scene.render.resolution_y = a.width, a.height
81
+ scene.render.resolution_percentage = 100
82
+ scene.render.fps = a.fps
83
+ scene.render.image_settings.file_format = "PNG"
84
+ scene.render.image_settings.color_mode = "RGB"
85
+ scene.view_settings.view_transform = "AgX"
86
+ for look in ("AgX - High Contrast", "AgX - Punchy"):
87
+ try:
88
+ scene.view_settings.look = look
89
+ break
90
+ except TypeError:
91
+ continue
92
+ scene.view_settings.exposure = a.exposure
93
+ scene.frame_start, scene.frame_end = 1, max(1, round(a.seconds * a.fps))
94
+
95
+
96
+ def setup_bloom(scene, strength):
97
+ ng = bpy.data.node_groups.new("plate_comp", "CompositorNodeTree")
98
+ scene.compositing_node_group = ng
99
+ ng.interface.new_socket("Image", in_out="OUTPUT", socket_type="NodeSocketColor")
100
+ rl = ng.nodes.new("CompositorNodeRLayers")
101
+ gl = ng.nodes.new("CompositorNodeGlare")
102
+ out = ng.nodes.new("NodeGroupOutput")
103
+ gl.inputs["Type"].default_value = "Bloom"
104
+ gl.inputs["Threshold"].default_value = 0.9
105
+ gl.inputs["Strength"].default_value = 0.8 * strength
106
+ gl.inputs["Size"].default_value = 0.6
107
+ ng.links.new(rl.outputs["Image"], gl.inputs["Image"])
108
+ ng.links.new(gl.outputs["Image"], out.inputs[0])
109
+
110
+
111
+ def make_camera(scene, coll):
112
+ cam = bpy.data.cameras.new("cam")
113
+ cam.sensor_width = 36.0
114
+ cam.dof.use_dof = True
115
+ ob = bpy.data.objects.new("cam", cam)
116
+ coll.objects.link(ob)
117
+ scene.camera = ob
118
+ return ob
119
+
120
+
121
+ def build(scene, coll, a):
122
+ if a.shot == "gallery":
123
+ return gallery.build(scene, coll, a)
124
+ rng = random.Random(1987)
125
+ mats = {
126
+ "concrete": M.concrete("concrete"), "floor": M.concrete("floor", polished=True, tone=0.11),
127
+ "plastic": M.plastic(), "steel": M.steel(), "rubber": M.rubber(), "led": M.led_random("led", 12.0),
128
+ "vent": M.vent_black(), "strip": M.led("strip", (0.55, 0.78, 1.0), 14.0), "glass_off": M.screen("glass_off", textures.make_image("off", 5), (0.0, 0.0, 0.0), {}, strength=0.0),
129
+ }
130
+ mats["glass_base"] = mats["glass_off"]
131
+ lines = 150.0 if a.shot == "closeup" else 90.0
132
+ screens, anims = {}, {}
133
+ for key, (seed, tint, strength, rate) in wall.VARIANTS.items():
134
+ anims[key] = {}
135
+ screens[key] = M.screen(f"screen_{key}", textures.make_image(f"term_{key}", seed), tint, anims[key], lines=lines, strength=strength, zoom=1.0 if a.shot == "closeup" else 0.5)
136
+ room.build_room(coll, mats)
137
+ room.build_world_and_light(scene, coll, a.key, a.haze, a.shot)
138
+ wall.build_rack(coll, mats)
139
+ wall.build_monitors(coll, mats, screens, rng)
140
+ wall.build_tray_and_cables(coll, mats, rng)
141
+ wall.build_status_array(coll, mats, rng)
142
+ return anims
143
+
144
+
145
+ def apply_pose(cam, p):
146
+ cam.location = p["loc"]
147
+ cam.rotation_mode = "QUATERNION"
148
+ cam.rotation_quaternion = p["quat"] @ Quaternion((0.0, 0.0, 1.0), p["roll"])
149
+ cam.data.lens = p["lens"]
150
+ cam.data.shift_y = p.get("shift_y", 0.0)
151
+ cam.data.dof.aperture_fstop = p["fstop"]
152
+ cam.data.dof.focus_distance = p["focus"]
153
+
154
+
155
+ def bake_camera(scene, cam, a):
156
+ """Keyframe the camera on every frame: Cycles motion blur only sees fcurves, not a frame-change handler."""
157
+ total = scene.frame_end
158
+ for f in range(1, total + 1):
159
+ apply_pose(cam, shots.pose(a.shot, (f - 1) / max(total - 1, 1), f))
160
+ for ob, paths in ((cam, ("location", "rotation_quaternion")), (cam.data, ("lens", "shift_y", "dof.aperture_fstop", "dof.focus_distance"))):
161
+ for path in paths:
162
+ ob.keyframe_insert(path, frame=f)
163
+ scene.frame_set(2)
164
+ y_whole = cam.matrix_world.translation.y
165
+ scene.frame_set(2, subframe=0.5)
166
+ print(f"TIMING camera keyed on {total} frames, subframe dy={cam.matrix_world.translation.y - y_whole:.5f} m, motion_blur={scene.render.use_motion_blur} shutter={scene.render.motion_blur_shutter}", flush=True)
167
+
168
+
169
+ def install_animation(scene, cam, anims, a):
170
+ total = scene.frame_end
171
+ row = 18 / 1152
172
+ baked = a.quality == "final"
173
+
174
+ def on_frame(scn):
175
+ f = scn.frame_current
176
+ t = (f - 1) / max(total - 1, 1)
177
+ secs = (f - 1) / a.fps
178
+ for key, anim in anims.items():
179
+ rate = wall.VARIANTS[key][3] * {"closeup": 1.6, "gallery": 0.55}.get(a.shot, 0.8)
180
+ anim["scroll"].outputs[0].default_value = math.floor(secs * rate) * row
181
+ anim["time"].outputs[0].default_value = secs
182
+ if not baked:
183
+ apply_pose(cam, shots.pose(a.shot, t, f))
184
+
185
+ if baked:
186
+ bake_camera(scene, cam, a)
187
+ bpy.app.handlers.frame_change_pre.append(on_frame)
188
+ return on_frame
189
+
190
+
191
+ def main():
192
+ a = parse()
193
+ scene = bpy.context.scene
194
+ for ob in list(bpy.data.objects):
195
+ bpy.data.objects.remove(ob)
196
+ coll = scene.collection
197
+ setup_render(scene, a)
198
+ if a.bloom > 0:
199
+ setup_bloom(scene, a.bloom)
200
+ t0 = time.time()
201
+ cam = make_camera(scene, coll)
202
+ anims = build(scene, coll, a)
203
+ print(f"TIMING build {time.time() - t0:.1f}s look={scene.view_settings.look}", flush=True)
204
+ on_frame = install_animation(scene, cam, anims, a)
205
+ os.makedirs(a.out, exist_ok=True)
206
+ t1 = time.time()
207
+ if a.frame:
208
+ scene.frame_set(a.frame)
209
+ on_frame(scene)
210
+ scene.render.filepath = os.path.join(a.out, f"still_{a.frame:03d}.png")
211
+ bpy.ops.render.render(write_still=True)
212
+ else:
213
+ os.makedirs(os.path.join(a.out, "frames"), exist_ok=True)
214
+ scene.render.filepath = os.path.join(a.out, "frames", "f_")
215
+ bpy.ops.render.render(animation=True)
216
+ print(f"TIMING render {time.time() - t1:.1f}s", flush=True)
217
+
218
+
219
+ main()
@@ -0,0 +1,48 @@
1
+ """Camera moves: slow cinematic push / slide with a little handheld wander. pose(shot, t, frame) -> dict."""
2
+ import math
3
+
4
+ from mathutils import Vector
5
+
6
+ import wall
7
+
8
+
9
+ def _lerp(a, b, t):
10
+ return tuple(x + (y - x) * t for x, y in zip(a, b))
11
+
12
+
13
+ def _ease(t):
14
+ return t * t * (3.0 - 2.0 * t)
15
+
16
+
17
+ def _hand(f, amp):
18
+ """Smooth pseudo-random wander (sum of incommensurate sines)."""
19
+ s = lambda k, p: math.sin(f * k + p)
20
+ return (amp * (s(0.11, 0.3) + 0.5 * s(0.29, 1.7)), amp * (s(0.13, 2.1) + 0.5 * s(0.31, 0.2)), amp * (s(0.09, 4.0) + 0.5 * s(0.23, 3.1)))
21
+
22
+
23
+ def pose(shot, t, frame):
24
+ hx, hy, hz = wall.monitor_position(*wall.HERO)
25
+ if shot == "closeup":
26
+ e = _ease(t)
27
+ loc = _lerp((0.66, -1.34, 1.57), (0.34, -1.14, 1.50), e)
28
+ target = _lerp((0.02, -0.02, hz + 0.03), (-0.02, -0.02, hz + 0.0), e)
29
+ lens, fstop, amp = 62.0, 2.0, 0.0035
30
+ elif shot == "wall":
31
+ e = _ease(t)
32
+ loc = _lerp((3.5, -8.4, 1.3), (1.6, -6.4, 1.38), e)
33
+ target = _lerp((-0.5, 0.0, 1.7), (-1.0, 0.0, 1.62), e)
34
+ lens, fstop, amp = 28.0, 1.6, 0.012
35
+ elif shot == "gallery":
36
+ e = 0.35 * _ease(t) + 0.65 * t
37
+ loc = (0.0, -9.8 + 1.4 * e, 1.3) # 1.4 m dolly: bench base stays clear of the bottom edge on the last frame
38
+ return {"loc": loc, "quat": Vector((0.0, 1.0, 0.0)).to_track_quat("-Z", "Y"), "roll": 0.0, "lens": 26.0, "fstop": 11.0,
39
+ "focus": -0.05 - loc[1], "shift_y": 0.06}
40
+ else:
41
+ raise SystemExit(f"unknown shot: {shot}")
42
+ hx_, hy_, hz_ = _hand(frame, amp)
43
+ loc = (loc[0] + hx_, loc[1] + hy_ * 0.5, loc[2] + hz_)
44
+ target = (target[0] + hz_ * 0.6, target[1], target[2] + hx_ * 0.6)
45
+ dist = (Vector(target) - Vector(loc)).length
46
+ quat = (Vector(target) - Vector(loc)).to_track_quat("-Z", "Y")
47
+ roll = math.radians(0.25) * math.sin(frame * 0.07 + 1.0) * (0.4 if shot == "closeup" else 1.0)
48
+ return {"loc": loc, "quat": quat, "roll": roll, "lens": lens, "fstop": fstop, "focus": dist}