@motionscript/core 0.1.0-alpha.8 → 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 +6 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -49
- 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.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.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/effects/index.js.map +1 -1
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/effects/union.js.map +1 -1
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/layout/size.js.map +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.js.map +1 -1
- package/dist/attributes/render3d/orbit.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- 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.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.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.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.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- 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.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.js.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.js.map +1 -1
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- 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-GKM6UZJR.js → chunk-7DB6BI27.js} +2 -2
- package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
- package/dist/browser/chunks/{chunk-AOT33LMS.js → chunk-IX53IFBD.js} +2 -2
- 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 +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.js.map +1 -1
- 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.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.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.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.js.map +1 -1
- 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.d.ts +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.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.js.map +1 -1
- package/dist/components/trees/audio/index.js.map +1 -1
- 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.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.js.map +1 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts.map +1 -1
- 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.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.js.map +1 -1
- package/dist/render/canvas-render-context2d.js.map +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.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.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.js.map +1 -1
- package/dist/render/render-issue.js.map +1 -1
- 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.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.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- 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.js.map +1 -1
- package/dist/runtime/clip-store.js.map +1 -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.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.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.js.map +1 -1
- package/dist/sdk/index.js.map +1 -1
- 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.js.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/ease/type.js.map +1 -1
- 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 +1 -1
- 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 +0 -11
- 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 +0 -6
- 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 +0 -10
- 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 +0 -10
- 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 +0 -10
- 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-AOT33LMS.js.map +0 -7
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
- package/dist/browser/chunks/chunk-LKUYVFU3.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":"index.js","sourceRoot":"","sources":["../../src/render3d/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EA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,gBAAgB,EAAE,YAAY,GAC3E,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAU/E,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAS7E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAazH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMpD,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5E,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/**\n * 3D scene description.\n *\n * The same split as 2D, one dimension over: a {@link Graphics3D} is what a single\n * node draws (the `Graphics2D` of 3D), a {@link RenderContext3D} is what it draws\n * *into*, and a {@link Scene3D} is the recorded result — camera, lights, fog and\n * every drawable — that a backend replays.\n *\n * Unlike `@/render` (whose descriptors are `@internal`, since nodes build them on\n * the author's behalf), the vocabulary here is **public**: a `Node3D` takes these\n * descriptors as props, and a hand-built `Scene3D` is the escape hatch for\n * painting 3D through an arbitrary 2D path.\n *\n * Nothing in this directory imports a renderer, and no field holds a DOM handle —\n * so `three` never enters core.\n */\n\nexport { Graphics3D } from \"./graphics3d\";\nexport type {\n Graphics3DOp, LineMode3D, LineStroke3D, ModelAnimation3D,\n MaterialShorthand3D, MeshShorthand3D,\n} from \"./graphics3d\";\n/** @internal */ export { DRAWABLE_KINDS, resolveMaterialShorthand3D } from \"./graphics3d\";\n\nexport { Scene3D } from \"./scene3d\";\nexport type { Scene3DOp } from \"./scene3d\";\n\nexport { RenderContext3D } from \"./render-context3d\";\nexport type { Node3DRenderState } from \"./render-context3d\";\n\nexport { Geo, Mat, Tex } from \"./builders\";\n\nexport { resolveFill3D, looksLikeAssetPath } from \"./fill3d\";\nexport type { Fill3D, Fill3DOptions, ResolvedFill3D } from \"./fill3d\";\n\nexport { segmentsOf } from \"./segments\";\nexport type { Segments3D } from \"./segments\";\n\nexport { evaluateRoundedBox } from \"./rounded-box\";\nexport type { RoundedBoxOptions } from \"./rounded-box\";\n\nexport {\n lerpVector3, lerpEuler3, slerpQuaternion, normalizeQuaternion,\n quaternionFromEuler, resolveVector3, IDENTITY_QUATERNION,\n vector3Ops, euler3Ops, quaternionOps,\n} from \"./vector3\";\nexport type { Vector3, Vector3Input, Euler3, EulerOrder, Quaternion } from \"./vector3\";\n\nexport { shadowCasts, shadowReceives, resolveShadowOptions3D } from \"./transform\";\nexport type { Transform3D, Shadow3D, ShadowOptions3D, Faces3D, Blend3D } from \"./transform\";\n\nexport { geometryBounds3D } from \"./bounds3d\";\nexport type { Box3 } from \"./bounds3d\";\n/** @internal */ export { centeredBox3, corners3, transformBox3, unionBox3 } from \"./bounds3d\";\n\n/** @internal */ export {\n applyMatrix4, compose4, identity4, invert4, lookAtRotation4, multiply4,\n orthographic4, perspective4, rotationOf4, transformMatrix4, translation4,\n} from \"./matrix4\";\n/** @internal */ export type { Matrix4, Vector4 } from \"./matrix4\";\n\nexport { evaluateParametric, cylinderRadii, resolveBevel3D } from \"./geometry\";\nexport type {\n Geometry3D, Passthrough3D, Sweep3D, Bevel3D,\n BoxGeometry3D, SphereGeometry3D, PlaneGeometry3D, CylinderGeometry3D,\n ConeGeometry3D, TorusGeometry3D, TorusKnotGeometry3D, CircleGeometry3D,\n RingGeometry3D, CapsuleGeometry3D, PolyhedronGeometry3D, ExtrudeGeometry3D,\n LatheGeometry3D, TubeGeometry3D, BufferGeometry3D, ParametricGeometry3D,\n ParametricVertex3D, EdgesGeometry3D, WireframeGeometry3D, ModelGeometry3D,\n} from \"./geometry\";\n\nexport { MUTABLE_MATERIAL_KEYS, STRUCTURAL_MATERIAL_KEYS } from \"./material\";\nexport type {\n Material3D, MaterialCommon3D, Uniform3D, Shading3D,\n BasicMaterial3D, StandardMaterial3D, PhysicalMaterial3D, PhongMaterial3D,\n LambertMaterial3D, ToonMaterial3D, NormalMaterial3D, DepthMaterial3D,\n MatcapMaterial3D, PointsMaterial3D, LineBasicMaterial3D, LineDashedMaterial3D,\n SpriteMaterial3D, ShadowMaterial3D, ShaderMaterial3D,\n} from \"./material\";\n\nexport { isDataTexture3D, isSurfaceTexture3D, resolveTexture3D, resolveSurfaceSource, texture3DSource } from \"./texture\";\nexport type {\n Texture3D, ImageTexture3D, DataTexture3D, SurfaceTexture3D, TextureOptions3D,\n SurfaceSource3D, ResolvedSurfaceSource,\n TextureWrap3D, TextureFilter3D, TextureColorSpace3D,\n} from \"./texture\";\n\nexport type {\n LightData3D,\n AmbientLightData3D, HemisphereLightData3D, DirectionalLightData3D,\n PointLightData3D, SpotLightData3D, AreaLightData3D,\n} from \"./light\";\n\nexport { isOrbitCamera3D, resolveCameraPlacement } from \"./camera\";\nexport type {\n CameraData3D, CameraCommon3D, PerspectiveCameraData3D, OrthographicCameraData3D,\n} from \"./camera\";\n\nexport { resolveShadows3D } from \"./scene-settings\";\nexport type {\n FogData3D, EnvironmentData3D, ShadowSettings3D, Shadows3D,\n ToneSettings3D, ToneMapping3D, PostEffect3D,\n} from \"./scene-settings\";\n\n/** @internal */ export { forEachTexture3D, isTextureLike, TEXTURE_KEYS } from \"./walk\";\n\nexport { registerCanvas3DWarmup, registerCanvas3DResourceLoader } from \"./resources\";\nexport { canvas3DResourceKey, parseCanvas3DResourceKey } from \"./resources\";\nexport type { Canvas3DWarmup, Canvas3DResourceLoader, Canvas3DResourceKind } from \"./resources\";\n/** @internal */ export { warmCanvas3D, canvas3DResourceLoader, hasCanvas3DBackend } from \"./resources\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AACjC,IAAI,WAAgC,CAAC;AAErC,gEAAgE;AAChE,SAAS,aAAa;IAClB,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,OAAe;IACpD,IAAI,CAAC,aAAa,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAChD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,oBAAoB;IAChC,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAgB;IAC9C,IAAI,CAAC,aAAa,EAAE;QAAE,OAAO;IAE7B,IAAI,UAAU,IAAI,EAAE,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClC,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,WAAW,CACP,mBAAmB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EACrC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,IAAI,mHAAmH;kBACrJ,gGAAgG,CACrG,CAAC;QACN,CAAC;IACL,CAAC;IAED,IAAI,UAAU,IAAI,EAAE,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC3E,KAAK,MAAM,QAAQ,IAAI,SAAkC,EAAE,CAAC;YACxD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;gBACzD,WAAW,CACP,gBAAgB,EAChB,eAAe,QAAQ,CAAC,OAAO,uIAAuI;sBACpK,4CAA4C,CACjD,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,EAAE,CAAC,IAAI,KAAK,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,WAAW,CACP,WAAW,EACX,cAAc,EAAE,CAAC,GAAG,4FAA4F,CACnH,CAAC;IACN,CAAC;AACL,CAAC","sourcesContent":["import type { Graphics3DOp } from \"./graphics3d\";\
|
|
1
|
+
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AACjC,IAAI,WAAgC,CAAC;AAErC,gEAAgE;AAChE,SAAS,aAAa;IAClB,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,OAAe;IACpD,IAAI,CAAC,aAAa,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAChD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAA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E,CAAC,GAAG,4FAA4F,CACnH,CAAC;IACN,CAAC;AACL,CAAC","sourcesContent":["import type { Graphics3DOp } from \"./graphics3d\";\nimport type { Material3D } from \"./material\";\n\n/**\n * Development warnings for 3D inputs that are accepted, typed and recorded, and\n * that no renderer acts on.\n *\n * A few corners of the 3D vocabulary are declared ahead of the backend: the post\n * chain, HDR/EXR/cubemap environments, `params` on a geometry or an environment,\n * `extends` on a shader material and OBJ models. Each is stored faithfully and\n * read by nothing, so a scene that uses one renders exactly like a scene without\n * it — and with no error, which is the part that costs an afternoon. These say so\n * once, in development, naming the input and what to do instead.\n *\n * Each message is printed once per session. Nothing here changes what is\n * recorded, so none of it can move a frame.\n */\n\nconst warned = new Set<string>();\nlet development: boolean | undefined;\n\n/** Read once: in Node, `process.env` is a lookup per access. */\nfunction isDevelopment(): boolean {\n return (development ??= process.env.NODE_ENV !== \"production\");\n}\n\n/**\n * Print `message` once per `key`, in development only.\n * @internal\n */\nexport function warnInert3D(key: string, message: string): void {\n if (!isDevelopment() || warned.has(key)) return;\n warned.add(key);\n console.warn(`[motionscript] ${message}`);\n}\n\n/** Forget what has been warned, so a test can see the same warning again. @internal */\nexport function resetInertWarnings3D(): void {\n warned.clear();\n}\n\n/**\n * Check one recorded drawable for inputs the renderer ignores.\n * @internal\n */\nexport function inspectDrawable3D(op: Graphics3DOp): void {\n if (!isDevelopment()) return;\n\n if (\"geometry\" in op) {\n const params = op.geometry.params;\n if (params && Object.keys(params).length > 0) {\n warnInert3D(\n `geometry-params:${op.geometry.type}`,\n `\\`params\\` on a \"${op.geometry.type}\" geometry is not applied: three builds a geometry from its named fields and nothing assigns \\`params\\` onto it. `\n + \"Set the geometry's own fields instead. (`params` is applied on materials, lights and cameras.)\",\n );\n }\n }\n\n if (\"material\" in op) {\n const materials = Array.isArray(op.material) ? op.material : [op.material];\n for (const material of materials as readonly Material3D[]) {\n if (material.type === \"shader\" && material.extends != null) {\n warnInert3D(\n \"shader-extends\",\n `\\`extends: \"${material.extends}\"\\` on a shader material is not applied: the shader replaces the built-in model, so scene lighting, shadows and fog do not reach it. `\n + \"Write the lighting you need in the shader.\",\n );\n }\n }\n }\n\n if (op.kind === \"model\" && /\\.obj(?:$|[?#])/i.test(op.src)) {\n warnInert3D(\n \"model-obj\",\n `The model \"${op.src}\" is an OBJ file, and only glTF/GLB models load: it will draw nothing. Convert it to .glb.`,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light.js","sourceRoot":"","sources":["../../src/render3d/light.ts"],"names":[],"mappings":"","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\
|
|
1
|
+
{"version":3,"file":"light.js","sourceRoot":"","sources":["../../src/render3d/light.ts"],"names":[],"mappings":"","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type { Passthrough3D } from \"./geometry\";\nimport type { Shadow3D } from \"./transform\";\nimport type { Vector3Input } from \"./vector3\";\n\n/**\n * Every light shares its colour, its strength, and what it does about shadows.\n *\n * `shadow` is the same {@link Shadow3D} an object carries — see that type for why\n * one name covers both, and for the two knobs its object form exposes in place of\n * three's seven.\n */\ninterface LightCommon3D extends Passthrough3D {\n color?: Color;\n intensity?: number;\n}\n\n/** Uniform light from every direction. Cheap fill; casts no shadows. */\nexport interface AmbientLightData3D extends LightCommon3D {\n type: \"ambient\";\n}\n\n/**\n * Two-tone ambient — one colour from above, another from below. A cheap and\n * surprisingly effective stand-in for a sky/ground environment.\n */\nexport interface HemisphereLightData3D extends Passthrough3D {\n type: \"hemisphere\";\n /** Colour from above. */\n sky?: Color;\n /** Colour from below. */\n ground?: Color;\n intensity?: number;\n}\n\n/**\n * Parallel rays from an infinitely distant source — sunlight. Only the light's\n * *direction* matters, which is the vector from its `position` to {@link target}.\n */\nexport interface DirectionalLightData3D extends LightCommon3D {\n type: \"directional\";\n /** World-space point the light aims at. Default origin. */\n target?: Vector3Input;\n shadow?: Shadow3D;\n}\n\n/**\n * Light radiating from a point in every direction — a bare bulb.\n *\n * `intensity` is on the same scale as a directional light's: 1 is a normal light,\n * not one candela. three measures point and spot lights in candela and\n * directional lights in lux, which is physically correct and means the same\n * number produces wildly different results on the two — a scene ends up written\n * with `intensity={2.4}` on one light beside `intensity={40}` on another. The\n * renderer applies the steradian conversion so the numbers are comparable.\n */\nexport interface PointLightData3D extends LightCommon3D {\n type: \"point\";\n /** Cutoff range. 0 (default) means no cutoff. */\n distance?: number;\n /** Falloff exponent. 2 is physically correct. */\n decay?: number;\n shadow?: Shadow3D;\n}\n\n/** A cone of light — a lamp, a torch, a stage spot. */\nexport interface SpotLightData3D extends LightCommon3D {\n type: \"spot\";\n target?: Vector3Input;\n /** Cone half-angle in **degrees**. */\n angle?: number;\n /** 0 hard edge → 1 fully feathered. */\n penumbra?: number;\n distance?: number;\n decay?: number;\n shadow?: Shadow3D;\n}\n\n/**\n * A glowing rectangle — softboxes, strip lights, windows. Physically the nicest\n * soft light, but it only works with `standard`/`physical` materials and casts no\n * shadows.\n *\n * Named for what it is rather than for the three class behind it: \"rectArea\" put\n * a renderer's internal name in the authoring surface, and `Rect` already means\n * something else here.\n */\nexport interface AreaLightData3D extends LightCommon3D {\n type: \"area\";\n width?: number;\n height?: number;\n}\n\n/** Every light a scene can contain. Discriminated on `type`. */\nexport type LightData3D =\n | AmbientLightData3D\n | HemisphereLightData3D\n | DirectionalLightData3D\n | PointLightData3D\n | SpotLightData3D\n | AreaLightData3D;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../src/render3d/material.ts"],"names":[],"mappings":"AAiVA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB;IAC7D,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc;IACjE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK;IACrE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB;IACxE,mBAAmB,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB;IACxE,kBAAkB,EAAE,qBAAqB;IACzC,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB;IACxD,aAAa,EAAE,mBAAmB,EAAE,kBAAkB;IACtD,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU;IAC3D,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB;CACzE,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACvD,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO;IACzD,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW;IACpD,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;CAC/C,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { Vector3 } from \"./vector3\";\r\nimport type { Passthrough3D } from \"./geometry\";\r\nimport type { Blend3D, Faces3D } from \"./transform\";\r\nimport type { Texture3D } from \"./texture\";\r\n\r\n/** Facet or smooth shading. `\"flat\"` gives one normal per triangle. */\r\nexport type Shading3D = \"smooth\" | \"flat\";\r\n\r\n/**\r\n * State every material shares, regardless of shading model.\r\n *\r\n * A note on cost, because it is not obvious: the fields in the first block are\r\n * plain uniform writes the renderer can mutate in place every frame, so they are\r\n * free to animate. The fields marked **structural** change the compiled shader\r\n * program, so changing one mid-timeline forces a recompile — set them once and\r\n * leave them alone rather than tweening them.\r\n */\r\nexport interface MaterialCommon3D extends Passthrough3D {\r\n /** 0–1. Free to animate; blending is turned on for you below 1. */\r\n opacity?: number;\r\n /** Hide without removing. Free to animate. */\r\n visible?: boolean;\r\n\r\n /**\r\n * **Structural, and normally derived rather than written.**\r\n *\r\n * The renderer turns alpha blending on whenever anything about the material\r\n * actually needs it — `opacity` below 1, a colour carrying alpha, an\r\n * `alphaMap`, or transmission — so an author never has to pair a fade with a\r\n * second flag, and `opacity: 0.5` can no longer silently do nothing (which is\r\n * exactly what it did when this defaulted to `false`).\r\n *\r\n * Set it explicitly only to *force* blending on a fully opaque material, which\r\n * is occasionally wanted for draw-order reasons. Setting it `false` does not\r\n * turn off blending a lower alpha requires; there is no useful meaning for\r\n * that, and it only ever expressed a bug.\r\n */\r\n transparent?: boolean;\r\n /** **Structural.** Discard fragments below this alpha. Cheap cutout transparency. */\r\n alphaTest?: number;\r\n /** **Structural.** Which faces to rasterize. Default `\"front\"`. */\r\n faces?: Faces3D;\r\n /** **Structural.** Draw edges only. */\r\n wireframe?: boolean;\r\n /** **Structural.** How the colour combines with the framebuffer. */\r\n blend?: Blend3D;\r\n /** **Structural.** Read per-vertex colours from the geometry's `color` buffer. */\r\n vertexColors?: boolean;\r\n /** **Structural.** Apply the scene's tone mapping. Default true. */\r\n toneMapped?: boolean;\r\n\r\n /**\r\n * Write to the depth buffer.\r\n *\r\n * **Derived unless stated**: a blended surface stops writing depth, and an\r\n * opaque one writes it. three defaults this to `true` for everything, so a\r\n * translucent mesh occluded whatever was drawn after it — a surface at 5%\r\n * opacity rendering as a near-invisible cut-out through the things behind\r\n * it. Set it explicitly for a translucent surface that genuinely should\r\n * occlude.\r\n */\r\n depthWrite?: boolean;\r\n /** Test against the depth buffer. Turn off to force draw-on-top. */\r\n depthTest?: boolean;\r\n /** Nudge depth to break z-fighting between coplanar surfaces. */\r\n polygonOffset?: boolean;\r\n polygonOffsetFactor?: number;\r\n polygonOffsetUnits?: number;\r\n /** Smooth gradient banding. */\r\n dithering?: boolean;\r\n}\r\n\r\n/** Maps shared by the lit shading models. */\r\ninterface CommonMaps3D {\r\n /** Base colour (albedo). Sampled as sRGB. */\r\n map?: Texture3D;\r\n /** Per-pixel opacity, read from the red channel. */\r\n alphaMap?: Texture3D;\r\n /** Ambient occlusion, read from the red channel. Needs a second UV set. */\r\n aoMap?: Texture3D;\r\n aoMapIntensity?: number;\r\n /** Tangent-space normals. Sampled as linear data, not colour. */\r\n normalMap?: Texture3D;\r\n /** Normal strength, per axis. A number applies to both. */\r\n normalScale?: number | Vector2;\r\n /** Displaces vertices along their normals. Needs a subdivided geometry. */\r\n displacementMap?: Texture3D;\r\n displacementScale?: number;\r\n displacementBias?: number;\r\n /** Reflected environment. Usually inherited from the scene's environment. */\r\n envMap?: Texture3D;\r\n /** Multiplies light received from the environment. */\r\n envMapIntensity?: number;\r\n /** Baked light added on top, unaffected by scene lights. */\r\n lightMap?: Texture3D;\r\n lightMapIntensity?: number;\r\n}\r\n\r\n/** Emission shared by the lit shading models. */\r\ninterface Emissive3D {\r\n /** Self-illumination colour. Does not light other objects (see `post` bloom). */\r\n emission?: Color;\r\n emissionStrength?: number;\r\n emissionMap?: Texture3D;\r\n}\r\n\r\n/** Unlit — a flat colour, ignoring every light. The cheapest material. */\r\nexport interface BasicMaterial3D extends MaterialCommon3D, CommonMaps3D {\r\n type: \"basic\";\r\n color?: Color;\r\n}\r\n\r\n/**\r\n * Physically based metal/rough shading. The sensible default for most surfaces:\r\n * `roughness` and `metalness` cover the majority of real materials, and both are\r\n * free to animate.\r\n */\r\nexport interface StandardMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\r\n type: \"standard\";\r\n color?: Color;\r\n /** 0 mirror-smooth → 1 fully diffuse. */\r\n roughness?: number;\r\n /** 0 dielectric → 1 metal. Metals tint their reflections by `color`. */\r\n metalness?: number;\r\n roughnessMap?: Texture3D;\r\n metalnessMap?: Texture3D;\r\n /** **Structural.** Facet or smooth shading. Default `\"smooth\"`. */\r\n shading?: Shading3D;\r\n}\r\n\r\n/**\r\n * Everything {@link StandardMaterial3D} has plus the expensive extras: clearcoat,\r\n * transmission (real refraction), sheen and iridescence. Costs more per pixel, so\r\n * reach for `standard` unless a surface needs these.\r\n */\r\nexport interface PhysicalMaterial3D extends Omit<StandardMaterial3D, \"type\"> {\r\n type: \"physical\";\r\n /** A second specular lobe over the base — car paint, lacquer, varnish. */\r\n clearcoat?: number;\r\n clearcoatRoughness?: number;\r\n clearcoatMap?: Texture3D;\r\n clearcoatNormalMap?: Texture3D;\r\n clearcoatRoughnessMap?: Texture3D;\r\n /** Light transmitted *through* the surface — glass, water. Blends for you. */\r\n transmission?: number;\r\n transmissionMap?: Texture3D;\r\n /** Wall thickness for transmission tinting. */\r\n thickness?: number;\r\n thicknessMap?: Texture3D;\r\n /** Volumetric absorption colour at {@link attenuationDistance}. */\r\n attenuationColor?: Color;\r\n attenuationDistance?: number;\r\n /** Index of refraction. 1.5 glass, 1.33 water, 2.42 diamond. */\r\n ior?: number;\r\n /** Retroreflective sheen — cloth, velvet, dust. */\r\n sheen?: number;\r\n sheenColor?: Color;\r\n sheenRoughness?: number;\r\n /** Thin-film interference — soap bubbles, oil slicks, beetle shells. */\r\n iridescence?: number;\r\n iridescenceIOR?: number;\r\n iridescenceThicknessRange?: readonly [number, number];\r\n /** Strength/tint of the dielectric specular highlight. */\r\n specularIntensity?: number;\r\n specularColor?: Color;\r\n /** Anisotropic (brushed-metal) highlight stretching. */\r\n anisotropy?: number;\r\n /** Degrees. */\r\n anisotropyRotation?: number;\r\n}\r\n\r\n/** Classic Blinn-Phong: a diffuse term plus a tight specular highlight. */\r\nexport interface PhongMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\r\n type: \"phong\";\r\n color?: Color;\r\n specular?: Color;\r\n /** Highlight tightness. Higher is smaller and sharper. */\r\n shininess?: number;\r\n specularMap?: Texture3D;\r\n /** **Structural.** */\r\n shading?: Shading3D;\r\n}\r\n\r\n/** Diffuse-only Lambertian shading. Cheap; good for matte and unlit-ish looks. */\r\nexport interface LambertMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\r\n type: \"lambert\";\r\n color?: Color;\r\n /** **Structural.** */\r\n shading?: Shading3D;\r\n}\r\n\r\n/** Banded cel shading. `gradientMap` controls the steps. */\r\nexport interface ToonMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\r\n type: \"toon\";\r\n color?: Color;\r\n gradientMap?: Texture3D;\r\n}\r\n\r\n/** Surface normals as RGB. A debugging workhorse. */\r\nexport interface NormalMaterial3D extends MaterialCommon3D {\r\n type: \"normal\";\r\n /** **Structural.** */\r\n shading?: Shading3D;\r\n}\r\n\r\n/** Depth as greyscale. For debugging and custom depth passes. */\r\nexport interface DepthMaterial3D extends MaterialCommon3D {\r\n type: \"depth\";\r\n}\r\n\r\n/** Lit by a pre-baked sphere image. Very cheap, very stylizable. */\r\nexport interface MatcapMaterial3D extends MaterialCommon3D {\r\n type: \"matcap\";\r\n color?: Color;\r\n matcap?: Texture3D;\r\n map?: Texture3D;\r\n normalMap?: Texture3D;\r\n normalScale?: number | Vector2;\r\n}\r\n\r\n/** Shading for a `points` cloud. */\r\nexport interface PointsMaterial3D extends MaterialCommon3D {\r\n type: \"points\";\r\n color?: Color;\r\n size?: number;\r\n /** Shrink distant points with perspective. Default true. */\r\n sizeAttenuation?: boolean;\r\n map?: Texture3D;\r\n alphaMap?: Texture3D;\r\n}\r\n\r\n/**\r\n * Shading for a `line`. Note `width` is capped at 1px by most WebGL\r\n * implementations regardless of what you set, and **nothing substitutes a\r\n * mesh-backed line** for a larger one: it is written to `linewidth` and that is\r\n * all. For a genuinely thick line draw a `tube`.\r\n */\r\nexport interface LineBasicMaterial3D extends MaterialCommon3D {\r\n type: \"lineBasic\";\r\n color?: Color;\r\n width?: number;\r\n}\r\n\r\n/** A dashed line. Requires computed line distances, which the renderer handles. */\r\nexport interface LineDashedMaterial3D extends MaterialCommon3D {\r\n type: \"lineDashed\";\r\n color?: Color;\r\n width?: number;\r\n dashSize?: number;\r\n gapSize?: number;\r\n /** Offset along the line — animate for a marching-ants effect. */\r\n scale?: number;\r\n}\r\n\r\n/** Shading for a camera-facing `sprite`. */\r\nexport interface SpriteMaterial3D extends MaterialCommon3D {\r\n type: \"sprite\";\r\n color?: Color;\r\n map?: Texture3D;\r\n /** Degrees. */\r\n rotation?: number;\r\n}\r\n\r\n/** Receives shadows onto an otherwise invisible surface. For AR-style grounding. */\r\nexport interface ShadowMaterial3D extends MaterialCommon3D {\r\n type: \"shadow\";\r\n color?: Color;\r\n}\r\n\r\n/**\r\n * A shader uniform value. Deliberately narrow: everything here is plain,\r\n * inspectable data that can be interpolated, which is what keeps a shader-driven\r\n * scene seekable.\r\n */\r\nexport type Uniform3D =\r\n | number\r\n | boolean\r\n | Color\r\n | Vector2\r\n | Vector3\r\n | { x: number; y: number; z: number; w: number }\r\n | readonly number[]\r\n | Texture3D;\r\n\r\n/**\r\n * Raw GLSL — total control over both stages.\r\n *\r\n * Uniform **values** are cheap: the renderer writes them in place each frame, so\r\n * driving them from tweened props costs nothing. Uniform *names* and the shader\r\n * **source** are structural — changing either recompiles the program.\r\n *\r\n * {@link extends} is declared to patch three's built-in lit shader instead of\r\n * replacing it, but **it is not read yet**: a shader always replaces the model, so\r\n * scene lighting, shadows and fog do not reach it. The first material that sets\r\n * it warns in development. Write the lighting you need in the shader.\r\n */\r\nexport interface ShaderMaterial3D extends MaterialCommon3D {\r\n type: \"shader\";\r\n /** Vertex stage source. */\r\n vertex: string;\r\n /** Fragment stage source. */\r\n fragment: string;\r\n uniforms?: Readonly<Record<string, Uniform3D>>;\r\n /** `#define`s injected ahead of both stages. **Structural.** */\r\n defines?: Readonly<Record<string, string | number | boolean>>;\r\n /**\r\n * Wrap a built-in shading model rather than replacing it, so scene lighting,\r\n * shadows and fog still apply. Null (the default) is a raw shader.\r\n *\r\n * **Not implemented**: no backend reads it, so every shader is a plain\r\n * replacement whatever this says.\r\n */\r\n extends?: \"standard\" | \"basic\" | \"phong\" | null;\r\n /** Skip three's automatic attribute/uniform prelude (a raw shader). */\r\n raw?: boolean;\r\n}\r\n\r\n/** Every material a drawable can be shaded with. Discriminated on `type`. */\r\nexport type Material3D =\r\n | BasicMaterial3D\r\n | StandardMaterial3D\r\n | PhysicalMaterial3D\r\n | PhongMaterial3D\r\n | LambertMaterial3D\r\n | ToonMaterial3D\r\n | NormalMaterial3D\r\n | DepthMaterial3D\r\n | MatcapMaterial3D\r\n | PointsMaterial3D\r\n | LineBasicMaterial3D\r\n | LineDashedMaterial3D\r\n | SpriteMaterial3D\r\n | ShadowMaterial3D\r\n | ShaderMaterial3D;\r\n\r\n/**\r\n * Material fields whose value the renderer can write in place, without\r\n * recompiling. Everything *not* listed here is structural: changing it rebuilds\r\n * the material. Shared by the reconciler and the `MeshShorthand` desugarer so the\r\n * two can't disagree about what is cheap.\r\n */\r\nexport const MUTABLE_MATERIAL_KEYS: readonly string[] = [\r\n \"color\", \"opacity\", \"visible\", \"emission\", \"emissionStrength\",\r\n \"roughness\", \"metalness\", \"shininess\", \"specular\", \"reflectivity\",\r\n \"clearcoat\", \"clearcoatRoughness\", \"transmission\", \"thickness\", \"ior\",\r\n \"sheen\", \"sheenColor\", \"sheenRoughness\", \"iridescence\", \"iridescenceIOR\",\r\n \"specularIntensity\", \"specularColor\", \"anisotropy\", \"anisotropyRotation\",\r\n \"attenuationColor\", \"attenuationDistance\",\r\n \"aoMapIntensity\", \"lightMapIntensity\", \"envMapIntensity\",\r\n \"normalScale\", \"displacementScale\", \"displacementBias\",\r\n \"size\", \"width\", \"dashSize\", \"gapSize\", \"scale\", \"rotation\",\r\n \"depthWrite\", \"depthTest\", \"polygonOffsetFactor\", \"polygonOffsetUnits\",\r\n];\r\n\r\n/**\r\n * Material fields that change the compiled shader program. Changing one forces a\r\n * rebuild, so they must never be tweened — the renderer warns when it sees one\r\n * change repeatedly.\r\n *\r\n * `transparent` is here and is also *derived*, which is only a contradiction\r\n * until you look at when it moves: it flips at most once per material, on the\r\n * first frame a fade leaves full opacity, and the renderer latches it there. See\r\n * `needsBlending` in the material handler.\r\n */\r\nexport const STRUCTURAL_MATERIAL_KEYS: readonly string[] = [\r\n \"transparent\", \"alphaTest\", \"faces\", \"wireframe\", \"blend\",\r\n \"vertexColors\", \"toneMapped\", \"shading\", \"dithering\",\r\n \"polygonOffset\", \"raw\", \"extends\", \"defines\",\r\n];\r\n"]}
|
|
1
|
+
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../src/render3d/material.ts"],"names":[],"mappings":"AAiVA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB;IAC7D,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc;IACjE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK;IACrE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB;IACxE,mBAAmB,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB;IACxE,kBAAkB,EAAE,qBAAqB;IACzC,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB;IACxD,aAAa,EAAE,mBAAmB,EAAE,kBAAkB;IACtD,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU;IAC3D,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB;CACzE,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACvD,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO;IACzD,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW;IACpD,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;CAC/C,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { Vector3 } from \"./vector3\";\nimport type { Passthrough3D } from \"./geometry\";\nimport type { Blend3D, Faces3D } from \"./transform\";\nimport type { Texture3D } from \"./texture\";\n\n/** Facet or smooth shading. `\"flat\"` gives one normal per triangle. */\nexport type Shading3D = \"smooth\" | \"flat\";\n\n/**\n * State every material shares, regardless of shading model.\n *\n * A note on cost, because it is not obvious: the fields in the first block are\n * plain uniform writes the renderer can mutate in place every frame, so they are\n * free to animate. The fields marked **structural** change the compiled shader\n * program, so changing one mid-timeline forces a recompile — set them once and\n * leave them alone rather than tweening them.\n */\nexport interface MaterialCommon3D extends Passthrough3D {\n /** 0–1. Free to animate; blending is turned on for you below 1. */\n opacity?: number;\n /** Hide without removing. Free to animate. */\n visible?: boolean;\n\n /**\n * **Structural, and normally derived rather than written.**\n *\n * The renderer turns alpha blending on whenever anything about the material\n * actually needs it — `opacity` below 1, a colour carrying alpha, an\n * `alphaMap`, or transmission — so an author never has to pair a fade with a\n * second flag, and `opacity: 0.5` can no longer silently do nothing (which is\n * exactly what it did when this defaulted to `false`).\n *\n * Set it explicitly only to *force* blending on a fully opaque material, which\n * is occasionally wanted for draw-order reasons. Setting it `false` does not\n * turn off blending a lower alpha requires; there is no useful meaning for\n * that, and it only ever expressed a bug.\n */\n transparent?: boolean;\n /** **Structural.** Discard fragments below this alpha. Cheap cutout transparency. */\n alphaTest?: number;\n /** **Structural.** Which faces to rasterize. Default `\"front\"`. */\n faces?: Faces3D;\n /** **Structural.** Draw edges only. */\n wireframe?: boolean;\n /** **Structural.** How the colour combines with the framebuffer. */\n blend?: Blend3D;\n /** **Structural.** Read per-vertex colours from the geometry's `color` buffer. */\n vertexColors?: boolean;\n /** **Structural.** Apply the scene's tone mapping. Default true. */\n toneMapped?: boolean;\n\n /**\n * Write to the depth buffer.\n *\n * **Derived unless stated**: a blended surface stops writing depth, and an\n * opaque one writes it. three defaults this to `true` for everything, so a\n * translucent mesh occluded whatever was drawn after it — a surface at 5%\n * opacity rendering as a near-invisible cut-out through the things behind\n * it. Set it explicitly for a translucent surface that genuinely should\n * occlude.\n */\n depthWrite?: boolean;\n /** Test against the depth buffer. Turn off to force draw-on-top. */\n depthTest?: boolean;\n /** Nudge depth to break z-fighting between coplanar surfaces. */\n polygonOffset?: boolean;\n polygonOffsetFactor?: number;\n polygonOffsetUnits?: number;\n /** Smooth gradient banding. */\n dithering?: boolean;\n}\n\n/** Maps shared by the lit shading models. */\ninterface CommonMaps3D {\n /** Base colour (albedo). Sampled as sRGB. */\n map?: Texture3D;\n /** Per-pixel opacity, read from the red channel. */\n alphaMap?: Texture3D;\n /** Ambient occlusion, read from the red channel. Needs a second UV set. */\n aoMap?: Texture3D;\n aoMapIntensity?: number;\n /** Tangent-space normals. Sampled as linear data, not colour. */\n normalMap?: Texture3D;\n /** Normal strength, per axis. A number applies to both. */\n normalScale?: number | Vector2;\n /** Displaces vertices along their normals. Needs a subdivided geometry. */\n displacementMap?: Texture3D;\n displacementScale?: number;\n displacementBias?: number;\n /** Reflected environment. Usually inherited from the scene's environment. */\n envMap?: Texture3D;\n /** Multiplies light received from the environment. */\n envMapIntensity?: number;\n /** Baked light added on top, unaffected by scene lights. */\n lightMap?: Texture3D;\n lightMapIntensity?: number;\n}\n\n/** Emission shared by the lit shading models. */\ninterface Emissive3D {\n /** Self-illumination colour. Does not light other objects (see `post` bloom). */\n emission?: Color;\n emissionStrength?: number;\n emissionMap?: Texture3D;\n}\n\n/** Unlit — a flat colour, ignoring every light. The cheapest material. */\nexport interface BasicMaterial3D extends MaterialCommon3D, CommonMaps3D {\n type: \"basic\";\n color?: Color;\n}\n\n/**\n * Physically based metal/rough shading. The sensible default for most surfaces:\n * `roughness` and `metalness` cover the majority of real materials, and both are\n * free to animate.\n */\nexport interface StandardMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\n type: \"standard\";\n color?: Color;\n /** 0 mirror-smooth → 1 fully diffuse. */\n roughness?: number;\n /** 0 dielectric → 1 metal. Metals tint their reflections by `color`. */\n metalness?: number;\n roughnessMap?: Texture3D;\n metalnessMap?: Texture3D;\n /** **Structural.** Facet or smooth shading. Default `\"smooth\"`. */\n shading?: Shading3D;\n}\n\n/**\n * Everything {@link StandardMaterial3D} has plus the expensive extras: clearcoat,\n * transmission (real refraction), sheen and iridescence. Costs more per pixel, so\n * reach for `standard` unless a surface needs these.\n */\nexport interface PhysicalMaterial3D extends Omit<StandardMaterial3D, \"type\"> {\n type: \"physical\";\n /** A second specular lobe over the base — car paint, lacquer, varnish. */\n clearcoat?: number;\n clearcoatRoughness?: number;\n clearcoatMap?: Texture3D;\n clearcoatNormalMap?: Texture3D;\n clearcoatRoughnessMap?: Texture3D;\n /** Light transmitted *through* the surface — glass, water. Blends for you. */\n transmission?: number;\n transmissionMap?: Texture3D;\n /** Wall thickness for transmission tinting. */\n thickness?: number;\n thicknessMap?: Texture3D;\n /** Volumetric absorption colour at {@link attenuationDistance}. */\n attenuationColor?: Color;\n attenuationDistance?: number;\n /** Index of refraction. 1.5 glass, 1.33 water, 2.42 diamond. */\n ior?: number;\n /** Retroreflective sheen — cloth, velvet, dust. */\n sheen?: number;\n sheenColor?: Color;\n sheenRoughness?: number;\n /** Thin-film interference — soap bubbles, oil slicks, beetle shells. */\n iridescence?: number;\n iridescenceIOR?: number;\n iridescenceThicknessRange?: readonly [number, number];\n /** Strength/tint of the dielectric specular highlight. */\n specularIntensity?: number;\n specularColor?: Color;\n /** Anisotropic (brushed-metal) highlight stretching. */\n anisotropy?: number;\n /** Degrees. */\n anisotropyRotation?: number;\n}\n\n/** Classic Blinn-Phong: a diffuse term plus a tight specular highlight. */\nexport interface PhongMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\n type: \"phong\";\n color?: Color;\n specular?: Color;\n /** Highlight tightness. Higher is smaller and sharper. */\n shininess?: number;\n specularMap?: Texture3D;\n /** **Structural.** */\n shading?: Shading3D;\n}\n\n/** Diffuse-only Lambertian shading. Cheap; good for matte and unlit-ish looks. */\nexport interface LambertMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\n type: \"lambert\";\n color?: Color;\n /** **Structural.** */\n shading?: Shading3D;\n}\n\n/** Banded cel shading. `gradientMap` controls the steps. */\nexport interface ToonMaterial3D extends MaterialCommon3D, CommonMaps3D, Emissive3D {\n type: \"toon\";\n color?: Color;\n gradientMap?: Texture3D;\n}\n\n/** Surface normals as RGB. A debugging workhorse. */\nexport interface NormalMaterial3D extends MaterialCommon3D {\n type: \"normal\";\n /** **Structural.** */\n shading?: Shading3D;\n}\n\n/** Depth as greyscale. For debugging and custom depth passes. */\nexport interface DepthMaterial3D extends MaterialCommon3D {\n type: \"depth\";\n}\n\n/** Lit by a pre-baked sphere image. Very cheap, very stylizable. */\nexport interface MatcapMaterial3D extends MaterialCommon3D {\n type: \"matcap\";\n color?: Color;\n matcap?: Texture3D;\n map?: Texture3D;\n normalMap?: Texture3D;\n normalScale?: number | Vector2;\n}\n\n/** Shading for a `points` cloud. */\nexport interface PointsMaterial3D extends MaterialCommon3D {\n type: \"points\";\n color?: Color;\n size?: number;\n /** Shrink distant points with perspective. Default true. */\n sizeAttenuation?: boolean;\n map?: Texture3D;\n alphaMap?: Texture3D;\n}\n\n/**\n * Shading for a `line`. Note `width` is capped at 1px by most WebGL\n * implementations regardless of what you set, and **nothing substitutes a\n * mesh-backed line** for a larger one: it is written to `linewidth` and that is\n * all. For a genuinely thick line draw a `tube`.\n */\nexport interface LineBasicMaterial3D extends MaterialCommon3D {\n type: \"lineBasic\";\n color?: Color;\n width?: number;\n}\n\n/** A dashed line. Requires computed line distances, which the renderer handles. */\nexport interface LineDashedMaterial3D extends MaterialCommon3D {\n type: \"lineDashed\";\n color?: Color;\n width?: number;\n dashSize?: number;\n gapSize?: number;\n /** Offset along the line — animate for a marching-ants effect. */\n scale?: number;\n}\n\n/** Shading for a camera-facing `sprite`. */\nexport interface SpriteMaterial3D extends MaterialCommon3D {\n type: \"sprite\";\n color?: Color;\n map?: Texture3D;\n /** Degrees. */\n rotation?: number;\n}\n\n/** Receives shadows onto an otherwise invisible surface. For AR-style grounding. */\nexport interface ShadowMaterial3D extends MaterialCommon3D {\n type: \"shadow\";\n color?: Color;\n}\n\n/**\n * A shader uniform value. Deliberately narrow: everything here is plain,\n * inspectable data that can be interpolated, which is what keeps a shader-driven\n * scene seekable.\n */\nexport type Uniform3D =\n | number\n | boolean\n | Color\n | Vector2\n | Vector3\n | { x: number; y: number; z: number; w: number }\n | readonly number[]\n | Texture3D;\n\n/**\n * Raw GLSL — total control over both stages.\n *\n * Uniform **values** are cheap: the renderer writes them in place each frame, so\n * driving them from tweened props costs nothing. Uniform *names* and the shader\n * **source** are structural — changing either recompiles the program.\n *\n * {@link extends} is declared to patch three's built-in lit shader instead of\n * replacing it, but **it is not read yet**: a shader always replaces the model, so\n * scene lighting, shadows and fog do not reach it. The first material that sets\n * it warns in development. Write the lighting you need in the shader.\n */\nexport interface ShaderMaterial3D extends MaterialCommon3D {\n type: \"shader\";\n /** Vertex stage source. */\n vertex: string;\n /** Fragment stage source. */\n fragment: string;\n uniforms?: Readonly<Record<string, Uniform3D>>;\n /** `#define`s injected ahead of both stages. **Structural.** */\n defines?: Readonly<Record<string, string | number | boolean>>;\n /**\n * Wrap a built-in shading model rather than replacing it, so scene lighting,\n * shadows and fog still apply. Null (the default) is a raw shader.\n *\n * **Not implemented**: no backend reads it, so every shader is a plain\n * replacement whatever this says.\n */\n extends?: \"standard\" | \"basic\" | \"phong\" | null;\n /** Skip three's automatic attribute/uniform prelude (a raw shader). */\n raw?: boolean;\n}\n\n/** Every material a drawable can be shaded with. Discriminated on `type`. */\nexport type Material3D =\n | BasicMaterial3D\n | StandardMaterial3D\n | PhysicalMaterial3D\n | PhongMaterial3D\n | LambertMaterial3D\n | ToonMaterial3D\n | NormalMaterial3D\n | DepthMaterial3D\n | MatcapMaterial3D\n | PointsMaterial3D\n | LineBasicMaterial3D\n | LineDashedMaterial3D\n | SpriteMaterial3D\n | ShadowMaterial3D\n | ShaderMaterial3D;\n\n/**\n * Material fields whose value the renderer can write in place, without\n * recompiling. Everything *not* listed here is structural: changing it rebuilds\n * the material. Shared by the reconciler and the `MeshShorthand` desugarer so the\n * two can't disagree about what is cheap.\n */\nexport const MUTABLE_MATERIAL_KEYS: readonly string[] = [\n \"color\", \"opacity\", \"visible\", \"emission\", \"emissionStrength\",\n \"roughness\", \"metalness\", \"shininess\", \"specular\", \"reflectivity\",\n \"clearcoat\", \"clearcoatRoughness\", \"transmission\", \"thickness\", \"ior\",\n \"sheen\", \"sheenColor\", \"sheenRoughness\", \"iridescence\", \"iridescenceIOR\",\n \"specularIntensity\", \"specularColor\", \"anisotropy\", \"anisotropyRotation\",\n \"attenuationColor\", \"attenuationDistance\",\n \"aoMapIntensity\", \"lightMapIntensity\", \"envMapIntensity\",\n \"normalScale\", \"displacementScale\", \"displacementBias\",\n \"size\", \"width\", \"dashSize\", \"gapSize\", \"scale\", \"rotation\",\n \"depthWrite\", \"depthTest\", \"polygonOffsetFactor\", \"polygonOffsetUnits\",\n];\n\n/**\n * Material fields that change the compiled shader program. Changing one forces a\n * rebuild, so they must never be tweened — the renderer warns when it sees one\n * change repeatedly.\n *\n * `transparent` is here and is also *derived*, which is only a contradiction\n * until you look at when it moves: it flips at most once per material, on the\n * first frame a fade leaves full opacity, and the renderer latches it there. See\n * `needsBlending` in the material handler.\n */\nexport const STRUCTURAL_MATERIAL_KEYS: readonly string[] = [\n \"transparent\", \"alphaTest\", \"faces\", \"wireframe\", \"blend\",\n \"vertexColors\", \"toneMapped\", \"shading\", \"dithering\",\n \"polygonOffset\", \"raw\", \"extends\", \"defines\",\n];\n"]}
|
|
@@ -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,CAA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,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAC3B,OAAO;QACH,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACd,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;QACd,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACf,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,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,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AAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAC3B,OAAO;QACH,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACd,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;QACd,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACf,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,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\";\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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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,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,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhF,8EAA8E;IAC9E,4EAA4E;IAC5E,kCAAkC;IAClC,MAAM,GAAG,GAAS;QACd,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,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AAC,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"]}
|