@motionscript/core 0.1.0-alpha.7 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -48
- package/README.md +91 -91
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +7 -5
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +24 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +4 -3
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +21 -13
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +42 -28
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +15 -12
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -10
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +4 -3
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +4 -7
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +7 -7
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -6
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -2
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +96 -409
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +93 -283
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +46 -14
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +42 -26
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +4 -2
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +11 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +113 -102
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +2 -6
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -5
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +1 -1
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +2 -3
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-7DB6BI27.js +6 -0
- package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
- package/dist/browser/chunks/chunk-IX53IFBD.js +13 -0
- package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
- package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
- package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +4 -4
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +14 -5
- package/dist/components/builtins/audio/audio.d.ts.map +1 -1
- package/dist/components/builtins/audio/audio.js +10 -13
- package/dist/components/builtins/audio/audio.js.map +1 -1
- package/dist/components/builtins/geometry/composite.d.ts +3 -3
- package/dist/components/builtins/geometry/composite.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +7 -7
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +4 -10
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/providers/providers.js.map +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +9 -9
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js +3 -0
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts +38 -11
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/clip-of.js.map +1 -1
- package/dist/components/factory/commands-for.js.map +1 -1
- package/dist/components/factory/component-audio.js.map +1 -1
- package/dist/components/factory/component2d.js.map +1 -1
- package/dist/components/factory/component3d.d.ts.map +1 -1
- package/dist/components/factory/component3d.js +11 -3
- package/dist/components/factory/component3d.js.map +1 -1
- package/dist/components/factory/factory.d.ts +3 -0
- package/dist/components/factory/factory.d.ts.map +1 -1
- package/dist/components/factory/factory.js +39 -5
- package/dist/components/factory/factory.js.map +1 -1
- package/dist/components/factory/timeline.js.map +1 -1
- package/dist/components/factory/type-def.js.map +1 -1
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/modules/aim.js.map +1 -1
- package/dist/components/modules/corners.js.map +1 -1
- package/dist/components/modules/flow.js.map +1 -1
- package/dist/components/modules/material.js.map +1 -1
- package/dist/components/modules/paint.js.map +1 -1
- package/dist/components/modules/shapes.js.map +1 -1
- package/dist/components/modules/text-layout.js.map +1 -1
- package/dist/components/modules/text-style.js.map +1 -1
- package/dist/components/modules/three-entries.js.map +1 -1
- package/dist/components/modules/view3d.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +1 -1
- package/dist/components/trees/2d/node-render.js +1 -1
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +1 -1
- package/dist/components/trees/2d/node2d.js +1 -1
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/index.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +16 -9
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +15 -11
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/index.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +12 -2
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +34 -6
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +8 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +4 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +4 -0
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +2 -1
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +2 -0
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +16 -0
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +30 -4
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +2 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +5 -5
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +45 -1
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +172 -42
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +14 -28
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +17 -5
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +158 -21
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +68 -8
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +22 -8
- package/dist/experimental.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -0
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +1 -1
- package/dist/renamed-scene-names.d.ts.map +1 -1
- package/dist/renamed-scene-names.js +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +9 -0
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +54 -5
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js +2 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +7 -0
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -1
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -0
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -2
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -3
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -1
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +14 -4
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +7 -3
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +11 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +8 -6
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +10 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -0
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +2 -0
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +4 -0
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.d.ts +1 -0
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -0
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +2 -2
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -250
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-D4FSTPML.js +0 -14
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
- package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
- package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
- package/dist/component/api.d.ts +0 -508
- package/dist/component/api.d.ts.map +0 -1
- package/dist/component/api.js +0 -4
- package/dist/component/api.js.map +0 -1
- package/dist/component/builtins/audio.d.ts +0 -26
- package/dist/component/builtins/audio.d.ts.map +0 -1
- package/dist/component/builtins/audio.js +0 -41
- package/dist/component/builtins/audio.js.map +0 -1
- package/dist/component/builtins/canvas3d.d.ts +0 -98
- package/dist/component/builtins/canvas3d.d.ts.map +0 -1
- package/dist/component/builtins/canvas3d.js +0 -21
- package/dist/component/builtins/canvas3d.js.map +0 -1
- package/dist/component/builtins/composite.d.ts +0 -56
- package/dist/component/builtins/composite.d.ts.map +0 -1
- package/dist/component/builtins/composite.js +0 -25
- package/dist/component/builtins/composite.js.map +0 -1
- package/dist/component/builtins/geometry.d.ts +0 -505
- package/dist/component/builtins/geometry.d.ts.map +0 -1
- package/dist/component/builtins/geometry.js +0 -107
- package/dist/component/builtins/geometry.js.map +0 -1
- package/dist/component/builtins/layout.d.ts +0 -88
- package/dist/component/builtins/layout.d.ts.map +0 -1
- package/dist/component/builtins/layout.js +0 -84
- package/dist/component/builtins/layout.js.map +0 -1
- package/dist/component/builtins/media.d.ts +0 -95
- package/dist/component/builtins/media.d.ts.map +0 -1
- package/dist/component/builtins/media.js +0 -149
- package/dist/component/builtins/media.js.map +0 -1
- package/dist/component/builtins/providers.d.ts +0 -23
- package/dist/component/builtins/providers.d.ts.map +0 -1
- package/dist/component/builtins/providers.js +0 -30
- package/dist/component/builtins/providers.js.map +0 -1
- package/dist/component/builtins/text.d.ts +0 -193
- package/dist/component/builtins/text.d.ts.map +0 -1
- package/dist/component/builtins/text.js +0 -113
- package/dist/component/builtins/text.js.map +0 -1
- package/dist/component/builtins/three.d.ts +0 -1085
- package/dist/component/builtins/three.d.ts.map +0 -1
- package/dist/component/builtins/three.js +0 -265
- package/dist/component/builtins/three.js.map +0 -1
- package/dist/component/clip-of.d.ts +0 -5
- package/dist/component/clip-of.d.ts.map +0 -1
- package/dist/component/clip-of.js +0 -33
- package/dist/component/clip-of.js.map +0 -1
- package/dist/component/commands-for.d.ts +0 -19
- package/dist/component/commands-for.d.ts.map +0 -1
- package/dist/component/commands-for.js +0 -5
- package/dist/component/commands-for.js.map +0 -1
- package/dist/component/component-audio.d.ts +0 -9
- package/dist/component/component-audio.d.ts.map +0 -1
- package/dist/component/component-audio.js +0 -18
- package/dist/component/component-audio.js.map +0 -1
- package/dist/component/component2d.d.ts +0 -9
- package/dist/component/component2d.d.ts.map +0 -1
- package/dist/component/component2d.js +0 -239
- package/dist/component/component2d.js.map +0 -1
- package/dist/component/component3d.d.ts +0 -9
- package/dist/component/component3d.d.ts.map +0 -1
- package/dist/component/component3d.js +0 -99
- package/dist/component/component3d.js.map +0 -1
- package/dist/component/factory.d.ts +0 -63
- package/dist/component/factory.d.ts.map +0 -1
- package/dist/component/factory.js +0 -313
- package/dist/component/factory.js.map +0 -1
- package/dist/component/modules/aim.d.ts +0 -30
- package/dist/component/modules/aim.d.ts.map +0 -1
- package/dist/component/modules/aim.js +0 -39
- package/dist/component/modules/aim.js.map +0 -1
- package/dist/component/modules/corners.d.ts +0 -13
- package/dist/component/modules/corners.d.ts.map +0 -1
- package/dist/component/modules/corners.js +0 -12
- package/dist/component/modules/corners.js.map +0 -1
- package/dist/component/modules/flow.d.ts +0 -26
- package/dist/component/modules/flow.d.ts.map +0 -1
- package/dist/component/modules/flow.js +0 -55
- package/dist/component/modules/flow.js.map +0 -1
- package/dist/component/modules/material.d.ts +0 -40
- package/dist/component/modules/material.d.ts.map +0 -1
- package/dist/component/modules/material.js +0 -75
- package/dist/component/modules/material.js.map +0 -1
- package/dist/component/modules/paint.d.ts +0 -71
- package/dist/component/modules/paint.d.ts.map +0 -1
- package/dist/component/modules/paint.js +0 -106
- package/dist/component/modules/paint.js.map +0 -1
- package/dist/component/modules/shapes.d.ts +0 -31
- package/dist/component/modules/shapes.d.ts.map +0 -1
- package/dist/component/modules/shapes.js +0 -43
- package/dist/component/modules/shapes.js.map +0 -1
- package/dist/component/modules/text-layout.d.ts +0 -26
- package/dist/component/modules/text-layout.d.ts.map +0 -1
- package/dist/component/modules/text-layout.js +0 -57
- package/dist/component/modules/text-layout.js.map +0 -1
- package/dist/component/modules/text-style.d.ts +0 -48
- package/dist/component/modules/text-style.d.ts.map +0 -1
- package/dist/component/modules/text-style.js +0 -63
- package/dist/component/modules/text-style.js.map +0 -1
- package/dist/component/modules/three-entries.d.ts +0 -23
- package/dist/component/modules/three-entries.d.ts.map +0 -1
- package/dist/component/modules/three-entries.js +0 -41
- package/dist/component/modules/three-entries.js.map +0 -1
- package/dist/component/modules/view3d.d.ts +0 -55
- package/dist/component/modules/view3d.d.ts.map +0 -1
- package/dist/component/modules/view3d.js +0 -160
- package/dist/component/modules/view3d.js.map +0 -1
- package/dist/component/timeline.d.ts +0 -22
- package/dist/component/timeline.d.ts.map +0 -1
- package/dist/component/timeline.js +0 -128
- package/dist/component/timeline.js.map +0 -1
- package/dist/component/type-def.d.ts +0 -26
- package/dist/component/type-def.d.ts.map +0 -1
- package/dist/component/type-def.js +0 -16
- package/dist/component/type-def.js.map +0 -1
- package/dist/component/types.d.ts +0 -91
- package/dist/component/types.d.ts.map +0 -1
- package/dist/component/types.js +0 -88
- package/dist/component/types.js.map +0 -1
- package/dist/component/views.d.ts +0 -121
- package/dist/component/views.d.ts.map +0 -1
- package/dist/component/views.js +0 -413
- package/dist/component/views.js.map +0 -1
- package/dist/document/withdraw.d.ts +0 -28
- package/dist/document/withdraw.d.ts.map +0 -1
- package/dist/document/withdraw.js +0 -61
- package/dist/document/withdraw.js.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -27
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -26
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js +0 -264
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts +0 -56
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js +0 -86
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js +0 -80
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts +0 -63
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js +0 -131
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts +0 -55
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js +0 -73
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts +0 -1111
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js +0 -1665
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -142
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -232
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts +0 -107
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js +0 -179
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -41
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -71
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts +0 -56
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js +0 -87
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -58
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts +0 -93
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js +0 -470
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -53
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -35
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -80
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -153
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -350
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts +0 -53
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js +0 -23
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts +0 -89
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js +0 -135
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts +0 -39
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js +0 -14
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts +0 -46
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js +0 -74
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts +0 -445
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js +0 -745
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts +0 -32
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js +0 -37
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/root/canvas2d-node.d.ts +0 -163
- package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/root/canvas2d-node.js +0 -264
- package/dist/nodes/root/canvas2d-node.js.map +0 -1
- package/dist/nodes/root/provider-node.d.ts +0 -47
- package/dist/nodes/root/provider-node.d.ts.map +0 -1
- package/dist/nodes/root/provider-node.js +0 -63
- package/dist/nodes/root/provider-node.js.map +0 -1
- package/dist/nodes/root/theme-provider-node.d.ts +0 -29
- package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/root/theme-provider-node.js +0 -43
- package/dist/nodes/root/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -103
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -146
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts +0 -66
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js +0 -227
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts +0 -51
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js +0 -77
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -68
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -78
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -118
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -153
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-layout.d.ts +0 -87
- package/dist/nodes/text/text-layout.d.ts.map +0 -1
- package/dist/nodes/text/text-layout.js +0 -368
- package/dist/nodes/text/text-layout.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -109
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -112
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -295
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -486
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -173
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -284
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -106
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js +0 -114
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts +0 -230
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js +0 -337
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -81
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -137
- package/dist/tween/seekable.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix4.js","sourceRoot":"","sources":["../../src/render3d/matrix4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAiE,MAAM,WAAW,CAAC;AAwC/H,qCAAqC;AACrC,MAAM,UAAU,SAAS;IACrB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC5C,MAAM,GAAG,GAAG,IAAI,KAAK,CAAS,EAAE,CAAC,CAAC;IAClC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;QAC/B,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACrF,GAAG,CAAC,GAAG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CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;KACnD,CAAC;AACN,CAAC","sourcesContent":["import { quaternionFromEuler, resolveVector3, type Euler3, type Quaternion, type Vector3, type Vector3Input } from \"./vector3\";\r\nimport type { Transform3D } from \"./transform\";\r\n\r\n/**\r\n * 4×4 matrix maths, in **column-major order** — the same layout three uses, so a\r\n * matrix built here and one read off a `THREE.Object3D` are the same sixteen\r\n * numbers in the same slots.\r\n *\r\n * ```\r\n * | m0 m4 m8 m12 |\r\n * | m1 m5 m9 m13 |\r\n * | m2 m6 m10 m14 |\r\n * | m3 m7 m11 m15 |\r\n * ```\r\n *\r\n * This exists for one caller — {@link projectNode3D}, the walk that says where a\r\n * 3D node's pixels landed — and it is deliberately the *whole* of the maths that\r\n * walk needs rather than a general linear-algebra library. Every function here\r\n * mirrors a specific three behaviour it has to agree with (`Object3D.lookAt`'s\r\n * two orientations, `PerspectiveCamera.updateProjectionMatrix`'s zoom, the\r\n * frustum an `OrthographicCamera` derives from `frustumHeight`); where the two\r\n * could drift the docblock says which three method is being matched, because a\r\n * selection box that disagrees with the render by a few pixels is worse than one\r\n * that isn't drawn.\r\n *\r\n * Kept in `render3d` beside the descriptors rather than in a `math` directory\r\n * for the reason the rest of this folder gives: nothing here imports a renderer,\r\n * so `three` stays inside `@motionscript/browser`.\r\n */\r\n\r\n/** A 4×4 matrix as sixteen numbers, column-major. See the module note. */\r\n/** @internal */\r\nexport type Matrix4 = readonly number[];\r\n\r\n/** A homogeneous point — what {@link applyMatrix4} returns before the divide. */\r\n/** @internal */\r\nexport interface Vector4 extends Vector3 {\r\n w: number;\r\n}\r\n\r\n/** @internal The identity matrix. */\r\nexport function identity4(): Matrix4 {\r\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\r\n}\r\n\r\n/**\r\n * `a · b` — the transform that applies `b` first, then `a`. Composing a parent\r\n * with a child (`parent.multiply(child)`) yields the child's world transform,\r\n * the same convention {@link import(\"@/attributes/layout/matrix2d\").multiply}\r\n * uses one dimension down.\r\n */\r\n/** @internal */\r\nexport function multiply4(a: Matrix4, b: Matrix4): Matrix4 {\r\n const out = new Array<number>(16);\r\n for (let col = 0; col < 4; col++) {\r\n const b0 = b[col * 4], b1 = b[col * 4 + 1], b2 = b[col * 4 + 2], b3 = b[col * 4 + 3];\r\n out[col * 4] = a[0] * b0 + a[4] * b1 + a[8] * b2 + a[12] * b3;\r\n out[col * 4 + 1] = a[1] * b0 + a[5] * b1 + a[9] * b2 + a[13] * b3;\r\n out[col * 4 + 2] = a[2] * b0 + a[6] * b1 + a[10] * b2 + a[14] * b3;\r\n out[col * 4 + 3] = a[3] * b0 + a[7] * b1 + a[11] * b2 + a[15] * b3;\r\n }\r\n return out;\r\n}\r\n\r\n/**\r\n * The inverse, or `null` when `m` is singular — which a zero scale on any axis\r\n * makes it. A camera whose matrix cannot be inverted has no view, so the caller\r\n * draws no boxes rather than dividing by zero into `NaN`.\r\n */\r\n/** @internal */\r\nexport function invert4(m: Matrix4): Matrix4 | null {\r\n const [\r\n n11, n21, n31, n41,\r\n n12, n22, n32, n42,\r\n n13, n23, n33, n43,\r\n n14, n24, n34, n44,\r\n ] = m;\r\n\r\n const t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44;\r\n const t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44;\r\n const t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44;\r\n const t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\r\n\r\n const determinant = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\r\n if (determinant === 0) return null;\r\n const d = 1 / determinant;\r\n\r\n return [\r\n t11 * d,\r\n (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * d,\r\n (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * d,\r\n (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * d,\r\n\r\n t12 * d,\r\n (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * d,\r\n (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * d,\r\n (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * d,\r\n\r\n t13 * d,\r\n (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * d,\r\n (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * d,\r\n (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * d,\r\n\r\n t14 * d,\r\n (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * d,\r\n (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * d,\r\n (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * d,\r\n ];\r\n}\r\n\r\n/** @internal Map a point through `m`, keeping `w` — the caller does the divide. */\r\nexport function applyMatrix4(m: Matrix4, p: Vector3): Vector4 {\r\n const { x, y, z } = p;\r\n return {\r\n x: m[0] * x + m[4] * y + m[8] * z + m[12],\r\n y: m[1] * x + m[5] * y + m[9] * z + m[13],\r\n z: m[2] * x + m[6] * y + m[10] * z + m[14],\r\n w: m[3] * x + m[7] * y + m[11] * z + m[15],\r\n };\r\n}\r\n\r\n/** @internal Translation, rotation and scale composed into one matrix. */\r\nexport function compose4(position: Vector3, rotation: Quaternion, scale: Vector3): Matrix4 {\r\n const { x, y, z, w } = rotation;\r\n const x2 = x + x, y2 = y + y, z2 = z + z;\r\n const xx = x * x2, xy = x * y2, xz = x * z2;\r\n const yy = y * y2, yz = y * z2, zz = z * z2;\r\n const wx = w * x2, wy = w * y2, wz = w * z2;\r\n\r\n return [\r\n (1 - (yy + zz)) * scale.x, (xy + wz) * scale.x, (xz - wy) * scale.x, 0,\r\n (xy - wz) * scale.y, (1 - (xx + zz)) * scale.y, (yz + wx) * scale.y, 0,\r\n (xz + wy) * scale.z, (yz - wx) * scale.z, (1 - (xx + yy)) * scale.z, 0,\r\n position.x, position.y, position.z, 1,\r\n ];\r\n}\r\n\r\n/**\r\n * The rotation that aims `eye`'s **−Z** at `target`, as three's\r\n * `Matrix4.lookAt(eye, target, up)` builds it.\r\n *\r\n * Callers reproduce `Object3D.lookAt`'s two cases by choosing which way round\r\n * they pass the pair: a camera (and a light) aims its −Z, so it passes\r\n * `(position, target)`; everything else aims its **+Z**, which is the same\r\n * function called `(target, position)`. That asymmetry is three's, not ours —\r\n * see `applyTransform` in the renderer, which calls `Object3D.lookAt` and\r\n * inherits it.\r\n *\r\n * A degenerate pair — eye on target, or an up vector parallel to the view — has\r\n * no defined orientation; three nudges `z` by `1e-4` in that case and so does\r\n * this, so the two agree rather than one of them producing `NaN`.\r\n */\r\n/** @internal */\r\nexport function lookAtRotation4(eye: Vector3, target: Vector3, up: Vector3 = UP): Matrix4 {\r\n let zx = eye.x - target.x, zy = eye.y - target.y, zz = eye.z - target.z;\r\n let length = Math.hypot(zx, zy, zz);\r\n if (length === 0) {\r\n zz = 1;\r\n length = 1;\r\n }\r\n zx /= length; zy /= length; zz /= length;\r\n\r\n let xx = up.y * zz - up.z * zy;\r\n let xy = up.z * zx - up.x * zz;\r\n let xz = up.x * zy - up.y * zx;\r\n let xLength = Math.hypot(xx, xy, xz);\r\n if (xLength === 0) {\r\n // up is parallel to the view direction — three's own nudge, so the two\r\n // pick the same arbitrary roll rather than disagreeing about it.\r\n if (Math.abs(up.z) === 1) zx += 1e-4;\r\n else zz += 1e-4;\r\n length = Math.hypot(zx, zy, zz);\r\n zx /= length; zy /= length; zz /= length;\r\n xx = up.y * zz - up.z * zy;\r\n xy = up.z * zx - up.x * zz;\r\n xz = up.x * zy - up.y * zx;\r\n xLength = Math.hypot(xx, xy, xz);\r\n }\r\n xx /= xLength; xy /= xLength; xz /= xLength;\r\n\r\n const yx = zy * xz - zz * xy;\r\n const yy = zz * xx - zx * xz;\r\n const yz = zx * xy - zy * xx;\r\n\r\n return [xx, xy, xz, 0, yx, yy, yz, 0, zx, zy, zz, 0, 0, 0, 0, 1];\r\n}\r\n\r\n/** three's default up vector, which nothing in the descriptors overrides yet. */\r\nconst UP: Vector3 = { x: 0, y: 1, z: 0 };\r\n\r\n/**\r\n * A {@link Transform3D} as a matrix, in the parent's space.\r\n *\r\n * The precedence is the renderer's — `lookAt` > `quaternion` > `rotation`, each\r\n * a complete statement about orientation rather than something to combine — and\r\n * `lookAt` is resolved against `parentWorld` for the same reason `Object3D.lookAt`\r\n * is: it names a point in **world** space, so a node inside a rotated group has\r\n * to undo that rotation to end up pointing at it. Pass `null` for a transform at\r\n * the scene root, where there is nothing to undo.\r\n */\r\n/** @internal */\r\nexport function transformMatrix4(transform: Transform3D | undefined, parentWorld: Matrix4 | null): Matrix4 {\r\n if (!transform) return identity4();\r\n\r\n const position = resolveVector3(transform.position);\r\n const scale = resolveVector3(transform.scale === undefined ? 1 : transform.scale);\r\n\r\n if (transform.lookAt !== undefined) {\r\n const target = resolveVector3(transform.lookAt);\r\n // Where this node sits in world space — `lookAt` is measured from there,\r\n // not from its local origin.\r\n const world = parentWorld\r\n ? applyMatrix4(parentWorld, position)\r\n : { ...position, w: 1 };\r\n const origin = { x: world.x, y: world.y, z: world.z };\r\n // +Z at the target: the non-camera branch of `Object3D.lookAt`. Cameras\r\n // never come through here — see `cameraMatrix4`.\r\n let rotation = lookAtRotation4(target, origin);\r\n if (parentWorld) {\r\n const inverseParent = invert4(rotationOf4(parentWorld));\r\n if (inverseParent) rotation = multiply4(inverseParent, rotation);\r\n }\r\n // T · R · S, the same order {@link compose4} produces — spelled out here\r\n // because the rotation arrived as a matrix rather than as a quaternion.\r\n return multiply4(multiply4(translation4(position), rotation), scale4(scale));\r\n }\r\n\r\n const quaternion = transform.quaternion ?? quaternionFromEuler(eulerOf(transform.rotation));\r\n return compose4(position, quaternion, scale);\r\n}\r\n\r\n/** A `Vector3Input | Euler3` as an {@link Euler3}, defaulting to no rotation. */\r\nfunction eulerOf(rotation: Vector3Input | Euler3 | undefined): Euler3 {\r\n const angles = resolveVector3(rotation as Vector3Input | undefined);\r\n return { ...angles, order: (rotation as Euler3 | undefined)?.order };\r\n}\r\n\r\n/** @internal Pure translation. */\r\nexport function translation4(position: Vector3): Matrix4 {\r\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, position.x, position.y, position.z, 1];\r\n}\r\n\r\n/** Pure per-axis scale. */\r\nfunction scale4(scale: Vector3): Matrix4 {\r\n return [scale.x, 0, 0, 0, 0, scale.y, 0, 0, 0, 0, scale.z, 0, 0, 0, 0, 1];\r\n}\r\n\r\n/**\r\n * `m`'s rotation with its translation and scale divided out — three's\r\n * `Matrix4.extractRotation`. Used to undo a parent's orientation when resolving\r\n * a `lookAt`; a zero-length basis vector leaves that column as identity rather\r\n * than dividing by zero.\r\n */\r\n/** @internal */\r\nexport function rotationOf4(m: Matrix4): Matrix4 {\r\n const sx = Math.hypot(m[0], m[1], m[2]) || 1;\r\n const sy = Math.hypot(m[4], m[5], m[6]) || 1;\r\n const sz = Math.hypot(m[8], m[9], m[10]) || 1;\r\n return [\r\n m[0] / sx, m[1] / sx, m[2] / sx, 0,\r\n m[4] / sy, m[5] / sy, m[6] / sy, 0,\r\n m[8] / sz, m[9] / sz, m[10] / sz, 0,\r\n 0, 0, 0, 1,\r\n ];\r\n}\r\n\r\n/**\r\n * A perspective projection, matching `PerspectiveCamera.updateProjectionMatrix`\r\n * — including `zoom`, which three applies by *narrowing the frustum* rather than\r\n * by scaling the result, so it has to be folded in here rather than afterwards.\r\n */\r\n/** @internal */\r\nexport function perspective4(fov: number, aspect: number, near: number, far: number, zoom: number): Matrix4 {\r\n const top = near * Math.tan((fov * Math.PI) / 360) / zoom;\r\n const height = 2 * top;\r\n const width = aspect * height;\r\n const left = -0.5 * width;\r\n return frustum4(left, left + width, top, top - height, near, far);\r\n}\r\n\r\n/** three's `Matrix4.makePerspective`, with its reversed-`bottom` convention. */\r\nfunction frustum4(left: number, right: number, top: number, bottom: number, near: number, far: number): Matrix4 {\r\n const x = (2 * near) / (right - left);\r\n const y = (2 * near) / (top - bottom);\r\n const a = (right + left) / (right - left);\r\n const b = (top + bottom) / (top - bottom);\r\n const c = -(far + near) / (far - near);\r\n const d = (-2 * far * near) / (far - near);\r\n return [x, 0, 0, 0, 0, y, 0, 0, a, b, c, -1, 0, 0, d, 0];\r\n}\r\n\r\n/**\r\n * An orthographic projection, matching\r\n * `OrthographicCamera.updateProjectionMatrix` — where `zoom` widens the frustum\r\n * about its centre rather than scaling the projected result.\r\n */\r\n/** @internal */\r\nexport function orthographic4(left: number, right: number, top: number, bottom: number, near: number, far: number, zoom: number): Matrix4 {\r\n const dx = (right - left) / (2 * zoom);\r\n const dy = (top - bottom) / (2 * zoom);\r\n const cx = (right + left) / 2;\r\n const cy = (top + bottom) / 2;\r\n\r\n const l = cx - dx, r = cx + dx, t = cy + dy, b = cy - dy;\r\n const w = 1 / (r - l);\r\n const h = 1 / (t - b);\r\n const p = 1 / (far - near);\r\n return [\r\n 2 * w, 0, 0, 0,\r\n 0, 2 * h, 0, 0,\r\n 0, 0, -2 * p, 0,\r\n -(r + l) * w, -(t + b) * h, -(far + near) * p, 1,\r\n ];\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"matrix4.js","sourceRoot":"","sources":["../../src/render3d/matrix4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAiE,MAAM,WAAW,CAAC;AAwC/H,qCAAqC;AACrC,MAAM,UAAU,SAAS;IACrB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC5C,MAAM,GAAG,GAAG,IAAI,KAAK,CAAS,EAAE,CAAC,CAAC;IAClC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;QAC/B,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACrF,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,C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AG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;KACnD,CAAC;AACN,CAAC","sourcesContent":["import { quaternionFromEuler, resolveVector3, type Euler3, type Quaternion, type Vector3, type Vector3Input } from \"./vector3\";\nimport type { Transform3D } from \"./transform\";\n\n/**\n * 4×4 matrix maths, in **column-major order** — the same layout three uses, so a\n * matrix built here and one read off a `THREE.Object3D` are the same sixteen\n * numbers in the same slots.\n *\n * ```\n * | m0 m4 m8 m12 |\n * | m1 m5 m9 m13 |\n * | m2 m6 m10 m14 |\n * | m3 m7 m11 m15 |\n * ```\n *\n * This exists for one caller — {@link projectNode3D}, the walk that says where a\n * 3D node's pixels landed — and it is deliberately the *whole* of the maths that\n * walk needs rather than a general linear-algebra library. Every function here\n * mirrors a specific three behaviour it has to agree with (`Object3D.lookAt`'s\n * two orientations, `PerspectiveCamera.updateProjectionMatrix`'s zoom, the\n * frustum an `OrthographicCamera` derives from `frustumHeight`); where the two\n * could drift the docblock says which three method is being matched, because a\n * selection box that disagrees with the render by a few pixels is worse than one\n * that isn't drawn.\n *\n * Kept in `render3d` beside the descriptors rather than in a `math` directory\n * for the reason the rest of this folder gives: nothing here imports a renderer,\n * so `three` stays inside `@motionscript/browser`.\n */\n\n/** A 4×4 matrix as sixteen numbers, column-major. See the module note. */\n/** @internal */\nexport type Matrix4 = readonly number[];\n\n/** A homogeneous point — what {@link applyMatrix4} returns before the divide. */\n/** @internal */\nexport interface Vector4 extends Vector3 {\n w: number;\n}\n\n/** @internal The identity matrix. */\nexport function identity4(): Matrix4 {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n/**\n * `a · b` — the transform that applies `b` first, then `a`. Composing a parent\n * with a child (`parent.multiply(child)`) yields the child's world transform,\n * the same convention {@link import(\"@/attributes/layout/matrix2d\").multiply}\n * uses one dimension down.\n */\n/** @internal */\nexport function multiply4(a: Matrix4, b: Matrix4): Matrix4 {\n const out = new Array<number>(16);\n for (let col = 0; col < 4; col++) {\n const b0 = b[col * 4], b1 = b[col * 4 + 1], b2 = b[col * 4 + 2], b3 = b[col * 4 + 3];\n out[col * 4] = a[0] * b0 + a[4] * b1 + a[8] * b2 + a[12] * b3;\n out[col * 4 + 1] = a[1] * b0 + a[5] * b1 + a[9] * b2 + a[13] * b3;\n out[col * 4 + 2] = a[2] * b0 + a[6] * b1 + a[10] * b2 + a[14] * b3;\n out[col * 4 + 3] = a[3] * b0 + a[7] * b1 + a[11] * b2 + a[15] * b3;\n }\n return out;\n}\n\n/**\n * The inverse, or `null` when `m` is singular — which a zero scale on any axis\n * makes it. A camera whose matrix cannot be inverted has no view, so the caller\n * draws no boxes rather than dividing by zero into `NaN`.\n */\n/** @internal */\nexport function invert4(m: Matrix4): Matrix4 | null {\n const [\n n11, n21, n31, n41,\n n12, n22, n32, n42,\n n13, n23, n33, n43,\n n14, n24, n34, n44,\n ] = m;\n\n const t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44;\n const t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44;\n const t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44;\n const t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n const determinant = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n if (determinant === 0) return null;\n const d = 1 / determinant;\n\n return [\n t11 * d,\n (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * d,\n (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * d,\n (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * d,\n\n t12 * d,\n (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * d,\n (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * d,\n (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * d,\n\n t13 * d,\n (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * d,\n (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * d,\n (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * d,\n\n t14 * d,\n (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * d,\n (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * d,\n (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * d,\n ];\n}\n\n/** @internal Map a point through `m`, keeping `w` — the caller does the divide. */\nexport function applyMatrix4(m: Matrix4, p: Vector3): Vector4 {\n const { x, y, z } = p;\n return {\n x: m[0] * x + m[4] * y + m[8] * z + m[12],\n y: m[1] * x + m[5] * y + m[9] * z + m[13],\n z: m[2] * x + m[6] * y + m[10] * z + m[14],\n w: m[3] * x + m[7] * y + m[11] * z + m[15],\n };\n}\n\n/** @internal Translation, rotation and scale composed into one matrix. */\nexport function compose4(position: Vector3, rotation: Quaternion, scale: Vector3): Matrix4 {\n const { x, y, z, w } = rotation;\n const x2 = x + x, y2 = y + y, z2 = z + z;\n const xx = x * x2, xy = x * y2, xz = x * z2;\n const yy = y * y2, yz = y * z2, zz = z * z2;\n const wx = w * x2, wy = w * y2, wz = w * z2;\n\n return [\n (1 - (yy + zz)) * scale.x, (xy + wz) * scale.x, (xz - wy) * scale.x, 0,\n (xy - wz) * scale.y, (1 - (xx + zz)) * scale.y, (yz + wx) * scale.y, 0,\n (xz + wy) * scale.z, (yz - wx) * scale.z, (1 - (xx + yy)) * scale.z, 0,\n position.x, position.y, position.z, 1,\n ];\n}\n\n/**\n * The rotation that aims `eye`'s **−Z** at `target`, as three's\n * `Matrix4.lookAt(eye, target, up)` builds it.\n *\n * Callers reproduce `Object3D.lookAt`'s two cases by choosing which way round\n * they pass the pair: a camera (and a light) aims its −Z, so it passes\n * `(position, target)`; everything else aims its **+Z**, which is the same\n * function called `(target, position)`. That asymmetry is three's, not ours —\n * see `applyTransform` in the renderer, which calls `Object3D.lookAt` and\n * inherits it.\n *\n * A degenerate pair — eye on target, or an up vector parallel to the view — has\n * no defined orientation; three nudges `z` by `1e-4` in that case and so does\n * this, so the two agree rather than one of them producing `NaN`.\n */\n/** @internal */\nexport function lookAtRotation4(eye: Vector3, target: Vector3, up: Vector3 = UP): Matrix4 {\n let zx = eye.x - target.x, zy = eye.y - target.y, zz = eye.z - target.z;\n let length = Math.hypot(zx, zy, zz);\n if (length === 0) {\n zz = 1;\n length = 1;\n }\n zx /= length; zy /= length; zz /= length;\n\n let xx = up.y * zz - up.z * zy;\n let xy = up.z * zx - up.x * zz;\n let xz = up.x * zy - up.y * zx;\n let xLength = Math.hypot(xx, xy, xz);\n if (xLength === 0) {\n // up is parallel to the view direction — three's own nudge, so the two\n // pick the same arbitrary roll rather than disagreeing about it.\n if (Math.abs(up.z) === 1) zx += 1e-4;\n else zz += 1e-4;\n length = Math.hypot(zx, zy, zz);\n zx /= length; zy /= length; zz /= length;\n xx = up.y * zz - up.z * zy;\n xy = up.z * zx - up.x * zz;\n xz = up.x * zy - up.y * zx;\n xLength = Math.hypot(xx, xy, xz);\n }\n xx /= xLength; xy /= xLength; xz /= xLength;\n\n const yx = zy * xz - zz * xy;\n const yy = zz * xx - zx * xz;\n const yz = zx * xy - zy * xx;\n\n return [xx, xy, xz, 0, yx, yy, yz, 0, zx, zy, zz, 0, 0, 0, 0, 1];\n}\n\n/** three's default up vector, which nothing in the descriptors overrides yet. */\nconst UP: Vector3 = { x: 0, y: 1, z: 0 };\n\n/**\n * A {@link Transform3D} as a matrix, in the parent's space.\n *\n * The precedence is the renderer's — `lookAt` > `quaternion` > `rotation`, each\n * a complete statement about orientation rather than something to combine — and\n * `lookAt` is resolved against `parentWorld` for the same reason `Object3D.lookAt`\n * is: it names a point in **world** space, so a node inside a rotated group has\n * to undo that rotation to end up pointing at it. Pass `null` for a transform at\n * the scene root, where there is nothing to undo.\n */\n/** @internal */\nexport function transformMatrix4(transform: Transform3D | undefined, parentWorld: Matrix4 | null): Matrix4 {\n if (!transform) return identity4();\n\n const position = resolveVector3(transform.position);\n const scale = resolveVector3(transform.scale === undefined ? 1 : transform.scale);\n\n if (transform.lookAt !== undefined) {\n const target = resolveVector3(transform.lookAt);\n // Where this node sits in world space — `lookAt` is measured from there,\n // not from its local origin.\n const world = parentWorld\n ? applyMatrix4(parentWorld, position)\n : { ...position, w: 1 };\n const origin = { x: world.x, y: world.y, z: world.z };\n // +Z at the target: the non-camera branch of `Object3D.lookAt`. Cameras\n // never come through here — see `cameraMatrix4`.\n let rotation = lookAtRotation4(target, origin);\n if (parentWorld) {\n const inverseParent = invert4(rotationOf4(parentWorld));\n if (inverseParent) rotation = multiply4(inverseParent, rotation);\n }\n // T · R · S, the same order {@link compose4} produces — spelled out here\n // because the rotation arrived as a matrix rather than as a quaternion.\n return multiply4(multiply4(translation4(position), rotation), scale4(scale));\n }\n\n const quaternion = transform.quaternion ?? quaternionFromEuler(eulerOf(transform.rotation));\n return compose4(position, quaternion, scale);\n}\n\n/** A `Vector3Input | Euler3` as an {@link Euler3}, defaulting to no rotation. */\nfunction eulerOf(rotation: Vector3Input | Euler3 | undefined): Euler3 {\n const angles = resolveVector3(rotation as Vector3Input | undefined);\n return { ...angles, order: (rotation as Euler3 | undefined)?.order };\n}\n\n/** @internal Pure translation. */\nexport function translation4(position: Vector3): Matrix4 {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, position.x, position.y, position.z, 1];\n}\n\n/** Pure per-axis scale. */\nfunction scale4(scale: Vector3): Matrix4 {\n return [scale.x, 0, 0, 0, 0, scale.y, 0, 0, 0, 0, scale.z, 0, 0, 0, 0, 1];\n}\n\n/**\n * `m`'s rotation with its translation and scale divided out — three's\n * `Matrix4.extractRotation`. Used to undo a parent's orientation when resolving\n * a `lookAt`; a zero-length basis vector leaves that column as identity rather\n * than dividing by zero.\n */\n/** @internal */\nexport function rotationOf4(m: Matrix4): Matrix4 {\n const sx = Math.hypot(m[0], m[1], m[2]) || 1;\n const sy = Math.hypot(m[4], m[5], m[6]) || 1;\n const sz = Math.hypot(m[8], m[9], m[10]) || 1;\n return [\n m[0] / sx, m[1] / sx, m[2] / sx, 0,\n m[4] / sy, m[5] / sy, m[6] / sy, 0,\n m[8] / sz, m[9] / sz, m[10] / sz, 0,\n 0, 0, 0, 1,\n ];\n}\n\n/**\n * A perspective projection, matching `PerspectiveCamera.updateProjectionMatrix`\n * — including `zoom`, which three applies by *narrowing the frustum* rather than\n * by scaling the result, so it has to be folded in here rather than afterwards.\n */\n/** @internal */\nexport function perspective4(fov: number, aspect: number, near: number, far: number, zoom: number): Matrix4 {\n const top = near * Math.tan((fov * Math.PI) / 360) / zoom;\n const height = 2 * top;\n const width = aspect * height;\n const left = -0.5 * width;\n return frustum4(left, left + width, top, top - height, near, far);\n}\n\n/** three's `Matrix4.makePerspective`, with its reversed-`bottom` convention. */\nfunction frustum4(left: number, right: number, top: number, bottom: number, near: number, far: number): Matrix4 {\n const x = (2 * near) / (right - left);\n const y = (2 * near) / (top - bottom);\n const a = (right + left) / (right - left);\n const b = (top + bottom) / (top - bottom);\n const c = -(far + near) / (far - near);\n const d = (-2 * far * near) / (far - near);\n return [x, 0, 0, 0, 0, y, 0, 0, a, b, c, -1, 0, 0, d, 0];\n}\n\n/**\n * An orthographic projection, matching\n * `OrthographicCamera.updateProjectionMatrix` — where `zoom` widens the frustum\n * about its centre rather than scaling the projected result.\n */\n/** @internal */\nexport function orthographic4(left: number, right: number, top: number, bottom: number, near: number, far: number, zoom: number): Matrix4 {\n const dx = (right - left) / (2 * zoom);\n const dy = (top - bottom) / (2 * zoom);\n const cx = (right + left) / 2;\n const cy = (top + bottom) / 2;\n\n const l = cx - dx, r = cx + dx, t = cy + dy, b = cy - dy;\n const w = 1 / (r - l);\n const h = 1 / (t - b);\n const p = 1 / (far - near);\n return [\n 2 * w, 0, 0, 0,\n 0, 2 * h, 0, 0,\n 0, 0, -2 * p, 0,\n -(r + l) * w, -(t + b) * h, -(far + near) * p, 1,\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-context3d.js","sourceRoot":"","sources":["../../src/render3d/render-context3d.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAgB,eAAe;CA2CpC","sourcesContent":["import type { Graphics3D } from \"./graphics3d\";\
|
|
1
|
+
{"version":3,"file":"render-context3d.js","sourceRoot":"","sources":["../../src/render3d/render-context3d.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAgB,eAAe;CA2CpC","sourcesContent":["import type { Graphics3D } from \"./graphics3d\";\nimport type { CameraData3D } from \"./camera\";\nimport type { LightData3D } from \"./light\";\nimport type {\n EnvironmentData3D, FogData3D, PostEffect3D, Shadows3D, ToneSettings3D,\n} from \"./scene-settings\";\nimport type { Transform3D } from \"./transform\";\nimport type { Color } from \"@/attributes/shape/fill/color/parser\";\n\n/**\n * Per-node state supplied to {@link RenderContext3D.begin} for the duration of a\n * `Node3D`'s draw scope — the 3D counterpart of `NodeRenderState`.\n *\n * There is no layout rect and no motion here, because neither means anything for\n * an object in space: a 3D node's whole placement *is* its `transform`.\n */\nexport interface Node3DRenderState {\n /**\n * Stable node identifier.\n *\n * This is what gives the renderer's cache real identity: keyed by the node\n * that recorded it, a drawable survives a conditional sibling appearing or\n * disappearing, where a positional index would renumber and rebuild the tail.\n */\n id: string;\n /** This node's placement relative to its parent. */\n transform?: Transform3D;\n}\n\n/**\n * The rendering context passed to every `Node3D` when it draws itself.\n *\n * The 3D sibling of `RenderContext2D`, and deliberately not its subclass: the two\n * share no members, because a 3D scene is described with a camera, lights and\n * meshes rather than with paths, paint and clips.\n *\n * The division of labour mirrors 2D exactly. A {@link Graphics3D} is *what one\n * node draws* — geometry and material, nothing else — the way a `Graphics2D` is\n * shapes and paint. Everything that belongs to the scene rather than to a thing\n * in it is a call on the context:\n *\n * protected renderSelf(ctx: RenderContext3D): void {\n * ctx.light({ type: \"ambient\", intensity: 0.4 });\n * }\n *\n * `begin(state)` / `end()` bracket each node's draw call and carry its identity\n * and placement, so nesting is the node tree's nesting and the renderer can\n * cache per node rather than per slot.\n *\n * `Scene3D` is the implementation core ships; it records the calls into a value a\n * backend replays.\n *\n * There is no `background`. What is drawn behind a 3D scene is either a **2D\n * fill** on the viewport — which composites correctly already, is unaffected by\n * anything in the 3D pass, and gets the whole fill chain — or a sky, which is\n * part of {@link environment} because an HDRI that lights a scene and the\n * panorama you see behind it are one thing.\n */\nexport abstract class RenderContext3D {\n /**\n * Open a node draw scope. Must be paired with {@link end}. Everything\n * recorded until then is nested under this node and inherits its transform.\n */\n abstract begin(state: Node3DRenderState): void;\n\n /** Close the innermost scope opened by {@link begin}. */\n abstract end(): void;\n\n /** Draw what this node paints. */\n abstract draw(graphics: Graphics3D): void;\n\n /** Add a light at the current scope. */\n abstract light(light: LightData3D, transform?: Transform3D): void;\n\n /**\n * Place the scene camera at the current scope.\n *\n * Recorded in the hierarchy rather than set as a scene-wide field, so a camera\n * nested inside a moving group is carried by that group — the renderer\n * composes its world transform the same way it does for a mesh. A scene with\n * no camera gets a default framing; a scene that declares more than one keeps\n * the last, since there is only ever one view.\n */\n abstract camera(camera: CameraData3D): void;\n\n // ── Scene-wide settings ──────────────────────────────────────────────────\n //\n // Unlike a light or a camera these have no position, so they are not\n // hierarchical: a scene has exactly one fog and one environment, and the last\n // node to set one wins.\n\n /** Set the scene fog. A bare colour is sugar for `{ color }`; `null` clears it. */\n abstract fog(fog: FogData3D | Color | null): void;\n /** Set the image-based lighting environment and sky, or `null` for none. */\n abstract environment(environment: EnvironmentData3D | null): void;\n /** Enable/configure shadow casting for the whole scene. */\n abstract shadows(settings?: Shadows3D): void;\n /** Set tone mapping and exposure. */\n abstract tone(settings: ToneSettings3D): void;\n /** Append post-processing passes, applied in order after the scene renders. */\n abstract post(effects: PostEffect3D | readonly PostEffect3D[]): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/render3d/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA0B,EAAE,GAAW;IACvE,OAAO,SAAS,IAAI,IAAI,GAAG,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACpC,GAAW;IAEX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAyB;QAClD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;KAC7B,CAAC;AACN,CAAC;AAED,IAAI,MAAM,GAA0B,IAAI,CAAC;AACzC,IAAI,cAAc,GAAkC,IAAI,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAkB;IACrD,MAAM,GAAG,EAAE,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAA0B;IACrE,cAAc,GAAG,EAAE,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY;IACxB,OAAO,MAAM,EAAE,EAAE,CAAC;AACtB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,sBAAsB;IAClC,OAAO,cAAc,CAAC;AAC1B,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,kBAAkB;IAC9B,OAAO,MAAM,KAAK,IAAI,CAAC;AAC3B,CAAC","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/render3d/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA0B,EAAE,GAAW;IACvE,OAAO,SAAS,IAAI,IAAI,GAAG,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACpC,GAAW;IAEX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAyB;QAClD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;KAC7B,CAAC;AACN,CAAC;AAED,IAAI,MAAM,GAA0B,IAAI,CAAC;AACzC,IAAI,cAAc,GAAkC,IAAI,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAkB;IACrD,MAAM,GAAG,EAAE,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAA0B;IACrE,cAAc,GAAG,EAAE,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY;IACxB,OAAO,MAAM,EAAE,EAAE,CAAC;AACtB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,sBAAsB;IAClC,OAAO,cAAc,CAAC;AAC1B,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,kBAAkB;IAC9B,OAAO,MAAM,KAAK,IAAI,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * Backend seams for 3D runtime and resource loading.\n *\n * Core describes 3D scenes but cannot load a 3D runtime — `three` lives in the\n * rendering backend, and core must not import it. So core declares the capability\n * here and the backend registers an implementation at module load, the same shape\n * as the other platform seams (`StorageAdapter`, `Ticker`) and the same\n * \"core owns *whether*, backend owns *how*\" split as `EffectSurface`.\n *\n * With no backend registered every function here is an inert no-op, which is what\n * keeps core usable headless and in unit tests.\n */\n\nimport type { Disposer } from \"@/assets/record\";\n\n/** Loads the backend's 3D runtime. Idempotent and memoised by the backend. */\nexport type Canvas3DWarmup = () => Promise<void>;\n\n/**\n * Loads a resource core can't decode itself. `kind` tells the backend which\n * loader to use; the returned {@link Disposer} frees the parsed result when the\n * asset window moves past it.\n */\nexport type Canvas3DResourceKind = \"hdr\" | \"exr\" | \"gltf\" | \"obj\" | \"cubemap\";\nexport type Canvas3DResourceLoader = (kind: Canvas3DResourceKind, src: string) => Promise<Disposer>;\n\n/**\n * The cache key a loader-backed resource is tracked and stored under.\n *\n * Stated once here because **two packages have to agree on it and neither owns\n * both ends**: core's `declare3DResources` declares the key into the asset\n * scope, and the backend's loader is what later looks the parsed result up by\n * it. A backend that built the string itself would be one refactor away from\n * caching under a key nothing ever reads — a model that silently never appears,\n * which is precisely the failure this seam exists to make impossible.\n *\n * `src` goes last and unescaped: it is a URL and may hold colons of its own, so\n * a reader has to split on the first two separators and take the remainder\n * whole rather than splitting on every one — see {@link parseCanvas3DResourceKey}.\n */\nexport function canvas3DResourceKey(kind: Canvas3DResourceKind, src: string): string {\n return `three:${kind}:${src}`;\n}\n\n/**\n * The `kind` and `src` a {@link canvas3DResourceKey} was built from, or `null`\n * when the string is not one.\n *\n * The inverse exists because the backend's warm queue holds keys rather than\n * pairs: `warmPendingCanvas3D` has to re-drive whatever is outstanding knowing\n * only what it was handed.\n */\nexport function parseCanvas3DResourceKey(\n key: string,\n): { kind: Canvas3DResourceKind; src: string } | null {\n if (!key.startsWith(\"three:\")) return null;\n const rest = key.slice(\"three:\".length);\n const split = rest.indexOf(\":\");\n if (split <= 0) return null;\n return {\n kind: rest.slice(0, split) as Canvas3DResourceKind,\n src: rest.slice(split + 1),\n };\n}\n\nlet warmup: Canvas3DWarmup | null = null;\nlet resourceLoader: Canvas3DResourceLoader | null = null;\n\n/**\n * Register the 3D runtime loader. Called by the rendering backend before it draws,\n * never at import — authors never call this.\n */\nexport function registerCanvas3DWarmup(fn: Canvas3DWarmup): void {\n warmup = fn;\n}\n\n/**\n * Register the loader for resource types core can't decode (HDR/EXR env maps,\n * glTF/OBJ models). Called once by the rendering backend.\n */\nexport function registerCanvas3DResourceLoader(fn: Canvas3DResourceLoader): void {\n resourceLoader = fn;\n}\n\n/**\n * Kick off loading the 3D runtime.\n *\n * `Canvas3D.declareAssets()` loads it through the asset timeline — *before* any\n * frame is drawn — so by the time the first 3D frame paints the runtime is\n * normally already resident and the render pass stays synchronous. The renderer\n * still has a per-frame fallback for the case where it isn't.\n *\n * @internal\n */\nexport function warmCanvas3D(): Promise<void> | void {\n return warmup?.();\n}\n\n/** The registered resource loader, or `null` when no backend supplied one. @internal */\nexport function canvas3DResourceLoader(): Canvas3DResourceLoader | null {\n return resourceLoader;\n}\n\n/** True when a backend has registered a 3D runtime. @internal */\nexport function hasCanvas3DBackend(): boolean {\n return warmup !== null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rounded-box.js","sourceRoot":"","sources":["../../src/render3d/rounded-box.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,MAAc,EAAE,OAAe;IACnD,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA0B;IACzD,MAAM,IAAI,GAAS,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM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,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACvD,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,IAAY;IAC1C,MAAM,GAAG,GAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACjB,OAAO,GAAsB,CAAC;AAClC,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC7C,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import type { BufferGeometry3D } from \"./geometry\";\r\n\r\n/**\r\n * A box with rounded edges and corners, evaluated into vertex buffers.\r\n *\r\n * `Rect` has had `cornerRadius` since the beginning and it is most of what makes\r\n * 2D content read as designed rather than as debug output; the same is true in\r\n * 3D, and it is the one thing a Spline scene has that a bare three scene does\r\n * not. three has no rounded box in core — its `RoundedBoxGeometry` is an addon,\r\n * and importing addons would defeat the lazy `import(\"three\")` boundary — so the\r\n * surface is built here: in core, as plain data, backend-agnostic and testable\r\n * without a GPU, exactly like `evaluateParametric`.\r\n *\r\n * The surface is the Minkowski sum of an inner box (each half-extent reduced by\r\n * `radius`) and a sphere of that radius, which decomposes into 26 patches: 6 flat\r\n * faces, 12 quarter-cylinder edges and 8 spherical-octant corners. Each patch is\r\n * a grid of `core + radius * direction`, where `direction` is also the vertex\r\n * normal — so lighting is exact rather than interpolated off a deformed box.\r\n */\r\nexport interface RoundedBoxOptions {\r\n width: number;\r\n height: number;\r\n depth: number;\r\n radius: number;\r\n /** Face subdivision per axis, as `[x, y, z]`. */\r\n segments: readonly [number, number, number];\r\n}\r\n\r\ntype Vec3 = readonly [number, number, number];\r\n\r\n/** A patch grid, before it is tessellated into the output buffers. */\r\ninterface Grid {\r\n /** Position at grid coordinate `(u, v)`, both in `[0, 1]`. */\r\n position: (u: number, v: number) => Vec3;\r\n /** Unit normal at `(u, v)`. */\r\n normal: (u: number, v: number) => Vec3;\r\n uSteps: number;\r\n vSteps: number;\r\n}\r\n\r\n/**\r\n * Arc resolution for the rounded regions, derived from how round the box\r\n * actually is rather than exposed as a knob.\r\n *\r\n * `segments` means face subdivision on every other shape and has to keep meaning\r\n * that here; a second count just for the arcs would be a field whose right value\r\n * is always \"enough that it looks smooth\". That is a function of the radius\r\n * relative to the box, so it is computed — a barely-rounded edge gets the\r\n * minimum, a nearly-spherical one gets a full sweep.\r\n */\r\nfunction arcSegmentsFor(radius: number, maxHalf: number): number {\r\n if (maxHalf <= 0) return 3;\r\n return Math.max(3, Math.min(16, Math.round((radius / maxHalf) * 40)));\r\n}\r\n\r\n/**\r\n * Build the rounded box's vertex buffers.\r\n *\r\n * Returns a plain {@link BufferGeometry3D}, so the renderer's existing buffer\r\n * path uploads it with no new code, and `Geo.edges`/`Geo.wireframe` derive from\r\n * it like any other geometry.\r\n */\r\nexport function evaluateRoundedBox(options: RoundedBoxOptions): BufferGeometry3D {\r\n const half: Vec3 = [options.width / 2, options.height / 2, options.depth / 2];\r\n const maxHalf = Math.max(half[0], half[1], half[2]);\r\n const radius = Math.max(0, Math.min(options.radius, half[0], half[1], half[2]));\r\n\r\n // The inner box the sphere is swept around. Clamped at zero so a radius equal\r\n // to a half-extent (a fully rounded axis) degenerates to a line rather than\r\n // folding the surface inside out.\r\n const box: Vec3 = [\r\n Math.max(0, half[0] - radius),\r\n Math.max(0, half[1] - radius),\r\n Math.max(0, half[2] - radius),\r\n ];\r\n\r\n const arc = arcSegmentsFor(radius, maxHalf);\r\n\r\n const position: number[] = [];\r\n const normal: number[] = [];\r\n const uv: number[] = [];\r\n const index: number[] = [];\r\n\r\n for (const grid of patches(half, box, radius, options.segments, arc)) {\r\n emit(grid, half, position, normal, uv, index);\r\n }\r\n\r\n return {\r\n type: \"buffer\",\r\n position: new Float32Array(position),\r\n normal: new Float32Array(normal),\r\n uv: new Float32Array(uv),\r\n index: new Uint32Array(index),\r\n staticData: true,\r\n };\r\n}\r\n\r\n/** The 26 patches, in face then edge then corner order. */\r\nfunction* patches(\r\n half: Vec3,\r\n box: Vec3,\r\n radius: number,\r\n segments: readonly [number, number, number],\r\n arc: number,\r\n): Generator<Grid> {\r\n const AXES = [0, 1, 2] as const;\r\n const SIGNS = [-1, 1] as const;\r\n\r\n // 6 faces: flat, spanning the inner box on the two free axes and pinned at\r\n // the full half-extent on its own. Subdivided by `segments`, which is what a\r\n // displacement map reads.\r\n for (const axis of AXES) {\r\n const u = (axis + 1) % 3;\r\n const v = (axis + 2) % 3;\r\n for (const sign of SIGNS) {\r\n const face = axisVector(axis, sign);\r\n yield {\r\n uSteps: segments[u],\r\n vSteps: segments[v],\r\n normal: () => face,\r\n position: (a, b) => {\r\n const point: number[] = [0, 0, 0];\r\n point[axis] = sign * half[axis];\r\n point[u] = lerp(-box[u], box[u], a);\r\n point[v] = lerp(-box[v], box[v], b);\r\n return point as unknown as Vec3;\r\n },\r\n };\r\n }\r\n }\r\n\r\n if (radius <= 0) return;\r\n\r\n // 12 edges: a quarter cylinder. The direction sweeps 90 degrees in the plane\r\n // of the two pinned axes while the core slides along the third.\r\n for (const axis of AXES) {\r\n const a = (axis + 1) % 3;\r\n const b = (axis + 2) % 3;\r\n for (const signA of SIGNS) {\r\n for (const signB of SIGNS) {\r\n yield {\r\n uSteps: arc,\r\n vSteps: segments[axis],\r\n normal: (t) => {\r\n const angle = (t * Math.PI) / 2;\r\n const dir: number[] = [0, 0, 0];\r\n dir[a] = signA * Math.cos(angle);\r\n dir[b] = signB * Math.sin(angle);\r\n return dir as unknown as Vec3;\r\n },\r\n position: (t, s) => {\r\n const angle = (t * Math.PI) / 2;\r\n const point: number[] = [0, 0, 0];\r\n point[a] = signA * (box[a] + radius * Math.cos(angle));\r\n point[b] = signB * (box[b] + radius * Math.sin(angle));\r\n point[axis] = lerp(-box[axis], box[axis], s);\r\n return point as unknown as Vec3;\r\n },\r\n };\r\n }\r\n }\r\n }\r\n\r\n // 8 corners: a spherical octant around a fixed corner of the inner box.\r\n for (const signX of SIGNS) {\r\n for (const signY of SIGNS) {\r\n for (const signZ of SIGNS) {\r\n const corner: Vec3 = [signX * box[0], signY * box[1], signZ * box[2]];\r\n const direction = (u: number, v: number): Vec3 => {\r\n const polar = (u * Math.PI) / 2;\r\n const azimuth = (v * Math.PI) / 2;\r\n return [\r\n signX * Math.sin(polar) * Math.cos(azimuth),\r\n signY * Math.cos(polar),\r\n signZ * Math.sin(polar) * Math.sin(azimuth),\r\n ];\r\n };\r\n yield {\r\n uSteps: arc,\r\n vSteps: arc,\r\n normal: direction,\r\n position: (u, v) => {\r\n const dir = direction(u, v);\r\n return [\r\n corner[0] + radius * dir[0],\r\n corner[1] + radius * dir[1],\r\n corner[2] + radius * dir[2],\r\n ];\r\n },\r\n };\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Tessellate one patch into the output buffers.\r\n *\r\n * Winding is decided per triangle by comparing its own normal against the\r\n * surface normal at that vertex, rather than by reasoning about the sign\r\n * combination that produced the patch: 26 patches is 26 chances to get a\r\n * handedness backwards, and one inverted face on a `faces: \"front\"` mesh is a\r\n * hole you can see through. Degenerate triangles — the pole of a corner octant,\r\n * and every quad of a patch whose extent collapsed to zero — are dropped rather\r\n * than emitted with an undefined normal.\r\n */\r\nfunction emit(\r\n grid: Grid,\r\n half: Vec3,\r\n position: number[],\r\n normal: number[],\r\n uv: number[],\r\n index: number[],\r\n): void {\r\n const base = position.length / 3;\r\n const uCount = grid.uSteps + 1;\r\n const vCount = grid.vSteps + 1;\r\n\r\n for (let vi = 0; vi < vCount; vi++) {\r\n for (let ui = 0; ui < uCount; ui++) {\r\n const u = grid.uSteps === 0 ? 0 : ui / grid.uSteps;\r\n const v = grid.vSteps === 0 ? 0 : vi / grid.vSteps;\r\n const point = grid.position(u, v);\r\n const dir = grid.normal(u, v);\r\n position.push(point[0], point[1], point[2]);\r\n normal.push(dir[0], dir[1], dir[2]);\r\n const [s, t] = planarUv(point, dir, half);\r\n uv.push(s, t);\r\n }\r\n }\r\n\r\n for (let vi = 0; vi < grid.vSteps; vi++) {\r\n for (let ui = 0; ui < grid.uSteps; ui++) {\r\n const a = base + vi * uCount + ui;\r\n const b = a + 1;\r\n const c = a + uCount;\r\n const d = c + 1;\r\n pushTriangle(position, normal, index, a, c, b);\r\n pushTriangle(position, normal, index, b, c, d);\r\n }\r\n }\r\n}\r\n\r\n/** Emit one triangle, flipped if its winding faces away from the surface normal. */\r\nfunction pushTriangle(\r\n position: number[],\r\n normal: number[],\r\n index: number[],\r\n a: number,\r\n b: number,\r\n c: number,\r\n): void {\r\n const ax = position[a * 3], ay = position[a * 3 + 1], az = position[a * 3 + 2];\r\n const bx = position[b * 3], by = position[b * 3 + 1], bz = position[b * 3 + 2];\r\n const cx = position[c * 3], cy = position[c * 3 + 1], cz = position[c * 3 + 2];\r\n\r\n const ux = bx - ax, uy = by - ay, uz = bz - az;\r\n const vx = cx - ax, vy = cy - ay, vz = cz - az;\r\n\r\n const nx = uy * vz - uz * vy;\r\n const ny = uz * vx - ux * vz;\r\n const nz = ux * vy - uy * vx;\r\n\r\n // A collapsed quad — a pole, or a patch with no extent. No orientation to\r\n // decide and no area to shade.\r\n if (nx * nx + ny * ny + nz * nz < 1e-20) return;\r\n\r\n const facing = nx * normal[a * 3] + ny * normal[a * 3 + 1] + nz * normal[a * 3 + 2];\r\n\r\n if (facing >= 0) index.push(a, b, c);\r\n else index.push(a, c, b);\r\n}\r\n\r\n/**\r\n * A planar UV, projected along whichever axis the normal points most strongly\r\n * down.\r\n *\r\n * Deliberately approximate, and documented as such: the faces get an exact\r\n * box-projected UV, which is what a texture on a rounded box is almost always\r\n * for, and the arcs get a continuous projection that meets those faces without a\r\n * seam. An exact arc-length unwrap would need a per-patch atlas, which is a\r\n * texturing feature rather than a shape one.\r\n */\r\nfunction planarUv(point: Vec3, dir: Vec3, half: Vec3): [number, number] {\r\n const ax = Math.abs(dir[0]);\r\n const ay = Math.abs(dir[1]);\r\n const az = Math.abs(dir[2]);\r\n\r\n const axis = ax >= ay && ax >= az ? 0 : ay >= az ? 1 : 2;\r\n const u = (axis + 1) % 3;\r\n const v = (axis + 2) % 3;\r\n\r\n return [\r\n half[u] === 0 ? 0.5 : 0.5 + point[u] / (2 * half[u]),\r\n half[v] === 0 ? 0.5 : 0.5 + point[v] / (2 * half[v]),\r\n ];\r\n}\r\n\r\nfunction axisVector(axis: number, sign: number): Vec3 {\r\n const out: number[] = [0, 0, 0];\r\n out[axis] = sign;\r\n return out as unknown as Vec3;\r\n}\r\n\r\nfunction lerp(from: number, to: number, t: number): number {\r\n return from + (to - from) * t;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"rounded-box.js","sourceRoot":"","sources":["../../src/render3d/rounded-box.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,MAAc,EAAE,OAAe;IACnD,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA0B;IACzD,MAAM,IAAI,GAAS,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO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E,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAEzB,OAAO;QACH,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACvD,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,IAAY;IAC1C,MAAM,GAAG,GAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACjB,OAAO,GAAsB,CAAC;AAClC,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC7C,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import type { BufferGeometry3D } from \"./geometry\";\n\n/**\n * A box with rounded edges and corners, evaluated into vertex buffers.\n *\n * `Rect` has had `cornerRadius` since the beginning and it is most of what makes\n * 2D content read as designed rather than as debug output; the same is true in\n * 3D, and it is the one thing a Spline scene has that a bare three scene does\n * not. three has no rounded box in core — its `RoundedBoxGeometry` is an addon,\n * and importing addons would defeat the lazy `import(\"three\")` boundary — so the\n * surface is built here: in core, as plain data, backend-agnostic and testable\n * without a GPU, exactly like `evaluateParametric`.\n *\n * The surface is the Minkowski sum of an inner box (each half-extent reduced by\n * `radius`) and a sphere of that radius, which decomposes into 26 patches: 6 flat\n * faces, 12 quarter-cylinder edges and 8 spherical-octant corners. Each patch is\n * a grid of `core + radius * direction`, where `direction` is also the vertex\n * normal — so lighting is exact rather than interpolated off a deformed box.\n */\nexport interface RoundedBoxOptions {\n width: number;\n height: number;\n depth: number;\n radius: number;\n /** Face subdivision per axis, as `[x, y, z]`. */\n segments: readonly [number, number, number];\n}\n\ntype Vec3 = readonly [number, number, number];\n\n/** A patch grid, before it is tessellated into the output buffers. */\ninterface Grid {\n /** Position at grid coordinate `(u, v)`, both in `[0, 1]`. */\n position: (u: number, v: number) => Vec3;\n /** Unit normal at `(u, v)`. */\n normal: (u: number, v: number) => Vec3;\n uSteps: number;\n vSteps: number;\n}\n\n/**\n * Arc resolution for the rounded regions, derived from how round the box\n * actually is rather than exposed as a knob.\n *\n * `segments` means face subdivision on every other shape and has to keep meaning\n * that here; a second count just for the arcs would be a field whose right value\n * is always \"enough that it looks smooth\". That is a function of the radius\n * relative to the box, so it is computed — a barely-rounded edge gets the\n * minimum, a nearly-spherical one gets a full sweep.\n */\nfunction arcSegmentsFor(radius: number, maxHalf: number): number {\n if (maxHalf <= 0) return 3;\n return Math.max(3, Math.min(16, Math.round((radius / maxHalf) * 40)));\n}\n\n/**\n * Build the rounded box's vertex buffers.\n *\n * Returns a plain {@link BufferGeometry3D}, so the renderer's existing buffer\n * path uploads it with no new code, and `Geo.edges`/`Geo.wireframe` derive from\n * it like any other geometry.\n */\nexport function evaluateRoundedBox(options: RoundedBoxOptions): BufferGeometry3D {\n const half: Vec3 = [options.width / 2, options.height / 2, options.depth / 2];\n const maxHalf = Math.max(half[0], half[1], half[2]);\n const radius = Math.max(0, Math.min(options.radius, half[0], half[1], half[2]));\n\n // The inner box the sphere is swept around. Clamped at zero so a radius equal\n // to a half-extent (a fully rounded axis) degenerates to a line rather than\n // folding the surface inside out.\n const box: Vec3 = [\n Math.max(0, half[0] - radius),\n Math.max(0, half[1] - radius),\n Math.max(0, half[2] - radius),\n ];\n\n const arc = arcSegmentsFor(radius, maxHalf);\n\n const position: number[] = [];\n const normal: number[] = [];\n const uv: number[] = [];\n const index: number[] = [];\n\n for (const grid of patches(half, box, radius, options.segments, arc)) {\n emit(grid, half, position, normal, uv, index);\n }\n\n return {\n type: \"buffer\",\n position: new Float32Array(position),\n normal: new Float32Array(normal),\n uv: new Float32Array(uv),\n index: new Uint32Array(index),\n staticData: true,\n };\n}\n\n/** The 26 patches, in face then edge then corner order. */\nfunction* patches(\n half: Vec3,\n box: Vec3,\n radius: number,\n segments: readonly [number, number, number],\n arc: number,\n): Generator<Grid> {\n const AXES = [0, 1, 2] as const;\n const SIGNS = [-1, 1] as const;\n\n // 6 faces: flat, spanning the inner box on the two free axes and pinned at\n // the full half-extent on its own. Subdivided by `segments`, which is what a\n // displacement map reads.\n for (const axis of AXES) {\n const u = (axis + 1) % 3;\n const v = (axis + 2) % 3;\n for (const sign of SIGNS) {\n const face = axisVector(axis, sign);\n yield {\n uSteps: segments[u],\n vSteps: segments[v],\n normal: () => face,\n position: (a, b) => {\n const point: number[] = [0, 0, 0];\n point[axis] = sign * half[axis];\n point[u] = lerp(-box[u], box[u], a);\n point[v] = lerp(-box[v], box[v], b);\n return point as unknown as Vec3;\n },\n };\n }\n }\n\n if (radius <= 0) return;\n\n // 12 edges: a quarter cylinder. The direction sweeps 90 degrees in the plane\n // of the two pinned axes while the core slides along the third.\n for (const axis of AXES) {\n const a = (axis + 1) % 3;\n const b = (axis + 2) % 3;\n for (const signA of SIGNS) {\n for (const signB of SIGNS) {\n yield {\n uSteps: arc,\n vSteps: segments[axis],\n normal: (t) => {\n const angle = (t * Math.PI) / 2;\n const dir: number[] = [0, 0, 0];\n dir[a] = signA * Math.cos(angle);\n dir[b] = signB * Math.sin(angle);\n return dir as unknown as Vec3;\n },\n position: (t, s) => {\n const angle = (t * Math.PI) / 2;\n const point: number[] = [0, 0, 0];\n point[a] = signA * (box[a] + radius * Math.cos(angle));\n point[b] = signB * (box[b] + radius * Math.sin(angle));\n point[axis] = lerp(-box[axis], box[axis], s);\n return point as unknown as Vec3;\n },\n };\n }\n }\n }\n\n // 8 corners: a spherical octant around a fixed corner of the inner box.\n for (const signX of SIGNS) {\n for (const signY of SIGNS) {\n for (const signZ of SIGNS) {\n const corner: Vec3 = [signX * box[0], signY * box[1], signZ * box[2]];\n const direction = (u: number, v: number): Vec3 => {\n const polar = (u * Math.PI) / 2;\n const azimuth = (v * Math.PI) / 2;\n return [\n signX * Math.sin(polar) * Math.cos(azimuth),\n signY * Math.cos(polar),\n signZ * Math.sin(polar) * Math.sin(azimuth),\n ];\n };\n yield {\n uSteps: arc,\n vSteps: arc,\n normal: direction,\n position: (u, v) => {\n const dir = direction(u, v);\n return [\n corner[0] + radius * dir[0],\n corner[1] + radius * dir[1],\n corner[2] + radius * dir[2],\n ];\n },\n };\n }\n }\n }\n}\n\n/**\n * Tessellate one patch into the output buffers.\n *\n * Winding is decided per triangle by comparing its own normal against the\n * surface normal at that vertex, rather than by reasoning about the sign\n * combination that produced the patch: 26 patches is 26 chances to get a\n * handedness backwards, and one inverted face on a `faces: \"front\"` mesh is a\n * hole you can see through. Degenerate triangles — the pole of a corner octant,\n * and every quad of a patch whose extent collapsed to zero — are dropped rather\n * than emitted with an undefined normal.\n */\nfunction emit(\n grid: Grid,\n half: Vec3,\n position: number[],\n normal: number[],\n uv: number[],\n index: number[],\n): void {\n const base = position.length / 3;\n const uCount = grid.uSteps + 1;\n const vCount = grid.vSteps + 1;\n\n for (let vi = 0; vi < vCount; vi++) {\n for (let ui = 0; ui < uCount; ui++) {\n const u = grid.uSteps === 0 ? 0 : ui / grid.uSteps;\n const v = grid.vSteps === 0 ? 0 : vi / grid.vSteps;\n const point = grid.position(u, v);\n const dir = grid.normal(u, v);\n position.push(point[0], point[1], point[2]);\n normal.push(dir[0], dir[1], dir[2]);\n const [s, t] = planarUv(point, dir, half);\n uv.push(s, t);\n }\n }\n\n for (let vi = 0; vi < grid.vSteps; vi++) {\n for (let ui = 0; ui < grid.uSteps; ui++) {\n const a = base + vi * uCount + ui;\n const b = a + 1;\n const c = a + uCount;\n const d = c + 1;\n pushTriangle(position, normal, index, a, c, b);\n pushTriangle(position, normal, index, b, c, d);\n }\n }\n}\n\n/** Emit one triangle, flipped if its winding faces away from the surface normal. */\nfunction pushTriangle(\n position: number[],\n normal: number[],\n index: number[],\n a: number,\n b: number,\n c: number,\n): void {\n const ax = position[a * 3], ay = position[a * 3 + 1], az = position[a * 3 + 2];\n const bx = position[b * 3], by = position[b * 3 + 1], bz = position[b * 3 + 2];\n const cx = position[c * 3], cy = position[c * 3 + 1], cz = position[c * 3 + 2];\n\n const ux = bx - ax, uy = by - ay, uz = bz - az;\n const vx = cx - ax, vy = cy - ay, vz = cz - az;\n\n const nx = uy * vz - uz * vy;\n const ny = uz * vx - ux * vz;\n const nz = ux * vy - uy * vx;\n\n // A collapsed quad — a pole, or a patch with no extent. No orientation to\n // decide and no area to shade.\n if (nx * nx + ny * ny + nz * nz < 1e-20) return;\n\n const facing = nx * normal[a * 3] + ny * normal[a * 3 + 1] + nz * normal[a * 3 + 2];\n\n if (facing >= 0) index.push(a, b, c);\n else index.push(a, c, b);\n}\n\n/**\n * A planar UV, projected along whichever axis the normal points most strongly\n * down.\n *\n * Deliberately approximate, and documented as such: the faces get an exact\n * box-projected UV, which is what a texture on a rounded box is almost always\n * for, and the arcs get a continuous projection that meets those faces without a\n * seam. An exact arc-length unwrap would need a per-patch atlas, which is a\n * texturing feature rather than a shape one.\n */\nfunction planarUv(point: Vec3, dir: Vec3, half: Vec3): [number, number] {\n const ax = Math.abs(dir[0]);\n const ay = Math.abs(dir[1]);\n const az = Math.abs(dir[2]);\n\n const axis = ax >= ay && ax >= az ? 0 : ay >= az ? 1 : 2;\n const u = (axis + 1) % 3;\n const v = (axis + 2) % 3;\n\n return [\n half[u] === 0 ? 0.5 : 0.5 + point[u] / (2 * half[u]),\n half[v] === 0 ? 0.5 : 0.5 + point[v] / (2 * half[v]),\n ];\n}\n\nfunction axisVector(axis: number, sign: number): Vec3 {\n const out: number[] = [0, 0, 0];\n out[axis] = sign;\n return out as unknown as Vec3;\n}\n\nfunction lerp(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-settings.js","sourceRoot":"","sources":["../../src/render3d/scene-settings.ts"],"names":[],"mappings":"AA6FA,6CAA6C;AAC7C,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IACzD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\
|
|
1
|
+
{"version":3,"file":"scene-settings.js","sourceRoot":"","sources":["../../src/render3d/scene-settings.ts"],"names":[],"mappings":"AA6FA,6CAA6C;AAC7C,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IACzD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;AACvC,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type { Passthrough3D } from \"./geometry\";\nimport type { Uniform3D } from \"./material\";\nimport type { Vector3Input } from \"./vector3\";\n\n/**\n * Depth haze that fades distant geometry toward a colour.\n *\n * One shape rather than a discriminated pair: setting {@link density} is\n * exponential fog and setting {@link near}/{@link far} is linear, which is what\n * the old `type` field said twice. Writing `type: \"exponential\"` beside a `far`\n * silently dropped the `far`; there is nothing to get wrong now.\n *\n * `color` is derived from the viewport's own fill when omitted. Fog that does not\n * match what is behind it reads as a grey wall rather than as distance, and the\n * two colours being separately typed by hand is exactly how they drift.\n */\nexport interface FogData3D {\n color?: Color;\n /** Linear fog: distance at which fog begins. */\n near?: number;\n /** Linear fog: distance at which fog is total. */\n far?: number;\n /** Exponential-squared falloff. Wins over {@link near}/{@link far}. */\n density?: number;\n}\n\n/**\n * Image-based lighting, and the sky it comes from.\n *\n * Light and background are one control because they are one physical thing: an\n * HDRI that lights a scene is the same panorama you see behind it, and having\n * them as two nodes meant setting one, wondering why metal was black or why the\n * sky was missing, and setting the other.\n *\n * This is also *all* that is left of the old `Background3D`. A solid colour, a\n * gradient or a flat image behind the scene is a **2D fill** — `Canvas3D` is a\n * `Rect` and already composites its 3D pass over its own fill layers, the\n * renderer already clears transparent, and neither lighting nor fog touches a\n * three background, so the 3D path was doing strictly less than the 2D one it sat\n * in front of. What genuinely needs the 3D pass is a sky that *reprojects* as the\n * camera turns, which is this.\n *\n * ── What renders today ────────────────────────────────────────────────────────\n * Only {@link preset} `\"studio\"` (a neutral grey room generated per renderer).\n * {@link src} and {@link faces} are declared, tracked by the asset window and\n * recorded, but no backend loads an HDR, EXR or cubemap: an environment that\n * names only those lights nothing and draws no {@link background}. {@link params}\n * is not applied either. In development, the first of each warns.\n */\nexport interface EnvironmentData3D extends Passthrough3D {\n /**\n * A 360° panorama — `.hdr`/`.exr` for real IBL, or a plain image.\n * **Not loaded yet**: see the note on the type.\n */\n src?: string;\n /**\n * Six faces, in three's order: +X, −X, +Y, −Y, +Z, −Z.\n * **Not loaded yet**: see the note on the type.\n */\n faces?: readonly string[];\n /** A built-in studio interior. Needs no asset — the fastest way to good metal. The only environment that renders. */\n preset?: \"studio\";\n /** Multiplies the light received. Default 1. */\n intensity?: number;\n /** Rotate the panorama, in **degrees**. */\n rotation?: Vector3Input;\n /** Also draw it behind the scene, as an infinitely distant sky. Draws the `preset`; there is nothing to draw for `src`/`faces`. */\n background?: boolean;\n /** Blur applied to the background only, 0–1. Leaves the lighting sharp. */\n blur?: number;\n}\n\n/**\n * Scene-wide shadow settings.\n *\n * `quality` stands in for the map resolution and the filter three exposes\n * separately (`pcf`, `pcfSoft`, `vsm`, `mapSize`): those two are chosen together\n * in practice, and neither is a design decision. Individual lights soften their\n * own shadow; objects opt out with `shadow={false}`.\n *\n * Enabling shadows recompiles every material that receives them, so treat this as\n * setup rather than something to animate.\n */\nexport interface ShadowSettings3D {\n enabled?: boolean;\n /** Default `\"medium\"`. */\n quality?: \"low\" | \"medium\" | \"high\";\n}\n\n/** Shadows as written on a viewport: a switch, or the settings. */\nexport type Shadows3D = boolean | ShadowSettings3D;\n\n/** Normalize a viewport's `shadows` prop. */\nexport function resolveShadows3D(value: Shadows3D | undefined): ShadowSettings3D | null {\n if (value === undefined || value === false) return null;\n if (value === true) return { enabled: true };\n return { enabled: true, ...value };\n}\n\n/**\n * How high-dynamic-range colour is mapped into displayable range.\n *\n * `\"aces\"` is the filmic default most renderers use and handles bright\n * highlights gracefully; `\"none\"` clips them. Materials opt out individually with\n * `toneMapped: false` — useful for UI-like overlays that must keep an exact colour.\n */\nexport type ToneMapping3D =\n | \"none\"\n | \"linear\"\n | \"reinhard\"\n | \"cineon\"\n | \"aces\"\n | \"agx\"\n | \"neutral\";\n\n/** Tone mapping and exposure, as a viewport carries them. */\nexport interface ToneSettings3D {\n mapping?: ToneMapping3D;\n /** Stops of exposure applied before mapping. Default 1. */\n exposure?: number;\n}\n\n/**\n * A full-frame post-processing pass, applied after the scene renders.\n *\n * Deliberately short, because most of what used to be here is a 2D effect. A\n * `Canvas3D` is a `Node2D`, so it already carries the whole `effects` chain —\n * vignette, grain, colour grading, blur, chromatic aberration and the rest run\n * over the composited result with no 3D pass involved, and post-process\n * antialiasing is what the viewport's own `antialias` already does with MSAA.\n *\n * What is left are the passes that genuinely need what only the 3D pass has:\n * `ssao` and `dof` read the depth buffer, `outline` reads object ids, and `bloom`\n * reads **HDR radiance before tone mapping** — which is why an emissive surface\n * blooms here and merely brightens under the 2D chain. `shaderPass` stays as the\n * escape hatch for a pass that needs to sit inside the 3D composite.\n *\n * Post-processing forces the render through an offscreen target, so a scene with\n * any of these costs more than one without, even for a cheap effect.\n *\n * **No pass is applied yet.** The chain is recorded on the scene and read only to\n * track the textures a `shaderPass` names; a scene with `bloom` renders exactly\n * like one without, and so does every `params` on an effect. The first `post` set\n * in development warns. Until the passes land, use the 2D `effects` of the\n * `Canvas3D`, which run over its composited result.\n */\nexport type PostEffect3D =\n /** Bleeds light from bright pixels, in HDR. What makes `emission` actually glow. */\n | ({ type: \"bloom\"; strength?: number; radius?: number; threshold?: number } & Passthrough3D)\n /** Contact shadows in creases, from screen-space geometry. */\n | ({ type: \"ssao\"; radius?: number; intensity?: number } & Passthrough3D)\n | ({ type: \"outline\"; color?: Color; thickness?: number } & Passthrough3D)\n /** Depth of field. `focus` is the sharp distance, `aperture` the blur strength. */\n | ({ type: \"dof\"; focus?: number; aperture?: number; maxBlur?: number } & Passthrough3D)\n /** Anything expressible as one fragment pass inside the 3D composite. */\n | ({ type: \"shaderPass\"; fragment: string; uniforms?: Readonly<Record<string, Uniform3D>> } & Passthrough3D);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene3d.js","sourceRoot":"","sources":["../../src/render3d/scene3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACH,gBAAgB,GAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAqBtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,OAAQ,SAAQ,eAAe;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C,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC;YAClE,MAAM,IAAI,KAAK,CACX,eAAe,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAClD,CAAC;QACN,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { DRAWABLE_KINDS, Graphics3D, type Graphics3DOp } from \"./graphics3d\";\r\nimport { RenderContext3D, type Node3DRenderState } from \"./render-context3d\";\r\nimport type { CameraData3D, OrthographicCameraData3D, PerspectiveCameraData3D } from \"./camera\";\r\nimport type { LightData3D } from \"./light\";\r\nimport {\r\n resolveShadows3D,\r\n type EnvironmentData3D, type FogData3D, type PostEffect3D,\r\n type ShadowSettings3D, type Shadows3D, type ToneSettings3D,\r\n} from \"./scene-settings\";\r\nimport { warnInert3D } from \"./inert\";\r\nimport type { Shadow3D, Transform3D } from \"./transform\";\r\nimport type { Color } from \"@/attributes/shape/fill/color/parser\";\r\n\r\n/** Options accepted by every `Camera3D` node and by {@link Scene3D.perspective}. */\r\ntype ParamsOf<T extends { type: string }> = Omit<T, \"type\">;\r\n\r\n/**\r\n * One recorded operation in a {@link Scene3D}.\r\n *\r\n * A superset of {@link Graphics3DOp}: everything a node draws, plus the four\r\n * things that describe the scene around it — the `push`/`pop` nesting the node\r\n * tree produces, the lights in it, and where it is viewed from.\r\n */\r\nexport type Scene3DOp =\r\n | { kind: \"push\"; transform?: Transform3D }\r\n | { kind: \"pop\" }\r\n | { kind: \"light\"; light: LightData3D; transform?: Transform3D }\r\n | { kind: \"camera\"; camera: CameraData3D }\r\n | Graphics3DOp;\r\n\r\n/**\r\n * A recorded 3D scene — and the {@link RenderContext3D} that records it.\r\n *\r\n * One value plays both parts, exactly as `Graphics2D` is both the builder and the\r\n * thing handed to a backend. A `Node3D` tree draws into it, and the result is a\r\n * flat op list plus a handful of scene-wide settings that a renderer replays.\r\n *\r\n * Almost always produced for you: a `Canvas3D` opens one per frame, walks its\r\n * `Node3D` children through it and paints the result through its own path. The\r\n * builder surface below is the escape hatch — it is what lets a scene be shaded\r\n * through *any* 2D shape rather than only a rect:\r\n *\r\n * const scene = new Scene3D()\r\n * .perspective({ orbit: 30, elevation: 20, distance: 6 })\r\n * .light({ type: \"ambient\", intensity: 0.4 })\r\n * .draw(new Graphics3D().box({ width: 2, fill: \"tomato\" }));\r\n *\r\n * Text({ text: \"DEPTH\", fontSize: 320, fill: scene })\r\n *\r\n * A bare `Scene3D` coerces to a `canvas3D` fill the way a bare CSS string coerces\r\n * to a solid one, so `fill={scene}` and `fill={[\"#0b0d12\", scene]}` both work.\r\n */\r\nexport class Scene3D extends RenderContext3D {\r\n private _ops: Scene3DOp[] = [];\r\n private _camera: CameraData3D | null = null;\r\n private _fog: FogData3D | null = null;\r\n private _environment: EnvironmentData3D | null = null;\r\n private _shadows: ShadowSettings3D | null = null;\r\n private _tone: ToneSettings3D | null = null;\r\n private _post: PostEffect3D[] = [];\r\n /** Open `push` count, so {@link assertBalanced} can report a leak. */\r\n private _depth = 0;\r\n /**\r\n * The `shadow` of each open node scope, innermost last (`undefined` for a\r\n * scope that states none). What a drawable that states none of its own takes.\r\n */\r\n private _shadowScopes: (Shadow3D | undefined)[] = [];\r\n\r\n // ─── Node scopes ─────────────────────────────────────────────────────────\r\n\r\n override begin(state: Node3DRenderState): void {\r\n // The node's id rides on the transform's `key`, which is the renderer's\r\n // identity slot — so a group is cached against the node that opened it\r\n // rather than against its index among its siblings.\r\n this._ops.push({ kind: \"push\", transform: { ...state.transform, key: state.id } });\r\n this._shadowScopes.push(state.transform?.shadow);\r\n this._depth++;\r\n }\r\n\r\n override end(): void {\r\n this._ops.push({ kind: \"pop\" });\r\n this._shadowScopes.pop();\r\n this._depth--;\r\n }\r\n\r\n // ─── Drawables ───────────────────────────────────────────────────────────\r\n\r\n /**\r\n * Splice what a node draws into the scene at the current scope.\r\n *\r\n * The ops are copied rather than referenced: a `Graphics3D` is rebuilt every\r\n * frame, so there is nothing to share, and a flat list is what the renderer\r\n * walks.\r\n *\r\n * A drawable that states no `shadow` of its own takes the one of the node\r\n * scope it is drawn in. That is what carries a node's `shadow` to its mesh: the\r\n * node's scope becomes a group, and a renderer reads casting and receiving off\r\n * the mesh, never off a group, so the scope's value would otherwise never be\r\n * seen. A `shadow` on the op itself wins.\r\n */\r\n override draw(graphics: Graphics3D): this {\r\n const ops = graphics.ops();\r\n const scope = this._shadowScopes[this._shadowScopes.length - 1];\r\n for (let i = 0; i < ops.length; i++) {\r\n const op = ops[i];\r\n if (scope === undefined || op.transform?.shadow !== undefined) {\r\n this._ops.push(op);\r\n } else {\r\n this._ops.push({ ...op, transform: { ...op.transform, shadow: scope } });\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n // ─── Lights ──────────────────────────────────────────────────────────────\r\n\r\n override light(light: LightData3D, transform?: Transform3D): this {\r\n this._ops.push({ kind: \"light\", light, transform });\r\n return this;\r\n }\r\n\r\n // ─── Camera ──────────────────────────────────────────────────────────────\r\n\r\n override camera(camera: CameraData3D): this {\r\n this._camera = camera;\r\n this._ops.push({ kind: \"camera\", camera });\r\n return this;\r\n }\r\n\r\n /** Set a perspective camera. The usual choice. */\r\n perspective(options?: ParamsOf<PerspectiveCameraData3D>): this {\r\n return this.camera({ type: \"perspective\", ...options } as PerspectiveCameraData3D);\r\n }\r\n\r\n /** Set an orthographic camera — parallel projection, for isometric looks. */\r\n orthographic(options?: ParamsOf<OrthographicCameraData3D>): this {\r\n return this.camera({ type: \"orthographic\", ...options } as OrthographicCameraData3D);\r\n }\r\n\r\n // ─── Scene settings ──────────────────────────────────────────────────────\r\n //\r\n // Fields rather than ops: a scene has exactly one fog and one environment.\r\n // Recording them positionally would imply an ordering that doesn't exist.\r\n // Last writer wins.\r\n\r\n override fog(fog: FogData3D | Color | null): this {\r\n if (fog === null) {\r\n this._fog = null;\r\n } else if (typeof fog === \"object\" && !Array.isArray(fog)) {\r\n this._fog = fog as FogData3D;\r\n } else {\r\n this._fog = { color: fog as Color };\r\n }\r\n return this;\r\n }\r\n\r\n override environment(environment: EnvironmentData3D | null): this {\r\n if (environment) {\r\n if (environment.src !== undefined || (environment.faces?.length ?? 0) > 0) {\r\n warnInert3D(\r\n \"environment-src\",\r\n \"An environment's `src` and `faces` (HDR, EXR, cubemap) are recorded, and no backend loads them. Only `preset: \\\"studio\\\"` is rendered: \"\r\n + \"without a preset the scene gets no image-based light and its `background` is not drawn.\",\r\n );\r\n }\r\n if (environment.params && Object.keys(environment.params).length > 0) {\r\n warnInert3D(\r\n \"environment-params\",\r\n \"`params` on an environment is not applied: nothing assigns it onto the generated environment.\",\r\n );\r\n }\r\n }\r\n this._environment = environment;\r\n return this;\r\n }\r\n\r\n override shadows(settings?: Shadows3D): this {\r\n this._shadows = resolveShadows3D(settings ?? true);\r\n return this;\r\n }\r\n\r\n override tone(settings: ToneSettings3D): this {\r\n this._tone = settings;\r\n return this;\r\n }\r\n\r\n override post(effects: PostEffect3D | readonly PostEffect3D[]): this {\r\n const added = Array.isArray(effects) ? (effects as PostEffect3D[]) : [effects as PostEffect3D];\r\n if (added.length > 0) {\r\n warnInert3D(\r\n \"post\",\r\n `Post-processing (${added.map((effect) => `\"${effect.type}\"`).join(\", \")}) is recorded, and no backend applies a pass: the scene renders exactly as it would without \\`post\\`. `\r\n + \"Use the Canvas3D's 2D `effects` over the composited result instead.\",\r\n );\r\n }\r\n this._post.push(...added);\r\n return this;\r\n }\r\n\r\n // ─── Consumption ─────────────────────────────────────────────────────────\r\n\r\n /** The recorded ops, in order. Replayed by the renderer. */\r\n ops(): readonly Scene3DOp[] {\r\n return this._ops;\r\n }\r\n\r\n /** The camera, or `null` to let the renderer supply a default framing. */\r\n cameraDescriptor(): CameraData3D | null {\r\n return this._camera;\r\n }\r\n fogDescriptor(): FogData3D | null {\r\n return this._fog;\r\n }\r\n environmentDescriptor(): EnvironmentData3D | null {\r\n return this._environment;\r\n }\r\n shadowSettings(): ShadowSettings3D | null {\r\n return this._shadows;\r\n }\r\n toneSettings(): ToneSettings3D | null {\r\n return this._tone;\r\n }\r\n postEffects(): readonly PostEffect3D[] {\r\n return this._post;\r\n }\r\n\r\n /**\r\n * True when nothing would be drawn — no mesh, light or other drawable. The\r\n * node skips the whole 3D pass (and the WebGL context entirely) in that case.\r\n */\r\n isEmpty(): boolean {\r\n return !this._ops.some((op) => DRAWABLE_KINDS.has(op.kind));\r\n }\r\n\r\n /**\r\n * Throw if `push` and `pop` are unbalanced. Called once by the consumer before\r\n * replay, so a mismatched scope fails loudly rather than silently reparenting\r\n * everything after it.\r\n *\r\n * A `Node3D` tree cannot get this wrong — `begin`/`end` are bracketed by the\r\n * walk — so in practice this catches a hand-built scene.\r\n */\r\n assertBalanced(): void {\r\n if (this._depth !== 0) {\r\n const verb = this._depth > 0 ? \"unclosed begin()\" : \"extra end()\";\r\n throw new Error(\r\n `Scene3D has ${Math.abs(this._depth)} ${verb}.`,\r\n );\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"scene3d.js","sourceRoot":"","sources":["../../src/render3d/scene3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACH,gBAAgB,GAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAqBtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,OAAQ,SAAQ,eAAe;IAChC,IAAI,GAAgB,EAAE,CAAC;IACvB,OAAO,GAAwB,IAAI,CAAC;IACpC,IAAI,GAAqB,IAAI,CAAC;IAC9B,YAAY,GAA6B,IAAI,CAAC;IAC9C,QAAQ,GAA4B,IAAI,CAAC;IACzC,KAAK,GAA0B,IAAI,CAAC;IACpC,KAAK,GAAmB,EAAE,CAAC;IACnC,sEAAsE;IAC9D,MAAM,GAAG,CAAC,CAAC;IACnB;;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,IAAI,CAAC,IAAI,CAAC,wGAAwG;kBAC9K,qEAAqE,CAC1E,CAAC;QACN,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,4EAA4E;IAE5E,4DAA4D;IAC5D,GAAG;QACC,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,0EAA0E;IAC1E,gBAAgB;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,aAAa;QACT,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IACD,qBAAqB;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,cAAc;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,YAAY;QACR,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACD,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,OAAO;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,cAAc;QACV,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC;YAClE,MAAM,IAAI,KAAK,CACX,eAAe,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAClD,CAAC;QACN,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { DRAWABLE_KINDS, Graphics3D, type Graphics3DOp } from \"./graphics3d\";\nimport { RenderContext3D, type Node3DRenderState } from \"./render-context3d\";\nimport type { CameraData3D, OrthographicCameraData3D, PerspectiveCameraData3D } from \"./camera\";\nimport type { LightData3D } from \"./light\";\nimport {\n resolveShadows3D,\n type EnvironmentData3D, type FogData3D, type PostEffect3D,\n type ShadowSettings3D, type Shadows3D, type ToneSettings3D,\n} from \"./scene-settings\";\nimport { warnInert3D } from \"./inert\";\nimport type { Shadow3D, Transform3D } from \"./transform\";\nimport type { Color } from \"@/attributes/shape/fill/color/parser\";\n\n/** Options accepted by every `Camera3D` node and by {@link Scene3D.perspective}. */\ntype ParamsOf<T extends { type: string }> = Omit<T, \"type\">;\n\n/**\n * One recorded operation in a {@link Scene3D}.\n *\n * A superset of {@link Graphics3DOp}: everything a node draws, plus the four\n * things that describe the scene around it — the `push`/`pop` nesting the node\n * tree produces, the lights in it, and where it is viewed from.\n */\nexport type Scene3DOp =\n | { kind: \"push\"; transform?: Transform3D }\n | { kind: \"pop\" }\n | { kind: \"light\"; light: LightData3D; transform?: Transform3D }\n | { kind: \"camera\"; camera: CameraData3D }\n | Graphics3DOp;\n\n/**\n * A recorded 3D scene — and the {@link RenderContext3D} that records it.\n *\n * One value plays both parts, exactly as `Graphics2D` is both the builder and the\n * thing handed to a backend. A `Node3D` tree draws into it, and the result is a\n * flat op list plus a handful of scene-wide settings that a renderer replays.\n *\n * Almost always produced for you: a `Canvas3D` opens one per frame, walks its\n * `Node3D` children through it and paints the result through its own path. The\n * builder surface below is the escape hatch — it is what lets a scene be shaded\n * through *any* 2D shape rather than only a rect:\n *\n * const scene = new Scene3D()\n * .perspective({ orbit: 30, elevation: 20, distance: 6 })\n * .light({ type: \"ambient\", intensity: 0.4 })\n * .draw(new Graphics3D().box({ width: 2, fill: \"tomato\" }));\n *\n * Text({ text: \"DEPTH\", fontSize: 320, fill: scene })\n *\n * A bare `Scene3D` coerces to a `canvas3D` fill the way a bare CSS string coerces\n * to a solid one, so `fill={scene}` and `fill={[\"#0b0d12\", scene]}` both work.\n */\nexport class Scene3D extends RenderContext3D {\n private _ops: Scene3DOp[] = [];\n private _camera: CameraData3D | null = null;\n private _fog: FogData3D | null = null;\n private _environment: EnvironmentData3D | null = null;\n private _shadows: ShadowSettings3D | null = null;\n private _tone: ToneSettings3D | null = null;\n private _post: PostEffect3D[] = [];\n /** Open `push` count, so {@link assertBalanced} can report a leak. */\n private _depth = 0;\n /**\n * The `shadow` of each open node scope, innermost last (`undefined` for a\n * scope that states none). What a drawable that states none of its own takes.\n */\n private _shadowScopes: (Shadow3D | undefined)[] = [];\n\n // ─── Node scopes ─────────────────────────────────────────────────────────\n\n override begin(state: Node3DRenderState): void {\n // The node's id rides on the transform's `key`, which is the renderer's\n // identity slot — so a group is cached against the node that opened it\n // rather than against its index among its siblings.\n this._ops.push({ kind: \"push\", transform: { ...state.transform, key: state.id } });\n this._shadowScopes.push(state.transform?.shadow);\n this._depth++;\n }\n\n override end(): void {\n this._ops.push({ kind: \"pop\" });\n this._shadowScopes.pop();\n this._depth--;\n }\n\n // ─── Drawables ───────────────────────────────────────────────────────────\n\n /**\n * Splice what a node draws into the scene at the current scope.\n *\n * The ops are copied rather than referenced: a `Graphics3D` is rebuilt every\n * frame, so there is nothing to share, and a flat list is what the renderer\n * walks.\n *\n * A drawable that states no `shadow` of its own takes the one of the node\n * scope it is drawn in. That is what carries a node's `shadow` to its mesh: the\n * node's scope becomes a group, and a renderer reads casting and receiving off\n * the mesh, never off a group, so the scope's value would otherwise never be\n * seen. A `shadow` on the op itself wins.\n */\n override draw(graphics: Graphics3D): this {\n const ops = graphics.ops();\n const scope = this._shadowScopes[this._shadowScopes.length - 1];\n for (let i = 0; i < ops.length; i++) {\n const op = ops[i];\n if (scope === undefined || op.transform?.shadow !== undefined) {\n this._ops.push(op);\n } else {\n this._ops.push({ ...op, transform: { ...op.transform, shadow: scope } });\n }\n }\n return this;\n }\n\n // ─── Lights ──────────────────────────────────────────────────────────────\n\n override light(light: LightData3D, transform?: Transform3D): this {\n this._ops.push({ kind: \"light\", light, transform });\n return this;\n }\n\n // ─── Camera ──────────────────────────────────────────────────────────────\n\n override camera(camera: CameraData3D): this {\n this._camera = camera;\n this._ops.push({ kind: \"camera\", camera });\n return this;\n }\n\n /** Set a perspective camera. The usual choice. */\n perspective(options?: ParamsOf<PerspectiveCameraData3D>): this {\n return this.camera({ type: \"perspective\", ...options } as PerspectiveCameraData3D);\n }\n\n /** Set an orthographic camera — parallel projection, for isometric looks. */\n orthographic(options?: ParamsOf<OrthographicCameraData3D>): this {\n return this.camera({ type: \"orthographic\", ...options } as OrthographicCameraData3D);\n }\n\n // ─── Scene settings ──────────────────────────────────────────────────────\n //\n // Fields rather than ops: a scene has exactly one fog and one environment.\n // Recording them positionally would imply an ordering that doesn't exist.\n // Last writer wins.\n\n override fog(fog: FogData3D | Color | null): this {\n if (fog === null) {\n this._fog = null;\n } else if (typeof fog === \"object\" && !Array.isArray(fog)) {\n this._fog = fog as FogData3D;\n } else {\n this._fog = { color: fog as Color };\n }\n return this;\n }\n\n override environment(environment: EnvironmentData3D | null): this {\n if (environment) {\n if (environment.src !== undefined || (environment.faces?.length ?? 0) > 0) {\n warnInert3D(\n \"environment-src\",\n \"An environment's `src` and `faces` (HDR, EXR, cubemap) are recorded, and no backend loads them. Only `preset: \\\"studio\\\"` is rendered: \"\n + \"without a preset the scene gets no image-based light and its `background` is not drawn.\",\n );\n }\n if (environment.params && Object.keys(environment.params).length > 0) {\n warnInert3D(\n \"environment-params\",\n \"`params` on an environment is not applied: nothing assigns it onto the generated environment.\",\n );\n }\n }\n this._environment = environment;\n return this;\n }\n\n override shadows(settings?: Shadows3D): this {\n this._shadows = resolveShadows3D(settings ?? true);\n return this;\n }\n\n override tone(settings: ToneSettings3D): this {\n this._tone = settings;\n return this;\n }\n\n override post(effects: PostEffect3D | readonly PostEffect3D[]): this {\n const added = Array.isArray(effects) ? (effects as PostEffect3D[]) : [effects as PostEffect3D];\n if (added.length > 0) {\n warnInert3D(\n \"post\",\n `Post-processing (${added.map((effect) => `\"${effect.type}\"`).join(\", \")}) is recorded, and no backend applies a pass: the scene renders exactly as it would without \\`post\\`. `\n + \"Use the Canvas3D's 2D `effects` over the composited result instead.\",\n );\n }\n this._post.push(...added);\n return this;\n }\n\n // ─── Consumption ─────────────────────────────────────────────────────────\n\n /** The recorded ops, in order. Replayed by the renderer. */\n ops(): readonly Scene3DOp[] {\n return this._ops;\n }\n\n /** The camera, or `null` to let the renderer supply a default framing. */\n cameraDescriptor(): CameraData3D | null {\n return this._camera;\n }\n fogDescriptor(): FogData3D | null {\n return this._fog;\n }\n environmentDescriptor(): EnvironmentData3D | null {\n return this._environment;\n }\n shadowSettings(): ShadowSettings3D | null {\n return this._shadows;\n }\n toneSettings(): ToneSettings3D | null {\n return this._tone;\n }\n postEffects(): readonly PostEffect3D[] {\n return this._post;\n }\n\n /**\n * True when nothing would be drawn — no mesh, light or other drawable. The\n * node skips the whole 3D pass (and the WebGL context entirely) in that case.\n */\n isEmpty(): boolean {\n return !this._ops.some((op) => DRAWABLE_KINDS.has(op.kind));\n }\n\n /**\n * Throw if `push` and `pop` are unbalanced. Called once by the consumer before\n * replay, so a mismatched scope fails loudly rather than silently reparenting\n * everything after it.\n *\n * A `Node3D` tree cannot get this wrong — `begin`/`end` are bracketed by the\n * walk — so in practice this catches a hand-built scene.\n */\n assertBalanced(): void {\n if (this._depth !== 0) {\n const verb = this._depth > 0 ? \"unclosed begin()\" : \"extra end()\";\n throw new Error(\n `Scene3D has ${Math.abs(this._depth)} ${verb}.`,\n );\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../src/render3d/segments.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CACtB,KAA6B,EAC7B,QAA2B;IAE3B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC3D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../src/render3d/segments.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CACtB,KAA6B,EAC7B,QAA2B;IAE3B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC3D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * Subdivision counts, as one name.\n *\n * three spells this ten different ways — `widthSegments`, `heightSegments`,\n * `depthSegments`, `radialSegments`, `tubularSegments`, `thetaSegments`,\n * `phiSegments`, `capSegments`, `curveSegments`, `detail` — and which one a given\n * shape wants is a thing an author has to look up every time. Every geometry here\n * takes one {@link Segments3D} instead, and the per-axis meaning is documented on\n * the shape rather than encoded in a name.\n *\n * A scalar applies to every axis, which is what you want when you are just\n * turning the resolution up. A tuple is per-axis, in the order the shape's own\n * docs give.\n */\nexport type Segments3D =\n | number\n | readonly [number]\n | readonly [number, number]\n | readonly [number, number, number];\n\n/**\n * Resolve a {@link Segments3D} against a shape's per-axis defaults.\n *\n * A scalar broadcasts, a tuple fills what it names and leaves the rest at the\n * default, and `undefined` is entirely defaults — so an unset `segments` never\n * pins a shape to a resolution invented at a call site.\n *\n * Values are floored and clamped to at least 1, because a fractional or zero\n * subdivision count reaches three as a degenerate geometry rather than as an\n * error.\n */\nexport function segmentsOf(\n value: Segments3D | undefined,\n defaults: readonly number[],\n): number[] {\n if (value === undefined) return defaults.map(clampSegment);\n if (typeof value === \"number\") return defaults.map(() => clampSegment(value));\n return defaults.map((fallback, index) => clampSegment(value[index] ?? fallback));\n}\n\nfunction clampSegment(value: number): number {\n return Math.max(1, Math.floor(value));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../src/render3d/texture.ts"],"names":[],"mappings":"AAkKA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAuB;IACxD,OAAO,OAAQ,MAAqB,CAAC,GAAG,KAAK,UAAU;QACnD,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAoB,EAAE;QACtD,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAgB,EAAE,CAAC;AACnD,CAAC;AAQD,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,OAAkB;IAC9C,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,IAAI,OAAO,CAAC;AAC5D,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,kBAAkB,CAAC,OAAkB;IACjD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,QAAQ,IAAI,OAAO,CAAC;AAC9D,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,gBAAgB,CAAC,OAAkB;IAC/C,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAkB;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IAChD,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACzE,OAAO,OAAO,CAAC,GAAG,CAAC;AACvB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;WACrB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;WACrB,0DAA0D,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClF,CAAC","sourcesContent":["import type { Vector2 } from \"@/attributes/layout/vector2\";\r\n// Type-only, like `Color` above: `render3d` is pure data and never reaches into\r\n// the render or node layers at runtime. See SurfaceSource3D.\r\nimport type { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\r\n\r\n/** How sampling behaves outside the 0–1 UV range. */\r\nexport type TextureWrap3D = \"clamp\" | \"repeat\" | \"mirror\";\r\n\r\n/** How texels are blended when the texture is scaled. */\r\nexport type TextureFilter3D = \"nearest\" | \"linear\";\r\n\r\n/**\r\n * Which colour space the texture's data is in.\r\n *\r\n * `\"srgb\"` for anything representing a *colour* an eye would see (albedo/`map`,\r\n * `emissiveMap`), so the renderer linearizes it before lighting maths.\r\n * `\"linear\"` for *data* maps whose channels are numbers rather than colours\r\n * (`normalMap`, `roughnessMap`, `metalnessMap`, `aoMap`, `displacementMap`) —\r\n * linearizing those would corrupt them. Each map slot defaults correctly, so\r\n * this only needs setting for unusual pipelines.\r\n */\r\nexport type TextureColorSpace3D = \"srgb\" | \"linear\";\r\n\r\n/** Sampler state shared by every texture source. */\r\nexport interface TextureOptions3D {\r\n wrapS?: TextureWrap3D;\r\n wrapT?: TextureWrap3D;\r\n /** UV scale. `[2, 2]` tiles twice on each axis (needs a `repeat` wrap). */\r\n repeat?: Vector2 | readonly [number, number];\r\n offset?: Vector2 | readonly [number, number];\r\n /** UV rotation in **degrees**, about {@link center}. */\r\n rotation?: number;\r\n center?: Vector2 | readonly [number, number];\r\n magFilter?: TextureFilter3D;\r\n minFilter?: TextureFilter3D;\r\n /** Sharpness at grazing angles. Clamped to the GPU's maximum. */\r\n anisotropy?: number;\r\n flipY?: boolean;\r\n colorSpace?: TextureColorSpace3D;\r\n}\r\n\r\n/**\r\n * A texture loaded from the project's asset manifest.\r\n *\r\n * `src` is discovered by the asset-tracking render pass and requested through\r\n * core's ordinary image pipeline — the very same path a 2D image fill uses — so\r\n * the pixels are decoded and resident *before* the frame that needs them draws.\r\n */\r\nexport interface ImageTexture3D extends TextureOptions3D {\r\n src: string;\r\n}\r\n\r\n/**\r\n * A texture built from raw RGBA8888 bytes — the escape hatch for procedurally\r\n * generated pixels (gradient ramps, noise, LUTs, data encoded as colour).\r\n */\r\nexport interface DataTexture3D extends TextureOptions3D {\r\n data: ArrayLike<number>;\r\n width: number;\r\n height: number;\r\n /**\r\n * Bump to force a re-upload after mutating `data` in place. Mutation is\r\n * invisible to identity comparison, so without this the renderer cannot\r\n * tell the bytes changed. See {@link BufferGeometry3D.revision}.\r\n */\r\n revision?: number;\r\n}\r\n\r\n/**\r\n * A texture whose pixels are Motion Script's own 2D output, rasterized offscreen\r\n * — the way to put a chart, a readout or a whole laid-out UI onto 3D geometry.\r\n *\r\n * `source` is a value, not a name and not a mounted node: either a built\r\n * {@link Graphics2D} command list, or a `Node2D` subtree. Both are supplied directly,\r\n * so there is no matching indirection and nothing has to live in a particular\r\n * place in the scene tree.\r\n *\r\n * g3.plane({ map: Tex.surface(scopeGraphics, 1024, 640) })\r\n * g3.plane({ map: Tex.surface(statsSubtree, 1024, 640) })\r\n *\r\n * A `Node2D` source is *adopted for binding* by whatever paints the scene — it gets\r\n * that node's asset catalog, inherited context and clock, which is what makes a\r\n * webfont shape and an `<Image>` load. It is never laid out or painted by the\r\n * scene tree; it is measured against `width`×`height` and drawn into the buffer.\r\n *\r\n * **Hoist the source.** Building it fresh inside the scene builder allocates a new\r\n * subtree every frame — re-binding, re-laying-out, defeating the texture cache and\r\n * leaking. Declare it once and pass the same instance.\r\n *\r\n * That hoisting rule is also what removed this descriptor's old `key`: a hoisted\r\n * source *is* a stable identity, so the renderer keys the GPU texture off the\r\n * source object itself (in a `WeakMap`) rather than off its ordinal in the scene\r\n * walk. A conditionally-emitted surface therefore needs nothing written by hand,\r\n * and a source that goes out of scope becomes collectable instead of orphaning\r\n * its texture — which the ordinal scheme could not do.\r\n */\r\nexport interface SurfaceTexture3D extends TextureOptions3D {\r\n /** A built `Graphics2D`, or a `Node2D` subtree. Typed structurally — see below. */\r\n source: SurfaceSource3D;\r\n /** Buffer width in pixels. This *is* the texture's resolution. */\r\n width: number;\r\n /** Buffer height in pixels. */\r\n height: number;\r\n /**\r\n * Declare the source's pixels unchanging, so the buffer is rasterized once\r\n * and reused rather than redrawn every frame.\r\n *\r\n * Set by `resolveFill3D` for a fill chain, whose layers describe the same\r\n * image on every frame; an author's own source is live by default, which is\r\n * what makes an animated `Graphics2D` or a prop-driven subtree work with no\r\n * bookkeeping. Needs {@link identity} to be cacheable.\r\n *\r\n * @internal\r\n */\r\n static?: boolean;\r\n /**\r\n * Cache identity for a synthesized source.\r\n *\r\n * An author's source is identified by the source object itself (see the note\r\n * above), which is exactly right for something hoisted. A source built *for*\r\n * a fill is a fresh object every frame and has no such identity, so the value\r\n * it was derived from supplies one.\r\n *\r\n * @internal\r\n */\r\n identity?: string;\r\n /**\r\n * Ceiling on the buffer's device-pixel ratio. Default 1, i.e. the buffer is\r\n * exactly `width` × `height`.\r\n *\r\n * Unlike a 2D node — which wants to match the display — a surface is sampled by\r\n * a 3D material at whatever size the geometry occupies on screen, so the honest\r\n * control is `width`/`height`. Raise this only when a surface is viewed close\r\n * up and reads soft.\r\n */\r\n maxPixelRatio?: number;\r\n}\r\n\r\n/**\r\n * What a {@link SurfaceTexture3D} can be painted from: a built {@link Graphics2D}\r\n * command list, or a {@link Node2D} subtree.\r\n *\r\n * Both imports are **type-only**, exactly as `Color` is — `render3d` describes\r\n * scenes as data and never reaches into the render or node layers at runtime, and\r\n * a value import of `Node2D` here would close a real module cycle. Consumers narrow\r\n * with {@link resolveSurfaceSource}.\r\n */\r\nexport type SurfaceSource3D = Graphics2D | Node;\r\n\r\n// Declared against the dimension-agnostic base because that is what a built\r\n// node is typed as, so `Tex.surface(new Rect({ … }), …)` type-checks without a\r\n// cast. It has to be a 2D subtree in fact — the renderer lays it out and draws it\r\n// into a 2D buffer — and `resolveSurfaceSource` narrows to that; handing it a\r\n// `Node3D` fails at render time rather than here.\r\n\r\n/** A {@link SurfaceSource3D} narrowed to the arm its renderer should take. */\r\nexport type ResolvedSurfaceSource =\r\n | { kind: \"graphics\"; graphics: Graphics2D }\r\n | { kind: \"node\"; node: Node2D };\r\n\r\n/**\r\n * Narrow a surface source to the arm that knows how to draw it: a `Graphics2D` is\r\n * replayed into a render context, a `Node2D` is laid out against the buffer and\r\n * rendered.\r\n *\r\n * Structural rather than `instanceof`, because that would need value imports of\r\n * both classes and close the cycle the type-only imports above avoid. `Graphics2D`\r\n * is a command recorder and exposes `ops()`; a `Node2D` has no such method. The\r\n * union makes any *other* value a type error, so this only has to separate two\r\n * known shapes rather than validate an unknown one.\r\n */\r\nexport function resolveSurfaceSource(source: SurfaceSource3D): ResolvedSurfaceSource {\r\n return typeof (source as Graphics2D).ops === \"function\"\r\n ? { kind: \"graphics\", graphics: source as Graphics2D }\r\n : { kind: \"node\", node: source as Node2D };\r\n}\r\n\r\n/**\r\n * A texture reference. A bare string is sugar for `{ src }`, so the common case\r\n * is `map: \"/wood.png\"`.\r\n */\r\nexport type Texture3D = string | ImageTexture3D | DataTexture3D | SurfaceTexture3D;\r\n\r\n/** True for the raw-bytes form (vs. an asset-backed {@link ImageTexture3D}). */\r\nexport function isDataTexture3D(texture: Texture3D): texture is DataTexture3D {\r\n return typeof texture !== \"string\" && \"data\" in texture;\r\n}\r\n\r\n/** True for the {@link SurfaceTexture3D} form — pixels are rasterized from 2D. */\r\nexport function isSurfaceTexture3D(texture: Texture3D): texture is SurfaceTexture3D {\r\n return typeof texture !== \"string\" && \"source\" in texture;\r\n}\r\n\r\n/** Normalize the string shorthand to an {@link ImageTexture3D}. */\r\nexport function resolveTexture3D(texture: Texture3D): ImageTexture3D | DataTexture3D | SurfaceTexture3D {\r\n return typeof texture === \"string\" ? { src: texture } : texture;\r\n}\r\n\r\n/**\r\n * The asset `src` a texture reads from, or `null` when it has none (a data or\r\n * surface texture). Used by the asset-tracking pass to enumerate what a 3D scene\r\n * needs loaded — a `null` here means \"nothing to request\", not \"not a texture\".\r\n */\r\nexport function texture3DSource(texture: Texture3D): string | null {\r\n if (typeof texture === \"string\") return texture;\r\n if (isDataTexture3D(texture) || isSurfaceTexture3D(texture)) return null;\r\n return texture.src;\r\n}\r\n\r\n/**\r\n * True for a string that names an asset rather than a colour.\r\n *\r\n * Leading `/` or `.` is a path by construction; otherwise the extension decides.\r\n * A colour never matches either, and a bare name like `\"wood\"` is a colour —\r\n * which is right, since an asset reference without a path or extension is not\r\n * something the manifest could resolve either.\r\n */\r\nexport function looksLikeAssetPath(value: string): boolean {\r\n return value.startsWith(\"/\")\r\n || value.startsWith(\".\")\r\n || /\\.(png|jpe?g|webp|avif|svg|ktx2?|hdr|exr|mp4|webm|mov)$/i.test(value);\r\n}\r\n"]}
|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CAAC,KAAK,CAAC,CAAC;AAClF,CAAC","sourcesContent":["import type { Vector2 } from \"@/attributes/layout/vector2\";\n// Type-only, like `Color` above: `render3d` is pure data and never reaches into\n// the render or node layers at runtime. See SurfaceSource3D.\nimport type { Graphics2D } from \"@/render/graphics2d\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\n\n/** How sampling behaves outside the 0–1 UV range. */\nexport type TextureWrap3D = \"clamp\" | \"repeat\" | \"mirror\";\n\n/** How texels are blended when the texture is scaled. */\nexport type TextureFilter3D = \"nearest\" | \"linear\";\n\n/**\n * Which colour space the texture's data is in.\n *\n * `\"srgb\"` for anything representing a *colour* an eye would see (albedo/`map`,\n * `emissiveMap`), so the renderer linearizes it before lighting maths.\n * `\"linear\"` for *data* maps whose channels are numbers rather than colours\n * (`normalMap`, `roughnessMap`, `metalnessMap`, `aoMap`, `displacementMap`) —\n * linearizing those would corrupt them. Each map slot defaults correctly, so\n * this only needs setting for unusual pipelines.\n */\nexport type TextureColorSpace3D = \"srgb\" | \"linear\";\n\n/** Sampler state shared by every texture source. */\nexport interface TextureOptions3D {\n wrapS?: TextureWrap3D;\n wrapT?: TextureWrap3D;\n /** UV scale. `[2, 2]` tiles twice on each axis (needs a `repeat` wrap). */\n repeat?: Vector2 | readonly [number, number];\n offset?: Vector2 | readonly [number, number];\n /** UV rotation in **degrees**, about {@link center}. */\n rotation?: number;\n center?: Vector2 | readonly [number, number];\n magFilter?: TextureFilter3D;\n minFilter?: TextureFilter3D;\n /** Sharpness at grazing angles. Clamped to the GPU's maximum. */\n anisotropy?: number;\n flipY?: boolean;\n colorSpace?: TextureColorSpace3D;\n}\n\n/**\n * A texture loaded from the project's asset manifest.\n *\n * `src` is discovered by the asset-tracking render pass and requested through\n * core's ordinary image pipeline — the very same path a 2D image fill uses — so\n * the pixels are decoded and resident *before* the frame that needs them draws.\n */\nexport interface ImageTexture3D extends TextureOptions3D {\n src: string;\n}\n\n/**\n * A texture built from raw RGBA8888 bytes — the escape hatch for procedurally\n * generated pixels (gradient ramps, noise, LUTs, data encoded as colour).\n */\nexport interface DataTexture3D extends TextureOptions3D {\n data: ArrayLike<number>;\n width: number;\n height: number;\n /**\n * Bump to force a re-upload after mutating `data` in place. Mutation is\n * invisible to identity comparison, so without this the renderer cannot\n * tell the bytes changed. See {@link BufferGeometry3D.revision}.\n */\n revision?: number;\n}\n\n/**\n * A texture whose pixels are Motion Script's own 2D output, rasterized offscreen\n * — the way to put a chart, a readout or a whole laid-out UI onto 3D geometry.\n *\n * `source` is a value, not a name and not a mounted node: either a built\n * {@link Graphics2D} command list, or a `Node2D` subtree. Both are supplied directly,\n * so there is no matching indirection and nothing has to live in a particular\n * place in the scene tree.\n *\n * g3.plane({ map: Tex.surface(scopeGraphics, 1024, 640) })\n * g3.plane({ map: Tex.surface(statsSubtree, 1024, 640) })\n *\n * A `Node2D` source is *adopted for binding* by whatever paints the scene — it gets\n * that node's asset catalog, inherited context and clock, which is what makes a\n * webfont shape and an `<Image>` load. It is never laid out or painted by the\n * scene tree; it is measured against `width`×`height` and drawn into the buffer.\n *\n * **Hoist the source.** Building it fresh inside the scene builder allocates a new\n * subtree every frame — re-binding, re-laying-out, defeating the texture cache and\n * leaking. Declare it once and pass the same instance.\n *\n * That hoisting rule is also what removed this descriptor's old `key`: a hoisted\n * source *is* a stable identity, so the renderer keys the GPU texture off the\n * source object itself (in a `WeakMap`) rather than off its ordinal in the scene\n * walk. A conditionally-emitted surface therefore needs nothing written by hand,\n * and a source that goes out of scope becomes collectable instead of orphaning\n * its texture — which the ordinal scheme could not do.\n */\nexport interface SurfaceTexture3D extends TextureOptions3D {\n /** A built `Graphics2D`, or a `Node2D` subtree. Typed structurally — see below. */\n source: SurfaceSource3D;\n /** Buffer width in pixels. This *is* the texture's resolution. */\n width: number;\n /** Buffer height in pixels. */\n height: number;\n /**\n * Declare the source's pixels unchanging, so the buffer is rasterized once\n * and reused rather than redrawn every frame.\n *\n * Set by `resolveFill3D` for a fill chain, whose layers describe the same\n * image on every frame; an author's own source is live by default, which is\n * what makes an animated `Graphics2D` or a prop-driven subtree work with no\n * bookkeeping. Needs {@link identity} to be cacheable.\n *\n * @internal\n */\n static?: boolean;\n /**\n * Cache identity for a synthesized source.\n *\n * An author's source is identified by the source object itself (see the note\n * above), which is exactly right for something hoisted. A source built *for*\n * a fill is a fresh object every frame and has no such identity, so the value\n * it was derived from supplies one.\n *\n * @internal\n */\n identity?: string;\n /**\n * Ceiling on the buffer's device-pixel ratio. Default 1, i.e. the buffer is\n * exactly `width` × `height`.\n *\n * Unlike a 2D node — which wants to match the display — a surface is sampled by\n * a 3D material at whatever size the geometry occupies on screen, so the honest\n * control is `width`/`height`. Raise this only when a surface is viewed close\n * up and reads soft.\n */\n maxPixelRatio?: number;\n}\n\n/**\n * What a {@link SurfaceTexture3D} can be painted from: a built {@link Graphics2D}\n * command list, or a {@link Node2D} subtree.\n *\n * Both imports are **type-only**, exactly as `Color` is — `render3d` describes\n * scenes as data and never reaches into the render or node layers at runtime, and\n * a value import of `Node2D` here would close a real module cycle. Consumers narrow\n * with {@link resolveSurfaceSource}.\n */\nexport type SurfaceSource3D = Graphics2D | Node;\n\n// Declared against the dimension-agnostic base because that is what a built\n// node is typed as, so `Tex.surface(new Rect({ … }), …)` type-checks without a\n// cast. It has to be a 2D subtree in fact — the renderer lays it out and draws it\n// into a 2D buffer — and `resolveSurfaceSource` narrows to that; handing it a\n// `Node3D` fails at render time rather than here.\n\n/** A {@link SurfaceSource3D} narrowed to the arm its renderer should take. */\nexport type ResolvedSurfaceSource =\n | { kind: \"graphics\"; graphics: Graphics2D }\n | { kind: \"node\"; node: Node2D };\n\n/**\n * Narrow a surface source to the arm that knows how to draw it: a `Graphics2D` is\n * replayed into a render context, a `Node2D` is laid out against the buffer and\n * rendered.\n *\n * Structural rather than `instanceof`, because that would need value imports of\n * both classes and close the cycle the type-only imports above avoid. `Graphics2D`\n * is a command recorder and exposes `ops()`; a `Node2D` has no such method. The\n * union makes any *other* value a type error, so this only has to separate two\n * known shapes rather than validate an unknown one.\n */\nexport function resolveSurfaceSource(source: SurfaceSource3D): ResolvedSurfaceSource {\n return typeof (source as Graphics2D).ops === \"function\"\n ? { kind: \"graphics\", graphics: source as Graphics2D }\n : { kind: \"node\", node: source as Node2D };\n}\n\n/**\n * A texture reference. A bare string is sugar for `{ src }`, so the common case\n * is `map: \"/wood.png\"`.\n */\nexport type Texture3D = string | ImageTexture3D | DataTexture3D | SurfaceTexture3D;\n\n/** True for the raw-bytes form (vs. an asset-backed {@link ImageTexture3D}). */\nexport function isDataTexture3D(texture: Texture3D): texture is DataTexture3D {\n return typeof texture !== \"string\" && \"data\" in texture;\n}\n\n/** True for the {@link SurfaceTexture3D} form — pixels are rasterized from 2D. */\nexport function isSurfaceTexture3D(texture: Texture3D): texture is SurfaceTexture3D {\n return typeof texture !== \"string\" && \"source\" in texture;\n}\n\n/** Normalize the string shorthand to an {@link ImageTexture3D}. */\nexport function resolveTexture3D(texture: Texture3D): ImageTexture3D | DataTexture3D | SurfaceTexture3D {\n return typeof texture === \"string\" ? { src: texture } : texture;\n}\n\n/**\n * The asset `src` a texture reads from, or `null` when it has none (a data or\n * surface texture). Used by the asset-tracking pass to enumerate what a 3D scene\n * needs loaded — a `null` here means \"nothing to request\", not \"not a texture\".\n */\nexport function texture3DSource(texture: Texture3D): string | null {\n if (typeof texture === \"string\") return texture;\n if (isDataTexture3D(texture) || isSurfaceTexture3D(texture)) return null;\n return texture.src;\n}\n\n/**\n * True for a string that names an asset rather than a colour.\n *\n * Leading `/` or `.` is a path by construction; otherwise the extension decides.\n * A colour never matches either, and a bare name like `\"wood\"` is a colour —\n * which is right, since an asset reference without a path or extension is not\n * something the manifest could resolve either.\n */\nexport function looksLikeAssetPath(value: string): boolean {\n return value.startsWith(\"/\")\n || value.startsWith(\".\")\n || /\\.(png|jpe?g|webp|avif|svg|ktx2?|hdr|exr|mp4|webm|mov)$/i.test(value);\n}\n"]}
|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,CAAC,GAAW;IACxB,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Asset discovery for 3D scenes.\n *\n * Walks a {@link Graphics3D}'s or {@link Scene3D}'s descriptors for the resources it references and\n * declares them into an {@link AssetScope}, so the ordinary asset timeline →\n * `AssetManager.loadAt` chain has them decoded and resident *before* the frame\n * that needs them renders. That is what lets the 3D draw stay synchronous.\n *\n * This runs off the very same descriptors the real render consumes — the node\n * builds its `Graphics3D` through one method that both paths call — so what gets\n * loaded cannot drift from what gets drawn.\n */\n\nimport type { AssetScope } from \"@/assets/scope\";\nimport type { LoaderFn } from \"@/assets/record\";\nimport type { Graphics3D } from \"./graphics3d\";\nimport { Scene3D } from \"./scene3d\";\nimport type { Geometry3D } from \"./geometry\";\nimport type { EnvironmentData3D } from \"./scene-settings\";\nimport { isSurfaceTexture3D, resolveSurfaceSource, texture3DSource } from \"./texture\";\nimport {\n canvas3DResourceKey, canvas3DResourceLoader,\n type Canvas3DResourceKind, type Canvas3DResourceLoader,\n} from \"./resources\";\nimport { forEachTexture3D } from \"./walk\";\n\n/**\n * Declare every asset a 3D scene or drawable list needs: textures as images, models\n * and environment panoramas through the backend's loader, and each `Tex.surface`\n * node source as a subtree of the declaring node.\n *\n * A `Graphics2D` surface source declares nothing.\n */\nexport function declare3DResources(g3: Graphics3D | Scene3D, assets: AssetScope): void {\n forEachTexture3D(g3, (value) => {\n if (isSurfaceTexture3D(value)) {\n const source = resolveSurfaceSource(value.source);\n if (source.kind === \"node\") assets.subtree(source.node);\n return;\n }\n const src = texture3DSource(value);\n if (src !== null) assets.image(src);\n });\n\n const geometry = (value: Geometry3D | undefined): void => {\n if (value === undefined) return;\n if (value.type === \"modelGeometry\") {\n declareLoader(\"gltf\", value.src, assets);\n } else if (value.type === \"edges\" || value.type === \"wireframe\") {\n geometry(value.source);\n }\n };\n\n for (const op of g3.ops()) {\n switch (op.kind) {\n case \"mesh\":\n case \"points\":\n case \"line\":\n case \"instances\":\n geometry(op.geometry);\n break;\n case \"model\":\n declareLoader(\"gltf\", op.src, assets);\n break;\n }\n }\n\n if (g3 instanceof Scene3D) declareEnvironment(g3.environmentDescriptor(), assets);\n}\n\n/** An environment's panoramas. A `preset` is generated and needs nothing. */\nexport function declareEnvironment(\n environment: Pick<EnvironmentData3D, \"src\" | \"faces\"> | null,\n assets: AssetScope,\n): void {\n if (environment === null) return;\n if (environment.src !== undefined) declareLoader(hdrKind(environment.src), environment.src, assets);\n for (const face of environment.faces ?? []) declareLoader(hdrKind(face), face, assets);\n}\n\n// Stable per backend loader and key, so declaring a resource again hands the scope\n// the same function rather than tripping its conflicting-loader check.\nconst resourceLoads = new WeakMap<Canvas3DResourceLoader, Map<string, LoaderFn>>();\n\nfunction declareLoader(kind: Canvas3DResourceKind, src: string, assets: AssetScope): void {\n const load = canvas3DResourceLoader();\n if (!load) return;\n const key = canvas3DResourceKey(kind, src);\n let byKey = resourceLoads.get(load);\n if (!byKey) resourceLoads.set(load, (byKey = new Map()));\n let fn = byKey.get(key);\n if (!fn) byKey.set(key, (fn = () => load(kind, src)));\n assets.loader(key, fn);\n}\n\nfunction hdrKind(src: string): Canvas3DResourceKind {\n const lower = src.toLowerCase();\n if (lower.endsWith(\".exr\")) return \"exr\";\n return \"hdr\";\n}\n"]}
|