@basementstudio/shader-lab 0.1.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/easings.d.ts +3 -0
- package/dist/src/easings.js +3 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +4 -0
- package/dist/src/lib/editor/custom-shader/shared.d.ts +1 -0
- package/dist/src/lib/editor/custom-shader/shared.js +1 -0
- package/dist/src/renderer/ascii-atlas.d.ts +5 -0
- package/dist/src/renderer/ascii-atlas.js +61 -0
- package/dist/src/renderer/ascii-pass.d.ts +50 -0
- package/dist/src/renderer/ascii-pass.js +271 -0
- package/dist/src/renderer/asset-url.d.ts +1 -0
- package/dist/src/renderer/asset-url.js +3 -0
- package/dist/src/renderer/blend-modes.d.ts +4 -0
- package/dist/src/renderer/blend-modes.js +157 -0
- package/dist/src/renderer/contracts.d.ts +26 -0
- package/dist/src/renderer/contracts.js +13 -0
- package/dist/src/renderer/create-webgpu-renderer.d.ts +3 -0
- package/dist/src/renderer/create-webgpu-renderer.js +37 -0
- package/dist/src/renderer/crt-pass.d.ts +72 -0
- package/dist/src/renderer/crt-pass.js +536 -0
- package/dist/src/renderer/custom-shader-pass.d.ts +17 -0
- package/dist/src/renderer/custom-shader-pass.js +79 -0
- package/dist/src/renderer/custom-shader-runtime.d.ts +16 -0
- package/dist/src/renderer/custom-shader-runtime.js +169 -0
- package/dist/src/renderer/dither-textures.d.ts +8 -0
- package/dist/src/renderer/dither-textures.js +66 -0
- package/dist/src/renderer/dithering-pass.d.ts +45 -0
- package/dist/src/renderer/dithering-pass.js +229 -0
- package/dist/src/renderer/gradient-pass.d.ts +39 -0
- package/dist/src/renderer/gradient-pass.js +358 -0
- package/dist/src/renderer/halftone-pass.d.ts +65 -0
- package/dist/src/renderer/halftone-pass.js +530 -0
- package/dist/src/renderer/ink-pass.d.ts +84 -0
- package/dist/src/renderer/ink-pass.js +526 -0
- package/dist/src/renderer/live-pass.d.ts +31 -0
- package/dist/src/renderer/live-pass.js +136 -0
- package/dist/src/renderer/media-pass.d.ts +32 -0
- package/dist/src/renderer/media-pass.js +130 -0
- package/dist/src/renderer/media-texture.d.ts +8 -0
- package/dist/src/renderer/media-texture.js +41 -0
- package/dist/src/renderer/particle-grid-pass.d.ts +48 -0
- package/dist/src/renderer/particle-grid-pass.js +269 -0
- package/dist/src/renderer/pass-node.d.ts +36 -0
- package/dist/src/renderer/pass-node.js +120 -0
- package/dist/src/renderer/pattern-atlas.d.ts +8 -0
- package/dist/src/renderer/pattern-atlas.js +79 -0
- package/dist/src/renderer/pattern-pass.d.ts +58 -0
- package/dist/src/renderer/pattern-pass.js +316 -0
- package/dist/src/renderer/pipeline-manager.d.ts +39 -0
- package/dist/src/renderer/pipeline-manager.js +287 -0
- package/dist/src/renderer/pixel-sorting-pass.d.ts +33 -0
- package/dist/src/renderer/pixel-sorting-pass.js +179 -0
- package/dist/src/renderer/shaders/tsl/color/tonemapping.d.ts +9 -0
- package/dist/src/renderer/shaders/tsl/color/tonemapping.js +59 -0
- package/dist/src/renderer/shaders/tsl/cosine-palette.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/cosine-palette.ts → dist/src/renderer/shaders/tsl/cosine-palette.js} +3 -4
- package/dist/src/renderer/shaders/tsl/noise/common.d.ts +5 -0
- package/dist/src/renderer/shaders/tsl/noise/common.js +24 -0
- package/dist/src/renderer/shaders/tsl/noise/curl-noise-3d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/curl-noise-3d.js +27 -0
- package/dist/src/renderer/shaders/tsl/noise/curl-noise-4d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/curl-noise-4d.js +27 -0
- package/dist/src/renderer/shaders/tsl/noise/fbm.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/fbm.js +11 -0
- package/dist/src/renderer/shaders/tsl/noise/perlin-noise-3d.d.ts +5 -0
- package/dist/src/renderer/shaders/tsl/noise/perlin-noise-3d.js +66 -0
- package/dist/src/renderer/shaders/tsl/noise/ridge-noise.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/ridge-noise.js +19 -0
- package/dist/src/renderer/shaders/tsl/noise/simplex-noise-3d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/simplex-noise-3d.js +44 -0
- package/dist/src/renderer/shaders/tsl/noise/simplex-noise-4d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/simplex-noise-4d.js +51 -0
- package/dist/src/renderer/shaders/tsl/noise/turbulence.d.ts +7 -0
- package/dist/src/renderer/shaders/tsl/noise/turbulence.js +34 -0
- package/dist/src/renderer/shaders/tsl/noise/value-noise-3d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/value-noise-3d.js +27 -0
- package/dist/src/renderer/shaders/tsl/noise/voronoi-noise-3d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/noise/voronoi-noise-3d.js +45 -0
- package/dist/src/renderer/shaders/tsl/patterns/bloom-edge-pattern.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/patterns/bloom-edge-pattern.js +13 -0
- package/dist/src/renderer/shaders/tsl/patterns/bloom.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/patterns/bloom.ts → dist/src/renderer/shaders/tsl/patterns/bloom.js} +4 -6
- package/dist/src/renderer/shaders/tsl/patterns/canvas-weave-pattern.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/patterns/canvas-weave-pattern.js +16 -0
- package/dist/src/renderer/shaders/tsl/patterns/grain-texture-pattern.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/patterns/grain-texture-pattern.ts → dist/src/renderer/shaders/tsl/patterns/grain-texture-pattern.js} +3 -4
- package/dist/src/renderer/shaders/tsl/patterns/repeating-pattern.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/patterns/repeating-pattern.ts → dist/src/renderer/shaders/tsl/patterns/repeating-pattern.js} +4 -6
- package/dist/src/renderer/shaders/tsl/utils/atan2.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/atan2.js +7 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-conj.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-conj.ts → dist/src/renderer/shaders/tsl/utils/complex-conj.js} +3 -4
- package/dist/src/renderer/shaders/tsl/utils/complex-cos.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-cos.js +9 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-div.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-div.js +6 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-log.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-log.js +6 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-mobius.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-mobius.js +10 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-mul.d.ts +4 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-mul.ts → dist/src/renderer/shaders/tsl/utils/complex-mul.js} +3 -4
- package/dist/src/renderer/shaders/tsl/utils/complex-pow.d.ts +5 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-pow.js +14 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-sin.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-sin.js +9 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-sqrt.d.ts +5 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-sqrt.js +12 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-tan.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-tan.js +11 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-to-polar.d.ts +4 -0
- package/dist/src/renderer/shaders/tsl/utils/complex-to-polar.js +9 -0
- package/dist/src/renderer/shaders/tsl/utils/hyperbolic.d.ts +8 -0
- package/{packages/shader-lab-react/src/renderer/shaders/tsl/utils/hyperbolic.ts → dist/src/renderer/shaders/tsl/utils/hyperbolic.js} +7 -11
- package/dist/src/renderer/shaders/tsl/utils/index.d.ts +38 -0
- package/dist/src/renderer/shaders/tsl/utils/index.js +39 -0
- package/dist/src/renderer/shaders/tsl/utils/rotate.d.ts +2 -0
- package/dist/src/renderer/shaders/tsl/utils/rotate.js +7 -0
- package/dist/src/renderer/shaders/tsl/utils/screen-aspect-uv.d.ts +2 -0
- package/dist/src/renderer/shaders/tsl/utils/screen-aspect-uv.js +6 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-box-2d.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-box-2d.js +5 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-diamond.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-diamond.js +5 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-rhombus.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-rhombus.js +14 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-sphere.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/sd-sphere.js +5 -0
- package/dist/src/renderer/shaders/tsl/utils/smax.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/smax.js +6 -0
- package/dist/src/renderer/shaders/tsl/utils/smin.d.ts +1 -0
- package/dist/src/renderer/shaders/tsl/utils/smin.js +6 -0
- package/dist/src/renderer/text-pass.d.ts +23 -0
- package/dist/src/renderer/text-pass.js +129 -0
- package/dist/src/runtime-clock.d.ts +9 -0
- package/dist/src/runtime-clock.js +20 -0
- package/dist/src/runtime-frame.d.ts +11 -0
- package/dist/src/runtime-frame.js +12 -0
- package/dist/src/shader-lab-composition.d.ts +9 -0
- package/dist/src/shader-lab-composition.js +96 -0
- package/dist/src/timeline.d.ts +8 -0
- package/dist/src/timeline.js +179 -0
- package/dist/src/types/editor.d.ts +3 -0
- package/dist/src/types/editor.js +1 -0
- package/dist/src/types.d.ts +81 -0
- package/dist/src/types.js +1 -0
- package/package.json +28 -65
- package/.biome/plugins/README.md +0 -21
- package/.biome/plugins/no-anchor-element.grit +0 -12
- package/.biome/plugins/no-relative-parent-imports.grit +0 -10
- package/.biome/plugins/no-unnecessary-forwardref.grit +0 -9
- package/.changeset/README.md +0 -17
- package/.changeset/config.json +0 -11
- package/.editorconfig +0 -40
- package/.env.example +0 -81
- package/.gitattributes +0 -19
- package/.github/workflows/canary.yml +0 -80
- package/.github/workflows/ci.yml +0 -37
- package/.github/workflows/release.yml +0 -56
- package/.tldrignore +0 -84
- package/.vscode/extensions.json +0 -20
- package/.vscode/settings.json +0 -105
- package/biome.json +0 -249
- package/bun.lock +0 -1224
- package/next.config.ts +0 -131
- package/packages/shader-lab-react/CHANGELOG.md +0 -9
- package/packages/shader-lab-react/README.md +0 -119
- package/packages/shader-lab-react/package.json +0 -36
- package/packages/shader-lab-react/scripts/fix-esm-specifiers.mjs +0 -57
- package/packages/shader-lab-react/scripts/prepare-dist.mjs +0 -4
- package/packages/shader-lab-react/src/ambient/three-tsl.d.ts +0 -146
- package/packages/shader-lab-react/src/ambient/three-webgpu.d.ts +0 -51
- package/packages/shader-lab-react/src/easings.ts +0 -4
- package/packages/shader-lab-react/src/index.ts +0 -35
- package/packages/shader-lab-react/src/lib/editor/custom-shader/shared.ts +0 -2
- package/packages/shader-lab-react/src/renderer/ascii-atlas.ts +0 -83
- package/packages/shader-lab-react/src/renderer/ascii-pass.ts +0 -416
- package/packages/shader-lab-react/src/renderer/asset-url.ts +0 -3
- package/packages/shader-lab-react/src/renderer/blend-modes.ts +0 -229
- package/packages/shader-lab-react/src/renderer/contracts.ts +0 -54
- package/packages/shader-lab-react/src/renderer/create-webgpu-renderer.ts +0 -48
- package/packages/shader-lab-react/src/renderer/crt-pass.ts +0 -1040
- package/packages/shader-lab-react/src/renderer/custom-shader-pass.ts +0 -108
- package/packages/shader-lab-react/src/renderer/custom-shader-runtime.ts +0 -309
- package/packages/shader-lab-react/src/renderer/dither-textures.ts +0 -99
- package/packages/shader-lab-react/src/renderer/dithering-pass.ts +0 -322
- package/packages/shader-lab-react/src/renderer/gradient-pass.ts +0 -521
- package/packages/shader-lab-react/src/renderer/halftone-pass.ts +0 -932
- package/packages/shader-lab-react/src/renderer/ink-pass.ts +0 -802
- package/packages/shader-lab-react/src/renderer/live-pass.ts +0 -194
- package/packages/shader-lab-react/src/renderer/media-pass.ts +0 -187
- package/packages/shader-lab-react/src/renderer/media-texture.ts +0 -66
- package/packages/shader-lab-react/src/renderer/particle-grid-pass.ts +0 -389
- package/packages/shader-lab-react/src/renderer/pass-node.ts +0 -209
- package/packages/shader-lab-react/src/renderer/pattern-atlas.ts +0 -133
- package/packages/shader-lab-react/src/renderer/pattern-pass.ts +0 -552
- package/packages/shader-lab-react/src/renderer/pipeline-manager.ts +0 -369
- package/packages/shader-lab-react/src/renderer/pixel-sorting-pass.ts +0 -277
- package/packages/shader-lab-react/src/renderer/shaders/tsl/color/tonemapping.ts +0 -87
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/common.ts +0 -31
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/curl-noise-3d.ts +0 -36
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/curl-noise-4d.ts +0 -36
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/fbm.ts +0 -13
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/perlin-noise-3d.ts +0 -96
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/ridge-noise.ts +0 -24
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/simplex-noise-3d.ts +0 -79
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/simplex-noise-4d.ts +0 -89
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/turbulence.ts +0 -56
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/value-noise-3d.ts +0 -32
- package/packages/shader-lab-react/src/renderer/shaders/tsl/noise/voronoi-noise-3d.ts +0 -60
- package/packages/shader-lab-react/src/renderer/shaders/tsl/patterns/bloom-edge-pattern.ts +0 -15
- package/packages/shader-lab-react/src/renderer/shaders/tsl/patterns/canvas-weave-pattern.ts +0 -24
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/atan2.ts +0 -9
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-cos.ts +0 -10
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-div.ts +0 -11
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-log.ts +0 -7
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-mobius.ts +0 -12
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-pow.ts +0 -16
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-sin.ts +0 -10
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-sqrt.ts +0 -18
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-tan.ts +0 -12
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/complex-to-polar.ts +0 -10
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/index.ts +0 -48
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/rotate.ts +0 -15
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/screen-aspect-uv.ts +0 -15
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/sd-box-2d.ts +0 -6
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/sd-diamond.ts +0 -6
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/sd-rhombus.ts +0 -27
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/sd-sphere.ts +0 -6
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/smax.ts +0 -7
- package/packages/shader-lab-react/src/renderer/shaders/tsl/utils/smin.ts +0 -7
- package/packages/shader-lab-react/src/renderer/text-pass.ts +0 -176
- package/packages/shader-lab-react/src/runtime-clock.ts +0 -42
- package/packages/shader-lab-react/src/runtime-frame.ts +0 -29
- package/packages/shader-lab-react/src/shader-lab-composition.tsx +0 -163
- package/packages/shader-lab-react/src/timeline.ts +0 -283
- package/packages/shader-lab-react/src/types/editor.ts +0 -5
- package/packages/shader-lab-react/src/types.ts +0 -141
- package/packages/shader-lab-react/tsconfig.build.json +0 -8
- package/packages/shader-lab-react/tsconfig.json +0 -21
- package/postcss.config.mjs +0 -5
- package/public/assets/fonts/msdf/geist-mono/GeistMono-Regular-msdf-atlas.png +0 -0
- package/public/assets/fonts/msdf/geist-mono/GeistMono-Regular-msdf.json +0 -1412
- package/public/assets/patterns/bars/1.svg +0 -3
- package/public/assets/patterns/bars/2.svg +0 -3
- package/public/assets/patterns/bars/3.svg +0 -3
- package/public/assets/patterns/bars/4.svg +0 -3
- package/public/assets/patterns/bars/5.svg +0 -3
- package/public/assets/patterns/bars/6.svg +0 -3
- package/public/assets/patterns/candles/1.svg +0 -3
- package/public/assets/patterns/candles/2.svg +0 -3
- package/public/assets/patterns/candles/3.svg +0 -3
- package/public/assets/patterns/candles/4.svg +0 -3
- package/public/assets/patterns/shapes/1.svg +0 -3
- package/public/assets/patterns/shapes/2.svg +0 -3
- package/public/assets/patterns/shapes/3.svg +0 -3
- package/public/assets/patterns/shapes/4.svg +0 -4
- package/public/assets/patterns/shapes/5.svg +0 -3
- package/public/assets/patterns/shapes/6.svg +0 -4
- package/public/fonts/geist/Geist-Mono.woff2 +0 -0
- package/public/textures/blue-noise.png +0 -0
- package/public/textures/crt-mask.png +0 -0
- package/src/app/design/page.tsx +0 -398
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -280
- package/src/app/layout.tsx +0 -89
- package/src/app/page.tsx +0 -20
- package/src/app/robots.ts +0 -13
- package/src/app/sitemap.ts +0 -13
- package/src/components/editor/editor-canvas-viewport.tsx +0 -116
- package/src/components/editor/editor-export-dialog.tsx +0 -1177
- package/src/components/editor/editor-timeline-overlay.tsx +0 -983
- package/src/components/editor/editor-topbar.tsx +0 -287
- package/src/components/editor/layer-sidebar.tsx +0 -738
- package/src/components/editor/properties-sidebar-content.tsx +0 -574
- package/src/components/editor/properties-sidebar-fields.tsx +0 -389
- package/src/components/editor/properties-sidebar-utils.ts +0 -178
- package/src/components/editor/properties-sidebar.tsx +0 -421
- package/src/components/ui/button/index.tsx +0 -57
- package/src/components/ui/color-picker/index.tsx +0 -358
- package/src/components/ui/glass-panel/index.tsx +0 -45
- package/src/components/ui/icon-button/index.tsx +0 -46
- package/src/components/ui/select/index.tsx +0 -136
- package/src/components/ui/slider/index.tsx +0 -192
- package/src/components/ui/toggle/index.tsx +0 -34
- package/src/components/ui/typography/index.tsx +0 -61
- package/src/components/ui/xy-pad/index.tsx +0 -160
- package/src/features/editor/components/editor-export-dialog.module.css +0 -271
- package/src/hooks/use-editor-renderer.ts +0 -182
- package/src/lib/app.ts +0 -6
- package/src/lib/cn.ts +0 -7
- package/src/lib/easings.ts +0 -240
- package/src/lib/editor/config/layer-registry.ts +0 -2434
- package/src/lib/editor/custom-shader/shared.ts +0 -28
- package/src/lib/editor/export.ts +0 -420
- package/src/lib/editor/history.ts +0 -71
- package/src/lib/editor/layers.ts +0 -76
- package/src/lib/editor/parameter-schema.ts +0 -75
- package/src/lib/editor/project-file.ts +0 -145
- package/src/lib/editor/shader-export-snippet.ts +0 -37
- package/src/lib/editor/shader-export.ts +0 -315
- package/src/lib/editor/timeline/evaluate.ts +0 -252
- package/src/lib/editor/view-transform.ts +0 -58
- package/src/lib/fonts.ts +0 -28
- package/src/renderer/ascii-atlas.ts +0 -83
- package/src/renderer/ascii-pass.ts +0 -416
- package/src/renderer/blend-modes.ts +0 -229
- package/src/renderer/contracts.ts +0 -161
- package/src/renderer/create-webgpu-renderer.ts +0 -48
- package/src/renderer/crt-pass.ts +0 -1040
- package/src/renderer/custom-shader-pass.ts +0 -117
- package/src/renderer/custom-shader-runtime.ts +0 -309
- package/src/renderer/dither-textures.ts +0 -99
- package/src/renderer/dithering-pass.ts +0 -322
- package/src/renderer/gradient-pass.ts +0 -520
- package/src/renderer/halftone-pass.ts +0 -932
- package/src/renderer/ink-pass.ts +0 -683
- package/src/renderer/live-pass.ts +0 -194
- package/src/renderer/media-pass.ts +0 -187
- package/src/renderer/media-texture.ts +0 -66
- package/src/renderer/particle-grid-pass.ts +0 -389
- package/src/renderer/pass-node-factory.ts +0 -33
- package/src/renderer/pass-node.ts +0 -209
- package/src/renderer/pattern-atlas.ts +0 -97
- package/src/renderer/pattern-pass.ts +0 -552
- package/src/renderer/pipeline-manager.ts +0 -343
- package/src/renderer/pixel-sorting-pass.ts +0 -277
- package/src/renderer/project-clock.ts +0 -57
- package/src/renderer/shaders/tsl/color/tonemapping.ts +0 -86
- package/src/renderer/shaders/tsl/cosine-palette.ts +0 -8
- package/src/renderer/shaders/tsl/noise/common.ts +0 -30
- package/src/renderer/shaders/tsl/noise/curl-noise-3d.ts +0 -35
- package/src/renderer/shaders/tsl/noise/curl-noise-4d.ts +0 -35
- package/src/renderer/shaders/tsl/noise/fbm.ts +0 -12
- package/src/renderer/shaders/tsl/noise/perlin-noise-3d.ts +0 -97
- package/src/renderer/shaders/tsl/noise/ridge-noise.ts +0 -23
- package/src/renderer/shaders/tsl/noise/simplex-noise-3d.ts +0 -78
- package/src/renderer/shaders/tsl/noise/simplex-noise-4d.ts +0 -88
- package/src/renderer/shaders/tsl/noise/turbulence.ts +0 -55
- package/src/renderer/shaders/tsl/noise/value-noise-3d.ts +0 -31
- package/src/renderer/shaders/tsl/noise/voronoi-noise-3d.ts +0 -59
- package/src/renderer/shaders/tsl/patterns/bloom-edge-pattern.ts +0 -14
- package/src/renderer/shaders/tsl/patterns/bloom.ts +0 -10
- package/src/renderer/shaders/tsl/patterns/canvas-weave-pattern.ts +0 -23
- package/src/renderer/shaders/tsl/patterns/grain-texture-pattern.ts +0 -8
- package/src/renderer/shaders/tsl/patterns/repeating-pattern.ts +0 -10
- package/src/renderer/shaders/tsl/utils/atan2.ts +0 -8
- package/src/renderer/shaders/tsl/utils/complex-conj.ts +0 -8
- package/src/renderer/shaders/tsl/utils/complex-cos.ts +0 -9
- package/src/renderer/shaders/tsl/utils/complex-div.ts +0 -10
- package/src/renderer/shaders/tsl/utils/complex-log.ts +0 -6
- package/src/renderer/shaders/tsl/utils/complex-mobius.ts +0 -11
- package/src/renderer/shaders/tsl/utils/complex-mul.ts +0 -8
- package/src/renderer/shaders/tsl/utils/complex-pow.ts +0 -15
- package/src/renderer/shaders/tsl/utils/complex-sin.ts +0 -9
- package/src/renderer/shaders/tsl/utils/complex-sqrt.ts +0 -17
- package/src/renderer/shaders/tsl/utils/complex-tan.ts +0 -11
- package/src/renderer/shaders/tsl/utils/complex-to-polar.ts +0 -9
- package/src/renderer/shaders/tsl/utils/hyperbolic.ts +0 -19
- package/src/renderer/shaders/tsl/utils/index.ts +0 -47
- package/src/renderer/shaders/tsl/utils/rotate.ts +0 -14
- package/src/renderer/shaders/tsl/utils/screen-aspect-uv.ts +0 -14
- package/src/renderer/shaders/tsl/utils/sd-box-2d.ts +0 -5
- package/src/renderer/shaders/tsl/utils/sd-diamond.ts +0 -5
- package/src/renderer/shaders/tsl/utils/sd-rhombus.ts +0 -26
- package/src/renderer/shaders/tsl/utils/sd-sphere.ts +0 -5
- package/src/renderer/shaders/tsl/utils/smax.ts +0 -7
- package/src/renderer/shaders/tsl/utils/smin.ts +0 -6
- package/src/renderer/text-pass.ts +0 -176
- package/src/store/asset-store.ts +0 -193
- package/src/store/editor-store.ts +0 -223
- package/src/store/history-store.ts +0 -172
- package/src/store/index.ts +0 -31
- package/src/store/layer-store.ts +0 -675
- package/src/store/timeline-store.ts +0 -572
- package/src/types/assets.d.ts +0 -6
- package/src/types/css.d.ts +0 -21
- package/src/types/editor.ts +0 -357
- package/src/types/react.d.ts +0 -15
- package/src/types/three-tsl.d.ts +0 -146
- package/src/types/three-webgpu.d.ts +0 -51
- package/tsconfig.json +0 -49
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/1.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/2.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/3.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/4.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/5.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/bars/6.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/candles/1.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/candles/2.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/candles/3.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/candles/4.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/1.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/2.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/3.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/4.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/5.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/patterns/shapes/6.svg +0 -0
- /package/{packages/shader-lab-react/assets → assets}/textures/blue-noise.png +0 -0
package/next.config.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import withBundleAnalyzer from "@next/bundle-analyzer"
|
|
2
|
-
import type { NextConfig } from "next"
|
|
3
|
-
|
|
4
|
-
const nextConfig: NextConfig = {
|
|
5
|
-
reactStrictMode: true,
|
|
6
|
-
reactCompiler: true,
|
|
7
|
-
typedRoutes: true,
|
|
8
|
-
turbopack: {
|
|
9
|
-
rules: {
|
|
10
|
-
"*.svg": {
|
|
11
|
-
loaders: [
|
|
12
|
-
{
|
|
13
|
-
loader: "@svgr/webpack",
|
|
14
|
-
options: {
|
|
15
|
-
memo: true,
|
|
16
|
-
dimensions: false,
|
|
17
|
-
svgoConfig: {
|
|
18
|
-
multipass: true,
|
|
19
|
-
plugins: [
|
|
20
|
-
"removeDimensions",
|
|
21
|
-
"removeOffCanvasPaths",
|
|
22
|
-
"reusePaths",
|
|
23
|
-
"removeElementsByAttr",
|
|
24
|
-
"removeStyleElement",
|
|
25
|
-
"removeScriptElement",
|
|
26
|
-
"prefixIds",
|
|
27
|
-
"cleanupIds",
|
|
28
|
-
{
|
|
29
|
-
name: "cleanupNumericValues",
|
|
30
|
-
params: {
|
|
31
|
-
floatPrecision: 1,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "convertPathData",
|
|
36
|
-
params: {
|
|
37
|
-
floatPrecision: 1,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "convertTransform",
|
|
42
|
-
params: {
|
|
43
|
-
floatPrecision: 1,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "cleanupListOfValues",
|
|
48
|
-
params: {
|
|
49
|
-
floatPrecision: 1,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
as: "*.js",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
cacheComponents: true,
|
|
62
|
-
experimental: {
|
|
63
|
-
browserDebugInfoInTerminal: true,
|
|
64
|
-
optimizePackageImports: [
|
|
65
|
-
"@react-three/drei",
|
|
66
|
-
"@react-three/fiber",
|
|
67
|
-
"gsap",
|
|
68
|
-
"three",
|
|
69
|
-
"postprocessing",
|
|
70
|
-
"lenis",
|
|
71
|
-
"zustand",
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
images: {
|
|
75
|
-
dangerouslyAllowSVG: true,
|
|
76
|
-
remotePatterns: [],
|
|
77
|
-
minimumCacheTTL: 60 * 60 * 24 * 30, // 30 days
|
|
78
|
-
qualities: [90],
|
|
79
|
-
formats: ["image/avif", "image/webp"],
|
|
80
|
-
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
81
|
-
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
|
82
|
-
},
|
|
83
|
-
headers: async () => [
|
|
84
|
-
{
|
|
85
|
-
source: "/(.*)",
|
|
86
|
-
headers: [
|
|
87
|
-
{
|
|
88
|
-
key: "X-Content-Type-Options",
|
|
89
|
-
value: "nosniff",
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
key: "Content-Security-Policy",
|
|
93
|
-
value: "frame-ancestors 'self';",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
key: "X-Frame-Options",
|
|
97
|
-
value: "SAMEORIGIN",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
key: "X-XSS-Protection",
|
|
101
|
-
value: "1; mode=block",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
key: "X-DNS-Prefetch-Control",
|
|
105
|
-
value: "on",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
key: "Strict-Transport-Security",
|
|
109
|
-
value: "max-age=63072000; includeSubDomains; preload",
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
key: "Permissions-Policy",
|
|
113
|
-
value: "camera=(self), microphone=(), geolocation=()",
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
redirects: async () => [],
|
|
119
|
-
rewrites: async () => [],
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const bundleAnalyzerPlugin = withBundleAnalyzer({
|
|
123
|
-
enabled: process.env.ANALYZE === "true",
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
const NextApp = () => {
|
|
127
|
-
const plugins = [bundleAnalyzerPlugin]
|
|
128
|
-
return plugins.reduce((config, plugin) => plugin(config), nextConfig)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export default NextApp
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# @basementstudio/shader-lab
|
|
2
|
-
|
|
3
|
-
<a href="https://basement.studio"><img alt="basement.studio logo" src="https://img.shields.io/badge/MADE%20BY%20basement.studio-000000.svg?style=for-the-badge&labelColor=000"></a>
|
|
4
|
-
<a href="https://www.npmjs.com/package/@basementstudio/shader-lab"><img alt="NPM version" src="https://img.shields.io/npm/v/%40basementstudio%2Fshader-lab.svg?style=for-the-badge&labelColor=000000"></a>
|
|
5
|
-
<a href="https://basement.studio"><img alt="Website" src="https://img.shields.io/badge/WEBSITE-basement.studio-a6d600.svg?style=for-the-badge&labelColor=000000"></a>
|
|
6
|
-
|
|
7
|
-
`@basementstudio/shader-lab` is a portable React runtime for rendering Shader Lab compositions exported from the editor.
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
- Render exported Shader Lab configs inside React apps
|
|
12
|
-
- Play Shader Lab timelines at runtime
|
|
13
|
-
- Support Shader Lab source and effect layers in a standalone runtime
|
|
14
|
-
- Use exported compositions without shipping the full editor
|
|
15
|
-
|
|
16
|
-
## Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @basementstudio/shader-lab three
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
bun add @basementstudio/shader-lab three
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Peer Dependencies
|
|
27
|
-
|
|
28
|
-
- `react`
|
|
29
|
-
- `react-dom`
|
|
30
|
-
- `three`
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
"use client"
|
|
36
|
-
|
|
37
|
-
import { ShaderLabComposition, type ShaderLabConfig } from "@basementstudio/shader-lab"
|
|
38
|
-
|
|
39
|
-
const config: ShaderLabConfig = {
|
|
40
|
-
composition: {
|
|
41
|
-
width: 1512,
|
|
42
|
-
height: 909,
|
|
43
|
-
},
|
|
44
|
-
layers: [],
|
|
45
|
-
timeline: {
|
|
46
|
-
duration: 6,
|
|
47
|
-
loop: true,
|
|
48
|
-
tracks: [],
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default function Example() {
|
|
53
|
-
return (
|
|
54
|
-
<div style={{ width: "100%", maxWidth: 1200 }}>
|
|
55
|
-
<ShaderLabComposition config={config} />
|
|
56
|
-
</div>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Listen for runtime errors:
|
|
62
|
-
|
|
63
|
-
```tsx
|
|
64
|
-
<ShaderLabComposition
|
|
65
|
-
config={config}
|
|
66
|
-
onRuntimeError={(message) => {
|
|
67
|
-
console.error(message)
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Component API
|
|
73
|
-
|
|
74
|
-
### `ShaderLabComposition`
|
|
75
|
-
|
|
76
|
-
| Prop | Description |
|
|
77
|
-
| --- | --- |
|
|
78
|
-
| `config` | Exported `ShaderLabConfig` object |
|
|
79
|
-
| `className` | Optional wrapper class name |
|
|
80
|
-
| `style` | Optional wrapper styles |
|
|
81
|
-
| `onRuntimeError` | Optional callback for initialization or asset-loading errors |
|
|
82
|
-
|
|
83
|
-
## Exports
|
|
84
|
-
|
|
85
|
-
- `ShaderLabComposition`
|
|
86
|
-
- `createRuntimeClock`
|
|
87
|
-
- `advanceRuntimeClock`
|
|
88
|
-
- `buildRuntimeFrame`
|
|
89
|
-
- `evaluateTimelineForLayers`
|
|
90
|
-
- `resolveEvaluatedLayers`
|
|
91
|
-
- runtime config and timeline types
|
|
92
|
-
|
|
93
|
-
## Notes
|
|
94
|
-
|
|
95
|
-
- `ShaderLabComposition` is a client component and should be used from a `"use client"` module
|
|
96
|
-
- The component fills the width of its container and preserves the exported composition aspect ratio
|
|
97
|
-
- WebGPU support is required in the browser
|
|
98
|
-
- Media source layers expect accessible asset URLs in `layer.asset.src`
|
|
99
|
-
|
|
100
|
-
## Included Runtime Support
|
|
101
|
-
|
|
102
|
-
- Gradient
|
|
103
|
-
- Text
|
|
104
|
-
- Custom shader
|
|
105
|
-
- Image and video sources
|
|
106
|
-
- Live camera input
|
|
107
|
-
- ASCII
|
|
108
|
-
- Pattern
|
|
109
|
-
- Ink
|
|
110
|
-
- Halftone
|
|
111
|
-
- Dithering
|
|
112
|
-
- CRT
|
|
113
|
-
- Particle grid
|
|
114
|
-
- Pixel sorting
|
|
115
|
-
|
|
116
|
-
## Links
|
|
117
|
-
|
|
118
|
-
- Website: [basement.studio](https://basement.studio/)
|
|
119
|
-
- npm: [@basementstudio/shader-lab](https://www.npmjs.com/package/@basementstudio/shader-lab)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@basementstudio/shader-lab",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Portable React runtime for Shader Lab exports.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"main": "./dist/src/index.js",
|
|
8
|
-
"types": "./dist/src/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"assets"
|
|
12
|
-
],
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/src/index.d.ts",
|
|
16
|
-
"default": "./dist/src/index.js"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"typescript": "^5.9.3"
|
|
24
|
-
},
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"react": "^19.0.0",
|
|
27
|
-
"react-dom": "^19.0.0",
|
|
28
|
-
"three": "^0.183.0"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "node ./scripts/prepare-dist.mjs && bun x tsc -p tsconfig.build.json && node ./scripts/fix-esm-specifiers.mjs",
|
|
32
|
-
"lint": "biome lint src --max-diagnostics=200",
|
|
33
|
-
"prepack": "bun run build",
|
|
34
|
-
"typecheck": "bun x tsc -p tsconfig.json --noEmit"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile, writeFile } from "node:fs/promises"
|
|
2
|
-
|
|
3
|
-
const DIST_DIR = new URL("../dist/", import.meta.url)
|
|
4
|
-
|
|
5
|
-
const JS_IMPORT_PATTERN =
|
|
6
|
-
/(from\s+["'])(\.\.?\/[^"']+)(["'])|(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g
|
|
7
|
-
|
|
8
|
-
async function collectJsFiles(directoryUrl) {
|
|
9
|
-
const entries = await readdir(directoryUrl, { withFileTypes: true })
|
|
10
|
-
const files = await Promise.all(
|
|
11
|
-
entries.map(async (entry) => {
|
|
12
|
-
const nextUrl = new URL(`${entry.name}${entry.isDirectory() ? "/" : ""}`, directoryUrl)
|
|
13
|
-
|
|
14
|
-
if (entry.isDirectory()) {
|
|
15
|
-
return collectJsFiles(nextUrl)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return entry.name.endsWith(".js") ? [nextUrl] : []
|
|
19
|
-
}),
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
return files.flat()
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function withJsExtension(specifier) {
|
|
26
|
-
return /\.[cm]?js$|\.json$|\.node$/.test(specifier) ? specifier : `${specifier}.js`
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function rewriteSpecifiers(source) {
|
|
30
|
-
return source.replace(
|
|
31
|
-
JS_IMPORT_PATTERN,
|
|
32
|
-
(match, fromPrefix, fromSpecifier, fromSuffix, importPrefix, importSpecifier, importSuffix) => {
|
|
33
|
-
if (fromSpecifier) {
|
|
34
|
-
return `${fromPrefix}${withJsExtension(fromSpecifier)}${fromSuffix}`
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (importSpecifier) {
|
|
38
|
-
return `${importPrefix}${withJsExtension(importSpecifier)}${importSuffix}`
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return match
|
|
42
|
-
},
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const files = await collectJsFiles(DIST_DIR)
|
|
47
|
-
|
|
48
|
-
await Promise.all(
|
|
49
|
-
files.map(async (fileUrl) => {
|
|
50
|
-
const source = await readFile(fileUrl, "utf8")
|
|
51
|
-
const rewritten = rewriteSpecifiers(source)
|
|
52
|
-
|
|
53
|
-
if (rewritten !== source) {
|
|
54
|
-
await writeFile(fileUrl, rewritten)
|
|
55
|
-
}
|
|
56
|
-
}),
|
|
57
|
-
)
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
declare module "three/tsl" {
|
|
2
|
-
export interface LoopConfig {
|
|
3
|
-
condition?: string
|
|
4
|
-
end: number
|
|
5
|
-
start: number
|
|
6
|
-
type: "float" | "int"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type ShaderNodeParams = readonly [
|
|
10
|
-
TSLNode,
|
|
11
|
-
TSLNode,
|
|
12
|
-
TSLNode,
|
|
13
|
-
TSLNode,
|
|
14
|
-
TSLNode,
|
|
15
|
-
TSLNode?,
|
|
16
|
-
...TSLNode[],
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
export type ShaderNodeFn = (
|
|
20
|
-
params: ShaderNodeParams,
|
|
21
|
-
...rest: unknown[]
|
|
22
|
-
) => unknown
|
|
23
|
-
|
|
24
|
-
export interface TSLNode {
|
|
25
|
-
a: TSLNode
|
|
26
|
-
b: TSLNode
|
|
27
|
-
dot(value: unknown): TSLNode
|
|
28
|
-
g: TSLNode
|
|
29
|
-
r: TSLNode
|
|
30
|
-
rgb: TSLNode
|
|
31
|
-
value: unknown
|
|
32
|
-
w: TSLNode
|
|
33
|
-
x: TSLNode
|
|
34
|
-
xx: TSLNode
|
|
35
|
-
xy: TSLNode
|
|
36
|
-
xyz: TSLNode
|
|
37
|
-
xxxx: TSLNode
|
|
38
|
-
xxyy: TSLNode
|
|
39
|
-
xxx: TSLNode
|
|
40
|
-
xzx: TSLNode
|
|
41
|
-
xzyw: TSLNode
|
|
42
|
-
y: TSLNode
|
|
43
|
-
yyy: TSLNode
|
|
44
|
-
yyyy: TSLNode
|
|
45
|
-
yyz: TSLNode
|
|
46
|
-
yzx: TSLNode
|
|
47
|
-
yzw: TSLNode
|
|
48
|
-
z: TSLNode
|
|
49
|
-
zw: TSLNode
|
|
50
|
-
zww: TSLNode
|
|
51
|
-
zxy: TSLNode
|
|
52
|
-
zzww: TSLNode
|
|
53
|
-
www: TSLNode
|
|
54
|
-
wyz: TSLNode
|
|
55
|
-
|
|
56
|
-
add(value: unknown): TSLNode
|
|
57
|
-
addAssign(value: unknown): TSLNode
|
|
58
|
-
and(value: unknown): TSLNode
|
|
59
|
-
or(value: unknown): TSLNode
|
|
60
|
-
assign(value: unknown): TSLNode
|
|
61
|
-
clamp(min?: unknown, max?: unknown): TSLNode
|
|
62
|
-
div(value: unknown): TSLNode
|
|
63
|
-
equal(value: unknown): TSLNode
|
|
64
|
-
fract(): TSLNode
|
|
65
|
-
length(): TSLNode
|
|
66
|
-
greaterThan(value: unknown): TSLNode
|
|
67
|
-
greaterThanEqual(value: unknown): TSLNode
|
|
68
|
-
lessThan(value: unknown): TSLNode
|
|
69
|
-
lessThanEqual(value: unknown): TSLNode
|
|
70
|
-
mul(value: unknown): TSLNode
|
|
71
|
-
mulAssign(value: unknown): TSLNode
|
|
72
|
-
negate(): TSLNode
|
|
73
|
-
normalize(): TSLNode
|
|
74
|
-
sqrt(): TSLNode
|
|
75
|
-
sub(value: unknown): TSLNode
|
|
76
|
-
toVar(): TSLNode
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function attribute(name: string, type: string): TSLNode
|
|
80
|
-
export const pointUV: TSLNode
|
|
81
|
-
export const positionLocal: TSLNode
|
|
82
|
-
|
|
83
|
-
export const EPSILON: TSLNode
|
|
84
|
-
export const PI: TSLNode
|
|
85
|
-
export function abs(value: unknown): TSLNode
|
|
86
|
-
export function add(left: unknown, right: unknown): TSLNode
|
|
87
|
-
export function atan(value: unknown): TSLNode
|
|
88
|
-
export function clamp(value: unknown, min?: unknown, max?: unknown): TSLNode
|
|
89
|
-
export function cos(value: unknown): TSLNode
|
|
90
|
-
export function cross(left: unknown, right: unknown): TSLNode
|
|
91
|
-
export function div(left: unknown, right: unknown): TSLNode
|
|
92
|
-
export function dot(left: unknown, right: unknown): TSLNode
|
|
93
|
-
export function Fn(
|
|
94
|
-
fn: ShaderNodeFn,
|
|
95
|
-
layout?: unknown
|
|
96
|
-
): (...args: unknown[]) => TSLNode
|
|
97
|
-
export function Loop(
|
|
98
|
-
config: LoopConfig,
|
|
99
|
-
callback: (...args: unknown[]) => unknown
|
|
100
|
-
): TSLNode
|
|
101
|
-
export function exp(value: unknown): TSLNode
|
|
102
|
-
export function fract(value: unknown): TSLNode
|
|
103
|
-
export function float(value?: unknown): TSLNode
|
|
104
|
-
export function floor(value: unknown): TSLNode
|
|
105
|
-
export function mat2(
|
|
106
|
-
a?: unknown,
|
|
107
|
-
b?: unknown,
|
|
108
|
-
c?: unknown,
|
|
109
|
-
d?: unknown
|
|
110
|
-
): TSLNode
|
|
111
|
-
export function length(value: unknown): TSLNode
|
|
112
|
-
export function log(value: unknown): TSLNode
|
|
113
|
-
export function max(left: unknown, right: unknown): TSLNode
|
|
114
|
-
export function min(left: unknown, right: unknown): TSLNode
|
|
115
|
-
export function mix(left: unknown, right: unknown, factor: unknown): TSLNode
|
|
116
|
-
export function mod(left: unknown, right: unknown): TSLNode
|
|
117
|
-
export function mul(left: unknown, right: unknown): TSLNode
|
|
118
|
-
export const screenSize: TSLNode
|
|
119
|
-
export function select(
|
|
120
|
-
condition: unknown,
|
|
121
|
-
whenTrue: unknown,
|
|
122
|
-
whenFalse: unknown
|
|
123
|
-
): TSLNode
|
|
124
|
-
export function sin(value: unknown): TSLNode
|
|
125
|
-
export function sign(value: unknown): TSLNode
|
|
126
|
-
export function smoothstep(
|
|
127
|
-
edge0: unknown,
|
|
128
|
-
edge1: unknown,
|
|
129
|
-
x: unknown
|
|
130
|
-
): TSLNode
|
|
131
|
-
export function sqrt(value: unknown): TSLNode
|
|
132
|
-
export function pow(base: unknown, exponent: unknown): TSLNode
|
|
133
|
-
export function step(edge: unknown, value: unknown): TSLNode
|
|
134
|
-
export function sub(left: unknown, right: unknown): TSLNode
|
|
135
|
-
export function texture(value: unknown, uv?: unknown): TSLNode
|
|
136
|
-
export function uniform(value?: unknown): TSLNode
|
|
137
|
-
export function uv(): TSLNode
|
|
138
|
-
export function vec2(x?: unknown, y?: unknown): TSLNode
|
|
139
|
-
export function vec3(x?: unknown, y?: unknown, z?: unknown): TSLNode
|
|
140
|
-
export function vec4(
|
|
141
|
-
x?: unknown,
|
|
142
|
-
y?: unknown,
|
|
143
|
-
z?: unknown,
|
|
144
|
-
w?: unknown
|
|
145
|
-
): TSLNode
|
|
146
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
declare module "three/webgpu" {
|
|
2
|
-
export * from "three"
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
Camera,
|
|
6
|
-
ColorRepresentation,
|
|
7
|
-
Material,
|
|
8
|
-
Scene,
|
|
9
|
-
TypedArray,
|
|
10
|
-
WebGLRendererParameters,
|
|
11
|
-
WebGLRenderTarget,
|
|
12
|
-
} from "three"
|
|
13
|
-
import type { TSLNode } from "three/tsl"
|
|
14
|
-
|
|
15
|
-
export class MeshBasicNodeMaterial extends Material {
|
|
16
|
-
colorNode: TSLNode | null
|
|
17
|
-
opacityNode: TSLNode | null
|
|
18
|
-
positionNode: TSLNode | null
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class PointsNodeMaterial extends Material {
|
|
22
|
-
colorNode: TSLNode | null
|
|
23
|
-
opacityNode: TSLNode | null
|
|
24
|
-
positionNode: TSLNode | null
|
|
25
|
-
sizeNode: TSLNode | null
|
|
26
|
-
alphaTest: number
|
|
27
|
-
transparent: boolean
|
|
28
|
-
depthWrite: boolean
|
|
29
|
-
sizeAttenuation: boolean
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export class WebGPURenderer {
|
|
33
|
-
constructor(options?: WebGLRendererParameters & { canvas?: HTMLCanvasElement })
|
|
34
|
-
|
|
35
|
-
dispose(): void
|
|
36
|
-
init(): Promise<void>
|
|
37
|
-
readRenderTargetPixelsAsync(
|
|
38
|
-
target: WebGLRenderTarget,
|
|
39
|
-
x: number,
|
|
40
|
-
y: number,
|
|
41
|
-
width: number,
|
|
42
|
-
height: number,
|
|
43
|
-
): Promise<TypedArray>
|
|
44
|
-
render(scene: Scene, camera: Camera): void
|
|
45
|
-
setAnimationLoop(callback: ((time: number) => void) | null): void
|
|
46
|
-
setClearColor(color: ColorRepresentation, alpha?: number): void
|
|
47
|
-
setPixelRatio(pixelRatio: number): void
|
|
48
|
-
setRenderTarget(target: WebGLRenderTarget | null): void
|
|
49
|
-
setSize(width: number, height: number, updateStyle?: boolean): void
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
ShaderLabComposition,
|
|
3
|
-
type ShaderLabCompositionProps,
|
|
4
|
-
} from "./shader-lab-composition"
|
|
5
|
-
export {
|
|
6
|
-
advanceRuntimeClock,
|
|
7
|
-
createRuntimeClock,
|
|
8
|
-
type ShaderLabRuntimeClock,
|
|
9
|
-
} from "./runtime-clock"
|
|
10
|
-
export { buildRuntimeFrame, type ShaderLabRuntimeFrame } from "./runtime-frame"
|
|
11
|
-
export {
|
|
12
|
-
evaluateTimelineForLayers,
|
|
13
|
-
resolveEvaluatedLayers,
|
|
14
|
-
type EvaluatedLayerState,
|
|
15
|
-
} from "./timeline"
|
|
16
|
-
export type {
|
|
17
|
-
ShaderLabBlendMode,
|
|
18
|
-
ShaderLabAnimatedPropertyBinding,
|
|
19
|
-
ShaderLabAssetSource,
|
|
20
|
-
ShaderLabCompositeMode,
|
|
21
|
-
ShaderLabConfig,
|
|
22
|
-
ShaderLabEffectLayerType,
|
|
23
|
-
ShaderLabInlineSketchSource,
|
|
24
|
-
ShaderLabLayerKind,
|
|
25
|
-
ShaderLabLayerConfig,
|
|
26
|
-
ShaderLabLayerType,
|
|
27
|
-
ShaderLabModuleSketchSource,
|
|
28
|
-
ShaderLabParameterValue,
|
|
29
|
-
ShaderLabSketchSource,
|
|
30
|
-
ShaderLabSourceLayerType,
|
|
31
|
-
ShaderLabTimelineConfig,
|
|
32
|
-
ShaderLabTimelineInterpolation,
|
|
33
|
-
ShaderLabTimelineKeyframe,
|
|
34
|
-
ShaderLabTimelineTrack,
|
|
35
|
-
} from "./types"
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three/webgpu"
|
|
2
|
-
|
|
3
|
-
export const ASCII_CHARSETS: Record<string, string> = {
|
|
4
|
-
binary: "01",
|
|
5
|
-
blocks: " ░▒▓█",
|
|
6
|
-
dense: " .',:;!|({#@",
|
|
7
|
-
hatching: " ╱╲╳░▒",
|
|
8
|
-
light: " .:-=+*#%@",
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type AsciiFontWeight = "thin" | "regular" | "bold"
|
|
12
|
-
export const DEFAULT_ASCII_CHARS = " .:-=+*#%@"
|
|
13
|
-
|
|
14
|
-
function normalizeChars(chars: string): string {
|
|
15
|
-
return chars.length > 0 ? chars : " "
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function buildAsciiAtlas(
|
|
19
|
-
chars: string,
|
|
20
|
-
fontWeight: AsciiFontWeight = "regular",
|
|
21
|
-
cellPx = 16,
|
|
22
|
-
): THREE.CanvasTexture {
|
|
23
|
-
const normalizedChars = normalizeChars(chars)
|
|
24
|
-
const cellSize = Math.max(4, Math.round(cellPx))
|
|
25
|
-
const fontSize = Math.max(4, Math.floor(cellSize * 0.9))
|
|
26
|
-
const canvas = document.createElement("canvas")
|
|
27
|
-
canvas.width = normalizedChars.length * cellSize
|
|
28
|
-
canvas.height = cellSize
|
|
29
|
-
|
|
30
|
-
const context = canvas.getContext("2d")
|
|
31
|
-
|
|
32
|
-
if (!context) {
|
|
33
|
-
throw new Error("Unable to create 2D context for ASCII atlas")
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
context.imageSmoothingEnabled = false
|
|
37
|
-
context.fillStyle = "#000"
|
|
38
|
-
context.fillRect(0, 0, canvas.width, canvas.height)
|
|
39
|
-
|
|
40
|
-
const weightMap: Record<AsciiFontWeight, string> = {
|
|
41
|
-
bold: "700",
|
|
42
|
-
regular: "400",
|
|
43
|
-
thin: "100",
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
context.fillStyle = "#fff"
|
|
47
|
-
context.font = `${weightMap[fontWeight]} ${fontSize}px "Geist Mono", monospace`
|
|
48
|
-
context.textAlign = "center"
|
|
49
|
-
context.textBaseline = "alphabetic"
|
|
50
|
-
|
|
51
|
-
for (const [index, char] of [...normalizedChars].entries()) {
|
|
52
|
-
const metrics = context.measureText(char)
|
|
53
|
-
const x = Math.round((index + 0.5) * cellSize)
|
|
54
|
-
const y = Math.round(
|
|
55
|
-
(cellSize + metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) * 0.5,
|
|
56
|
-
)
|
|
57
|
-
context.fillText(char, x, y)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const image = context.getImageData(0, 0, canvas.width, canvas.height)
|
|
61
|
-
const { data } = image
|
|
62
|
-
|
|
63
|
-
for (let index = 0; index < data.length; index += 4) {
|
|
64
|
-
const mask = (data[index] ?? 0) > 96 ? 255 : 0
|
|
65
|
-
data[index] = mask
|
|
66
|
-
data[index + 1] = mask
|
|
67
|
-
data[index + 2] = mask
|
|
68
|
-
data[index + 3] = 255
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
context.putImageData(image, 0, 0)
|
|
72
|
-
|
|
73
|
-
const texture = new THREE.CanvasTexture(canvas)
|
|
74
|
-
texture.flipY = false
|
|
75
|
-
texture.generateMipmaps = false
|
|
76
|
-
texture.magFilter = THREE.NearestFilter
|
|
77
|
-
texture.minFilter = THREE.NearestFilter
|
|
78
|
-
texture.wrapS = THREE.ClampToEdgeWrapping
|
|
79
|
-
texture.wrapT = THREE.ClampToEdgeWrapping
|
|
80
|
-
texture.needsUpdate = true
|
|
81
|
-
|
|
82
|
-
return texture
|
|
83
|
-
}
|