@nova-lab/core 1.0.0-dev.19 → 1.1.0-dev.229
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/README.md +1035 -10
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/2d/accessibility.d.ts +2 -0
- package/dist/2d/accessibility.js +171 -0
- package/dist/2d/commands.d.ts +2 -0
- package/dist/2d/commands.js +80 -0
- package/dist/2d/effects.d.ts +10 -0
- package/dist/2d/effects.js +566 -0
- package/dist/2d/ktx2.d.ts +5 -0
- package/dist/2d/ktx2.js +542 -0
- package/dist/2d/lighting.d.ts +3 -0
- package/dist/2d/lighting.js +495 -0
- package/dist/2d/lottie.d.ts +3 -0
- package/dist/2d/lottie.js +254 -0
- package/dist/2d/meshes.d.ts +4 -0
- package/dist/2d/meshes.js +451 -0
- package/dist/2d/primitives.d.ts +3 -0
- package/dist/2d/primitives.js +85 -0
- package/dist/2d/render-textures.d.ts +3 -0
- package/dist/2d/render-textures.js +539 -0
- package/dist/2d/svg/documents.d.ts +5 -0
- package/dist/2d/svg/documents.js +7 -0
- package/dist/2d/svg/renderer.d.ts +3 -0
- package/dist/2d/svg/renderer.js +222 -0
- package/dist/2d/svg.d.ts +3 -0
- package/dist/2d/svg.js +4 -0
- package/dist/2d/tools.d.ts +2 -0
- package/dist/2d/tools.js +100 -0
- package/dist/2d/video.d.ts +5 -0
- package/dist/2d/video.js +90 -0
- package/dist/2d.d.ts +2 -0
- package/dist/2d.js +220 -0
- package/dist/3d/animation.d.ts +8 -0
- package/dist/3d/animation.js +1396 -0
- package/dist/3d/area-lights.d.ts +2 -0
- package/dist/3d/area-lights.js +19 -0
- package/dist/3d/audio.d.ts +4 -0
- package/dist/3d/audio.js +500 -0
- package/dist/3d/character.d.ts +2 -0
- package/dist/3d/character.js +136 -0
- package/dist/3d/collision.d.ts +3 -0
- package/dist/3d/collision.js +387 -0
- package/dist/3d/commands.d.ts +2 -0
- package/dist/3d/commands.js +108 -0
- package/dist/3d/controls.d.ts +8 -0
- package/dist/3d/controls.js +1041 -0
- package/dist/3d/documents.d.ts +5 -0
- package/dist/3d/documents.js +227 -0
- package/dist/3d/effects.d.ts +5 -0
- package/dist/3d/effects.js +1986 -0
- package/dist/3d/export.d.ts +4 -0
- package/dist/3d/export.js +347 -0
- package/dist/3d/fbx.d.ts +2 -0
- package/dist/3d/fbx.js +784 -0
- package/dist/3d/gltf.d.ts +2 -0
- package/dist/3d/gltf.js +5 -0
- package/dist/3d/helpers.d.ts +5 -0
- package/dist/3d/helpers.js +191 -0
- package/dist/3d/ik.d.ts +9 -0
- package/dist/3d/ik.js +777 -0
- package/dist/3d/loaders.d.ts +17 -0
- package/dist/3d/loaders.js +1406 -0
- package/dist/3d/nodes.d.ts +8 -0
- package/dist/3d/nodes.js +49 -0
- package/dist/3d/particles.d.ts +5 -0
- package/dist/3d/particles.js +1574 -0
- package/dist/3d/physics/backend.d.ts +7 -0
- package/dist/3d/physics/backend.js +1 -0
- package/dist/3d/physics/rapier.d.ts +3 -0
- package/dist/3d/physics/rapier.js +765 -0
- package/dist/3d/physics.d.ts +5 -0
- package/dist/3d/physics.js +3346 -0
- package/dist/3d/splats.d.ts +7 -0
- package/dist/3d/splats.js +862 -0
- package/dist/3d/text.d.ts +5 -0
- package/dist/3d/text.js +1043 -0
- package/dist/3d/tiles.d.ts +24 -0
- package/dist/3d/tiles.js +1705 -0
- package/dist/3d/tools.d.ts +12 -0
- package/dist/3d/tools.js +338 -0
- package/dist/3d/usdz.d.ts +2 -0
- package/dist/3d/usdz.js +634 -0
- package/dist/3d/xr.d.ts +2 -0
- package/dist/3d/xr.js +202 -0
- package/dist/3d-B4jWF8Qb.js +5591 -0
- package/dist/3d.d.ts +40 -0
- package/dist/3d.js +44 -0
- package/dist/Capsule-BFVpZfvc.js +44 -0
- package/dist/Clip-CAN7t03k.js +204 -0
- package/dist/Color-vuv9UnoY.js +34 -0
- package/dist/DeformedMesh-CPi0P_vc.js +280 -0
- package/dist/Document-DCVEZSvM.js +415 -0
- package/dist/Errors-B2ekO9bZ.js +30 -0
- package/dist/Features-BsjmePtc.js +557 -0
- package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
- package/dist/GPUParticleState-CQlNpoDa.js +545 -0
- package/dist/Geometry-DytO490z.js +227 -0
- package/dist/Inflate-DWw0V-Up.js +42 -0
- package/dist/InstancedMesh-DPrgrw5z.js +527 -0
- package/dist/Limits-Bw5XQdFr.js +20 -0
- package/dist/LineHelper-Ad0z9uDi.js +131 -0
- package/dist/LoaderIO-BwrM84OM.js +114 -0
- package/dist/Material-BpfLPmK9.js +777 -0
- package/dist/Mesh-BaRxAAJq.js +209 -0
- package/dist/Node-QfgAE2_v.js +877 -0
- package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
- package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
- package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
- package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
- package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
- package/dist/Options-CajE7LLJ.js +15 -0
- package/dist/PolygonMesh-D4PnnfIo.js +657 -0
- package/dist/Ready-BzyhRtjD.js +21 -0
- package/dist/Scene-CDfNgf9I.js +911 -0
- package/dist/Shader-b6_HDndT.js +48 -0
- package/dist/SplatShader-wJ6GJ3vo.js +130 -0
- package/dist/Texture-dTKMlTpK.js +267 -0
- package/dist/TextureLoader-CfDzdy2m.js +411 -0
- package/dist/Textures-CGL4Kf-8.js +651 -0
- package/dist/ToneMapping-D9IWvN0u.js +46 -0
- package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
- package/dist/ZipReader-C-MSEsSr.js +84 -0
- package/dist/core.js +218 -24024
- package/dist/domain/types/base.types.d.ts +18 -9
- package/dist/domain/types/component.types.d.ts +5 -5
- package/dist/domain/types/cursor.types.d.ts +1 -1
- package/dist/domain/types/diagnostics.types.d.ts +2 -0
- package/dist/domain/types/export.types.d.ts +2 -2
- package/dist/domain/types/hit-test.types.d.ts +1 -1
- package/dist/domain/types/motion.types.d.ts +2 -2
- package/dist/domain/types/renderer.types.d.ts +88 -4
- package/dist/domain/types/rendering/index.d.ts +29 -4
- package/dist/domain/types/sound.types.d.ts +1 -1
- package/dist/domain/types/theme.types.d.ts +1 -1
- package/dist/domain/utils/bounds.d.ts +1 -1
- package/dist/domain/utils/nova-text.d.ts +9 -0
- package/dist/domain/utils/schemaBounds.d.ts +2 -2
- package/dist/export-svg-document-ChaNXMaG.js +668 -0
- package/dist/features/3d/Errors.d.ts +57 -0
- package/dist/features/3d/Nova3DApp.d.ts +429 -0
- package/dist/features/3d/animation/Animator.d.ts +260 -0
- package/dist/features/3d/animation/Clip.d.ts +74 -0
- package/dist/features/3d/animation/Graph.d.ts +158 -0
- package/dist/features/3d/animation/Mask.d.ts +40 -0
- package/dist/features/3d/audio/Audio.d.ts +114 -0
- package/dist/features/3d/audio/Sound.d.ts +133 -0
- package/dist/features/3d/character/CharacterController.d.ts +61 -0
- package/dist/features/3d/collision/Capsule.d.ts +25 -0
- package/dist/features/3d/collision/Octree.d.ts +94 -0
- package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
- package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
- package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
- package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
- package/dist/features/3d/controls/PointerLock.d.ts +36 -0
- package/dist/features/3d/controls/Snapping.d.ts +32 -0
- package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
- package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
- package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
- package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
- package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
- package/dist/features/3d/documents/Document.d.ts +59 -0
- package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
- package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
- package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
- package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
- package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
- package/dist/features/3d/documents/Projection.d.ts +65 -0
- package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
- package/dist/features/3d/effects/Effects.d.ts +32 -0
- package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
- package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
- package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
- package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
- package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
- package/dist/features/3d/export/ZipWriter.d.ts +9 -0
- package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
- package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
- package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
- package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
- package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
- package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
- package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
- package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
- package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
- package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
- package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
- package/dist/features/3d/ik/ChainIK.d.ts +44 -0
- package/dist/features/3d/ik/IKChain.d.ts +92 -0
- package/dist/features/3d/ik/IKMath.d.ts +49 -0
- package/dist/features/3d/ik/IKSolver.d.ts +97 -0
- package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
- package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
- package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
- package/dist/features/3d/import/ImportMath.d.ts +42 -0
- package/dist/features/3d/import/ImportedModel.d.ts +135 -0
- package/dist/features/3d/import/Inflate.d.ts +5 -0
- package/dist/features/3d/import/ModelAsset.d.ts +149 -0
- package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
- package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
- package/dist/features/3d/lights/AreaLights.d.ts +11 -0
- package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
- package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
- package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
- package/dist/features/3d/loaders/Limits.d.ts +70 -0
- package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
- package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
- package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
- package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
- package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
- package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
- package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
- package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
- package/dist/features/3d/model/Camera.d.ts +33 -0
- package/dist/features/3d/model/Environment.d.ts +31 -0
- package/dist/features/3d/model/Geometry.d.ts +59 -0
- package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
- package/dist/features/3d/model/LOD.d.ts +31 -0
- package/dist/features/3d/model/Light.d.ts +200 -0
- package/dist/features/3d/model/Material.d.ts +308 -0
- package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
- package/dist/features/3d/model/Mesh.d.ts +92 -0
- package/dist/features/3d/model/Node.d.ts +87 -0
- package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
- package/dist/features/3d/model/RenderTarget.d.ts +41 -0
- package/dist/features/3d/model/Scene.d.ts +173 -0
- package/dist/features/3d/model/Texture.d.ts +143 -0
- package/dist/features/3d/nodes/Nodes.d.ts +8 -0
- package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
- package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
- package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
- package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
- package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
- package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
- package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
- package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
- package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
- package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
- package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
- package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
- package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
- package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
- package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
- package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
- package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
- package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
- package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
- package/dist/features/3d/services/Background.d.ts +22 -0
- package/dist/features/3d/services/BasicShader.d.ts +55 -0
- package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
- package/dist/features/3d/services/DrawOrder.d.ts +37 -0
- package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
- package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
- package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
- package/dist/features/3d/services/FogShader.d.ts +6 -0
- package/dist/features/3d/services/Frustum.d.ts +7 -0
- package/dist/features/3d/services/GLState.d.ts +86 -0
- package/dist/features/3d/services/GPUPicker.d.ts +31 -0
- package/dist/features/3d/services/InstanceShader.d.ts +3 -0
- package/dist/features/3d/services/LineProgram.d.ts +32 -0
- package/dist/features/3d/services/PBRProgram.d.ts +115 -0
- package/dist/features/3d/services/Renderer.d.ts +50 -0
- package/dist/features/3d/services/Shader.d.ts +22 -0
- package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
- package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
- package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
- package/dist/features/3d/services/TextureLoader.d.ts +40 -0
- package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
- package/dist/features/3d/services/ToneMapping.d.ts +12 -0
- package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
- package/dist/features/3d/splats/SplatData.d.ts +136 -0
- package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
- package/dist/features/3d/splats/SplatShader.d.ts +14 -0
- package/dist/features/3d/splats/SplatSort.d.ts +69 -0
- package/dist/features/3d/splats/Splats.d.ts +116 -0
- package/dist/features/3d/text/FontAtlas.d.ts +246 -0
- package/dist/features/3d/text/SDF.d.ts +28 -0
- package/dist/features/3d/text/Text.d.ts +179 -0
- package/dist/features/3d/text/TextLayout.d.ts +73 -0
- package/dist/features/3d/text/TextShader.d.ts +12 -0
- package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
- package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
- package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
- package/dist/features/3d/tiles/TileContent.d.ts +35 -0
- package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
- package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
- package/dist/features/3d/tiles/Tileset.d.ts +81 -0
- package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
- package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
- package/dist/features/3d/tools/Color.d.ts +11 -0
- package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
- package/dist/features/3d/tools/Options.d.ts +15 -0
- package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
- package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
- package/dist/features/3d/tools/Primitives.d.ts +164 -0
- package/dist/features/3d/tools/Ready.d.ts +12 -0
- package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
- package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
- package/dist/features/3d/tools/math/mat3.d.ts +7 -0
- package/dist/features/3d/tools/math/mat4.d.ts +19 -0
- package/dist/features/3d/tools/math/quat.d.ts +6 -0
- package/dist/features/3d/tools/math/vec3.d.ts +16 -0
- package/dist/features/3d/tools/math/vec4.d.ts +5 -0
- package/dist/features/3d/types.d.ts +359 -0
- package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
- package/dist/features/3d/usdz/USDScene.d.ts +20 -0
- package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
- package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
- package/dist/features/3d/webgpu/Backend.d.ts +40 -0
- package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
- package/dist/features/3d/webgpu/Constants.d.ts +32 -0
- package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
- package/dist/features/3d/webgpu/Environment.d.ts +66 -0
- package/dist/features/3d/webgpu/Features.d.ts +68 -0
- package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
- package/dist/features/3d/webgpu/Lines.d.ts +40 -0
- package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
- package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
- package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
- package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
- package/dist/features/3d/webgpu/Particles.d.ts +114 -0
- package/dist/features/3d/webgpu/Picking.d.ts +59 -0
- package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
- package/dist/features/3d/webgpu/Points.d.ts +41 -0
- package/dist/features/3d/webgpu/Probes.d.ts +45 -0
- package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
- package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
- package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
- package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
- package/dist/features/3d/webgpu/Splats.d.ts +47 -0
- package/dist/features/3d/webgpu/Textures.d.ts +52 -0
- package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
- package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
- package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
- package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
- package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
- package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
- package/dist/features/3d/xr/XR.d.ts +100 -0
- package/dist/gltf-By-n0qEg.js +960 -0
- package/dist/index.d.ts +86 -81
- package/dist/model/document-actions/document-commands.d.ts +18 -0
- package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
- package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
- package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
- package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
- package/dist/model/documents/svg/svg-values.d.ts +16 -0
- package/dist/model/documents/svg/svg-xml.d.ts +18 -0
- package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
- package/dist/model/input/NovaInputValidationController.d.ts +1 -1
- package/dist/model/input/NovaTextInputController.d.ts +1 -1
- package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
- package/dist/model/input/index.d.ts +7 -7
- package/dist/model/input/nova-input.types.d.ts +1 -1
- package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
- package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
- package/dist/model/lighting/lighting-shaders.d.ts +3 -0
- package/dist/model/lighting/lighting-state.d.ts +27 -0
- package/dist/model/lighting/lighting.types.d.ts +107 -0
- package/dist/model/lottie/LottieNode.d.ts +4 -0
- package/dist/model/lottie/lottie.types.d.ts +83 -0
- package/dist/model/lottie/prepare-lottie.d.ts +3 -0
- package/dist/model/lottie/sample-position.d.ts +9 -0
- package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
- package/dist/model/motion/nova-motion-easing.d.ts +1 -1
- package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
- package/dist/model/motion/nova-motion-presets.d.ts +2 -2
- package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
- package/dist/model/platform/NovaCanvas.d.ts +7 -6
- package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
- package/dist/model/primitives/definePrimitive.d.ts +5 -0
- package/dist/model/primitives/primitive.types.d.ts +28 -0
- package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
- package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
- package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
- package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
- package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
- package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
- package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
- package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
- package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
- package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
- package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
- package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
- package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
- package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
- package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
- package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
- package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
- package/dist/model/render/effects/blur.d.ts +8 -0
- package/dist/model/render/effects/color-matrix.d.ts +8 -0
- package/dist/model/render/effects/drop-shadow.d.ts +18 -0
- package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
- package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
- package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
- package/dist/model/render/effects/shader-effect.d.ts +64 -0
- package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
- package/dist/model/render/geometry/nova-composition.d.ts +9 -0
- package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
- package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
- package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
- package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
- package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
- package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
- package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
- package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
- package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
- package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
- package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
- package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
- package/dist/model/render/graph/nova-render-group.d.ts +1 -1
- package/dist/model/render/graph/nova-render-item.d.ts +2 -2
- package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
- package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
- package/dist/model/render/graph/nova-render-program.d.ts +5 -3
- package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
- package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
- package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
- package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
- package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
- package/dist/model/render/meshes/MeshNode.d.ts +13 -0
- package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
- package/dist/model/render/meshes/geometry.d.ts +7 -0
- package/dist/model/render/meshes/mesh.d.ts +3 -0
- package/dist/model/render/meshes/mesh.types.d.ts +116 -0
- package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
- package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
- package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
- package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
- package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
- package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
- package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
- package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
- package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
- package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
- package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
- package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
- package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
- package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
- package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
- package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
- package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
- package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
- package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
- package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
- package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
- package/dist/model/runtime/app/Nova.d.ts +35 -35
- package/dist/model/runtime/app/NovaApp.d.ts +58 -30
- package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
- package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
- package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
- package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
- package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
- package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
- package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
- package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
- package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
- package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
- package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
- package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
- package/dist/model/runtime/context/nova-context.d.ts +1 -1
- package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
- package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
- package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
- package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
- package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
- package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
- package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
- package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
- package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
- package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
- package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
- package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
- package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
- package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
- package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
- package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
- package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
- package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
- package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
- package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
- package/dist/model/text-selection/index.d.ts +2 -2
- package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
- package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
- package/dist/model/theme/NovaThemeService.d.ts +5 -3
- package/dist/model/theme/createTokenTheme.d.ts +15 -0
- package/dist/model/tools/transform-tools.d.ts +43 -0
- package/dist/nodes--Ds4IS2h.js +621 -0
- package/dist/nova-color-parser-BCN_rFRN.js +250 -0
- package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
- package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
- package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
- package/dist/nova-text-paint-CcntsRjI.js +48 -0
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.js +50 -0
- package/dist/vec4-BTNv1fUp.js +20 -0
- package/package.json +223 -4
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
import { N as l } from "./Errors-B2ekO9bZ.js";
|
|
2
|
+
import { c as he } from "./nodes--Ds4IS2h.js";
|
|
3
|
+
import { l as de } from "./Shader-b6_HDndT.js";
|
|
4
|
+
import { t as ge } from "./ToneMapping-D9IWvN0u.js";
|
|
5
|
+
import { l as P, a as ye, b as ve, p as X } from "./Color-vuv9UnoY.js";
|
|
6
|
+
import { c as z, o as g } from "./Options-CajE7LLJ.js";
|
|
7
|
+
function Me(r, e) {
|
|
8
|
+
return `#version 300 es
|
|
9
|
+
precision highp float;
|
|
10
|
+
precision highp int;
|
|
11
|
+
${e ? "#define NOVA_INSTANCED" : ""}
|
|
12
|
+
${r}
|
|
13
|
+
layout(location=0) in vec3 position;
|
|
14
|
+
layout(location=1) in vec3 normal;
|
|
15
|
+
layout(location=2) in vec2 uv;
|
|
16
|
+
layout(location=3) in vec4 color;
|
|
17
|
+
layout(location=10) in vec2 uv1;
|
|
18
|
+
#ifdef NOVA_INSTANCED
|
|
19
|
+
layout(location=4) in vec4 instanceColumn0;
|
|
20
|
+
layout(location=5) in vec4 instanceColumn1;
|
|
21
|
+
layout(location=6) in vec4 instanceColumn2;
|
|
22
|
+
layout(location=7) in vec4 instanceColumn3;
|
|
23
|
+
#endif
|
|
24
|
+
uniform mat4 modelMatrix;
|
|
25
|
+
uniform mat3 normalMatrix;
|
|
26
|
+
uniform mat4 viewMatrix;
|
|
27
|
+
uniform mat4 projectionMatrix;
|
|
28
|
+
uniform mat4 viewProjectionMatrix;
|
|
29
|
+
uniform vec3 cameraPosition;
|
|
30
|
+
mat4 novaInstanceMatrix(){
|
|
31
|
+
#ifdef NOVA_INSTANCED
|
|
32
|
+
return mat4(instanceColumn0,instanceColumn1,instanceColumn2,instanceColumn3);
|
|
33
|
+
#else
|
|
34
|
+
return mat4(1.0);
|
|
35
|
+
#endif
|
|
36
|
+
}
|
|
37
|
+
vec4 novaWorldPosition(vec3 local){return modelMatrix*(novaInstanceMatrix()*vec4(local,1.0));}
|
|
38
|
+
vec3 novaWorldNormal(vec3 local){return normalize(normalMatrix*(mat3(novaInstanceMatrix())*local));}
|
|
39
|
+
#line 1
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
function be(r, e) {
|
|
43
|
+
return `#version 300 es
|
|
44
|
+
precision highp float;
|
|
45
|
+
precision highp int;
|
|
46
|
+
precision highp sampler2D;
|
|
47
|
+
precision highp sampler2DArray;
|
|
48
|
+
precision highp sampler3D;
|
|
49
|
+
${e.mode === 1 ? "#define NOVA_MASK" : ""}
|
|
50
|
+
${e.mode === 2 ? "#define NOVA_BLEND" : ""}
|
|
51
|
+
${e.direct ? "#define NOVA_DIRECT" : ""}
|
|
52
|
+
${e.coverage ? "#define NOVA_ALPHA_TO_COVERAGE" : ""}
|
|
53
|
+
${r}
|
|
54
|
+
uniform vec3 cameraPosition;
|
|
55
|
+
uniform float novaOpacity;
|
|
56
|
+
uniform float novaCutoff;
|
|
57
|
+
uniform float novaExposure;
|
|
58
|
+
uniform int novaToneMapping;
|
|
59
|
+
${ge}
|
|
60
|
+
out vec4 novaFragColor;
|
|
61
|
+
|
|
62
|
+
void novaOutput(vec4 linear){
|
|
63
|
+
float alpha=linear.a*novaOpacity;
|
|
64
|
+
#ifdef NOVA_MASK
|
|
65
|
+
#ifdef NOVA_ALPHA_TO_COVERAGE
|
|
66
|
+
alpha=smoothstep(novaCutoff,novaCutoff+fwidth(alpha),alpha);
|
|
67
|
+
if(alpha==0.0)discard;
|
|
68
|
+
#else
|
|
69
|
+
if(alpha<novaCutoff)discard;
|
|
70
|
+
#endif
|
|
71
|
+
#endif
|
|
72
|
+
#if defined(NOVA_BLEND)&&defined(NOVA_DIRECT)
|
|
73
|
+
novaFragColor=vec4(novaEncodeSRGB(novaToneMap(linear.rgb,novaExposure,novaToneMapping))*alpha,alpha);
|
|
74
|
+
#elif defined(NOVA_BLEND)
|
|
75
|
+
novaFragColor=vec4(linear.rgb*alpha,alpha);
|
|
76
|
+
#elif defined(NOVA_DIRECT)
|
|
77
|
+
#ifdef NOVA_ALPHA_TO_COVERAGE
|
|
78
|
+
novaFragColor=vec4(novaEncodeSRGB(novaToneMap(linear.rgb,novaExposure,novaToneMapping)),alpha);
|
|
79
|
+
#else
|
|
80
|
+
novaFragColor=vec4(novaEncodeSRGB(novaToneMap(linear.rgb,novaExposure,novaToneMapping)),1.0);
|
|
81
|
+
#endif
|
|
82
|
+
#else
|
|
83
|
+
novaFragColor=vec4(linear.rgb,1.0);
|
|
84
|
+
#endif
|
|
85
|
+
}
|
|
86
|
+
#line 1
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
const we = `out vec3 vWorldPosition;
|
|
90
|
+
out vec3 vWorldNormal;
|
|
91
|
+
out vec2 vUv;
|
|
92
|
+
void main(){
|
|
93
|
+
vec4 world=novaWorldPosition(position);
|
|
94
|
+
vWorldPosition=world.xyz;
|
|
95
|
+
vWorldNormal=novaWorldNormal(normal);
|
|
96
|
+
vUv=uv;
|
|
97
|
+
gl_Position=viewProjectionMatrix*world;
|
|
98
|
+
}`, _e = 15;
|
|
99
|
+
class rr {
|
|
100
|
+
constructor(e, t) {
|
|
101
|
+
this._gl = e, this._state = t;
|
|
102
|
+
}
|
|
103
|
+
_programs = /* @__PURE__ */ new Map();
|
|
104
|
+
_compiled = !1;
|
|
105
|
+
/** True once after a new program was linked; the renderer then verifies the frame. */
|
|
106
|
+
takeCompiled() {
|
|
107
|
+
const e = this._compiled;
|
|
108
|
+
return this._compiled = !1, e;
|
|
109
|
+
}
|
|
110
|
+
bind(e, t, o, n, i, s, c, b, h, a, d) {
|
|
111
|
+
const p = `${i.instanced ? 1 : 0}${i.mode}${i.direct ? 1 : 0}${i.coverage ? 1 : 0}|${t.sourceKey}`;
|
|
112
|
+
let u = this._programs.get(p);
|
|
113
|
+
u || (u = this._compile(p, t, o, i));
|
|
114
|
+
const m = this._state;
|
|
115
|
+
if (m.useProgram(u.program), u.frameStamp !== s.stamp && (m.uniformMatrix4(u.viewMatrix, s.view), m.uniformMatrix4(u.projectionMatrix, s.projection), m.uniformMatrix4(u.viewProjectionMatrix, s.viewProjection), m.uniform3f(u.cameraPositionVertex, s.cameraPosition[0], s.cameraPosition[1], s.cameraPosition[2]), u.frameStamp = s.stamp), m.uniform1f(u.exposure, a), m.uniform1i(u.toneMapping, d), m.uniformMatrix4(u.modelMatrix, c), m.uniformMatrix3(u.normalMatrix, b), u.material !== e || u.uniformVersion !== n) {
|
|
116
|
+
m.uniform1f(u.opacity, t.opacity), m.uniform1f(u.cutoff, t.alphaCutoff);
|
|
117
|
+
for (const y of u.uniforms) {
|
|
118
|
+
const f = o.get(y.name);
|
|
119
|
+
y.unit < 0 ? this._uploadValue(y.location, f) : m.uniform1i(y.location, y.unit);
|
|
120
|
+
}
|
|
121
|
+
u.material = e, u.uniformVersion = n;
|
|
122
|
+
}
|
|
123
|
+
for (const y of u.uniforms)
|
|
124
|
+
if (y.unit >= 0) {
|
|
125
|
+
const f = o.get(y.name), v = f._readSource().dimension, w = h(f);
|
|
126
|
+
v === "2d-array" ? m.textureArray(y.unit, w) : v === "3d" ? m.texture3D(y.unit, w) : m.texture2D(y.unit, w);
|
|
127
|
+
}
|
|
128
|
+
return u.program;
|
|
129
|
+
}
|
|
130
|
+
destroy() {
|
|
131
|
+
for (const e of this._programs.values())
|
|
132
|
+
this._gl.deleteProgram(e.program);
|
|
133
|
+
this._programs.clear();
|
|
134
|
+
}
|
|
135
|
+
_compile(e, t, o, n) {
|
|
136
|
+
const i = this._gl, s = de(i, Me(t.defineSource, n.instanced) + t.vertex, be(t.defineSource, n) + t.fragment), c = (d) => i.getUniformLocation(s, d), b = [];
|
|
137
|
+
let h = 0;
|
|
138
|
+
for (const [d, p] of o) {
|
|
139
|
+
const u = c(d);
|
|
140
|
+
if (u === null)
|
|
141
|
+
continue;
|
|
142
|
+
const m = typeof p == "object" && p !== null && !Array.isArray(p) && !ArrayBuffer.isView(p);
|
|
143
|
+
if (m && h >= _e)
|
|
144
|
+
throw new l("invalid-option", "[Nova3D] A shader material uses at most 15 textures.");
|
|
145
|
+
b.push({ name: d, location: u, unit: m ? h++ : -1 });
|
|
146
|
+
}
|
|
147
|
+
const a = {
|
|
148
|
+
program: s,
|
|
149
|
+
modelMatrix: c("modelMatrix"),
|
|
150
|
+
normalMatrix: c("normalMatrix"),
|
|
151
|
+
viewMatrix: c("viewMatrix"),
|
|
152
|
+
projectionMatrix: c("projectionMatrix"),
|
|
153
|
+
viewProjectionMatrix: c("viewProjectionMatrix"),
|
|
154
|
+
cameraPositionVertex: c("cameraPosition"),
|
|
155
|
+
opacity: c("novaOpacity"),
|
|
156
|
+
cutoff: c("novaCutoff"),
|
|
157
|
+
exposure: c("novaExposure"),
|
|
158
|
+
toneMapping: c("novaToneMapping"),
|
|
159
|
+
uniforms: b,
|
|
160
|
+
frameStamp: -1,
|
|
161
|
+
uniformVersion: -1
|
|
162
|
+
};
|
|
163
|
+
return this._programs.set(e, a), this._compiled = !0, a;
|
|
164
|
+
}
|
|
165
|
+
_uploadValue(e, t) {
|
|
166
|
+
const o = this._state;
|
|
167
|
+
if (typeof t == "number") {
|
|
168
|
+
o.uniform1f(e, t);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (typeof t == "boolean") {
|
|
172
|
+
o.uniform1i(e, t ? 1 : 0);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
switch (t.length) {
|
|
176
|
+
case 2:
|
|
177
|
+
o.uniform2f(e, t[0], t[1]);
|
|
178
|
+
break;
|
|
179
|
+
case 3:
|
|
180
|
+
o.uniform3f(e, t[0], t[1], t[2]);
|
|
181
|
+
break;
|
|
182
|
+
case 4:
|
|
183
|
+
o.uniform4f(e, t[0], t[1], t[2], t[3]);
|
|
184
|
+
break;
|
|
185
|
+
case 9:
|
|
186
|
+
o.uniformMatrix3(e, t);
|
|
187
|
+
break;
|
|
188
|
+
default:
|
|
189
|
+
o.uniformMatrix4(e, t);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const xe = `struct NovaVaryings {
|
|
194
|
+
@builtin(position) position: vec4f,
|
|
195
|
+
@location(0) worldPosition: vec3f,
|
|
196
|
+
@location(1) worldNormal: vec3f,
|
|
197
|
+
@location(2) uv: vec2f,
|
|
198
|
+
}
|
|
199
|
+
@vertex
|
|
200
|
+
fn vertexMain(input: NovaVertexInput) -> NovaVaryings {
|
|
201
|
+
var out: NovaVaryings;
|
|
202
|
+
let world = novaWorldPosition(input, input.position);
|
|
203
|
+
out.worldPosition = world.xyz;
|
|
204
|
+
out.worldNormal = novaWorldNormal(input, input.normal);
|
|
205
|
+
out.uv = input.uv;
|
|
206
|
+
out.position = novaClip(world);
|
|
207
|
+
return out;
|
|
208
|
+
}`, Y = Object.freeze({ ior: 1.5, emissiveStrength: 1, clearcoat: null, sheen: null, iridescence: null, anisotropy: null, specular: null, transmission: null }), le = ["clearcoat", "clearcoatRoughness", "clearcoatNormal", "sheenColor", "sheenRoughness", "iridescence", "iridescenceThickness", "anisotropy", "specular", "specularColor", "transmission", "thickness"], Se = /* @__PURE__ */ new Set(["sheenColor", "specularColor"]), ee = 4, tr = 10;
|
|
209
|
+
function M(r, e, t, o) {
|
|
210
|
+
if (typeof r != "number" || !Number.isFinite(r) || r < t || r > o)
|
|
211
|
+
throw new l("invalid-option", `[Nova3D] ${e} must be a number in [${t}, ${o}].`);
|
|
212
|
+
return r;
|
|
213
|
+
}
|
|
214
|
+
function W(r, e) {
|
|
215
|
+
if (!Array.isArray(r) || r.length !== 3 || !r.every((t) => typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 65504))
|
|
216
|
+
throw new l("invalid-option", `[Nova3D] ${e} must be a linear RGB triple.`);
|
|
217
|
+
return Object.freeze([r[0], r[1], r[2]]);
|
|
218
|
+
}
|
|
219
|
+
const Ne = g({ factor: !0, roughness: !0, map: !0, roughnessMap: !0, normalMap: !0, normalScale: !0 }), De = g({ colorFactor: !0, roughness: !0, colorMap: !0, roughnessMap: !0 }), Te = g({ factor: !0, ior: !0, thicknessRange: !0, map: !0, thicknessMap: !0 }), Ce = g({ strength: !0, rotation: !0, map: !0 }), Ae = g({ factor: !0, colorFactor: !0, map: !0, colorMap: !0 }), Oe = g({ factor: !0, map: !0, thickness: !0, thicknessMap: !0, attenuationDistance: !0, attenuationColorLinear: !0 });
|
|
220
|
+
function A(r, e, t) {
|
|
221
|
+
return z(r, t, e), r;
|
|
222
|
+
}
|
|
223
|
+
function ze(r) {
|
|
224
|
+
const { clearcoat: e, sheen: t, iridescence: o, anisotropy: n, specular: i, transmission: s } = r;
|
|
225
|
+
return {
|
|
226
|
+
ior: r.ior,
|
|
227
|
+
emissiveStrength: r.emissiveStrength,
|
|
228
|
+
clearcoat: e && { ...e },
|
|
229
|
+
sheen: t && { colorFactor: t.color, roughness: t.roughness, colorMap: t.colorMap, roughnessMap: t.roughnessMap },
|
|
230
|
+
iridescence: o && { ...o },
|
|
231
|
+
anisotropy: n && { ...n },
|
|
232
|
+
specular: i && { factor: i.factor, colorFactor: i.color, map: i.map, colorMap: i.colorMap },
|
|
233
|
+
transmission: s && { factor: s.factor, map: s.map, thickness: s.thickness, thicknessMap: s.thicknessMap, attenuationDistance: s.attenuationDistance, attenuationColorLinear: s.attenuationColor }
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function Fe(r, e) {
|
|
237
|
+
const t = M(r.ior ?? 1.5, "ior", 1, 5), o = M(r.emissiveStrength ?? 1, "emissiveStrength", 0, 1e6);
|
|
238
|
+
let n = null;
|
|
239
|
+
if (r.clearcoat) {
|
|
240
|
+
const a = A(r.clearcoat, "clearcoat", Ne);
|
|
241
|
+
n = Object.freeze({ factor: M(a.factor ?? 1, "clearcoat.factor", 0, 1), roughness: M(a.roughness ?? 0, "clearcoat.roughness", 0, 1), map: e(a.map, "clearcoat.map"), roughnessMap: e(a.roughnessMap, "clearcoat.roughnessMap"), normalMap: e(a.normalMap, "clearcoat.normalMap"), normalScale: M(a.normalScale ?? 1, "clearcoat.normalScale", -100, 100) });
|
|
242
|
+
}
|
|
243
|
+
let i = null;
|
|
244
|
+
if (r.sheen) {
|
|
245
|
+
const a = A(r.sheen, "sheen", De);
|
|
246
|
+
i = Object.freeze({ color: W(a.colorFactor ?? [1, 1, 1], "sheen.colorFactor"), roughness: M(a.roughness ?? 0, "sheen.roughness", 0, 1), colorMap: e(a.colorMap, "sheen.colorMap"), roughnessMap: e(a.roughnessMap, "sheen.roughnessMap") });
|
|
247
|
+
}
|
|
248
|
+
let s = null;
|
|
249
|
+
if (r.iridescence) {
|
|
250
|
+
const a = A(r.iridescence, "iridescence", Te), d = a.thicknessRange ?? [100, 400];
|
|
251
|
+
if (!Array.isArray(d) || d.length !== 2)
|
|
252
|
+
throw new l("invalid-option", "[Nova3D] iridescence.thicknessRange must be [minimum, maximum].");
|
|
253
|
+
const p = M(d[0], "iridescence.thicknessRange[0]", 0, 1e5), u = M(d[1], "iridescence.thicknessRange[1]", 0, 1e5);
|
|
254
|
+
s = Object.freeze({ factor: M(a.factor ?? 1, "iridescence.factor", 0, 1), ior: M(a.ior ?? 1.3, "iridescence.ior", 1, 5), thicknessRange: Object.freeze([p, u]), map: e(a.map, "iridescence.map"), thicknessMap: e(a.thicknessMap, "iridescence.thicknessMap") });
|
|
255
|
+
}
|
|
256
|
+
let c = null;
|
|
257
|
+
if (r.anisotropy) {
|
|
258
|
+
const a = A(r.anisotropy, "anisotropy", Ce);
|
|
259
|
+
c = Object.freeze({ strength: M(a.strength ?? 1, "anisotropy.strength", 0, 1), rotation: M(a.rotation ?? 0, "anisotropy.rotation", -1e3, 1e3), map: e(a.map, "anisotropy.map") });
|
|
260
|
+
}
|
|
261
|
+
let b = null;
|
|
262
|
+
if (r.specular) {
|
|
263
|
+
const a = A(r.specular, "specular", Ae);
|
|
264
|
+
b = Object.freeze({ factor: M(a.factor ?? 1, "specular.factor", 0, 1), color: W(a.colorFactor ?? [1, 1, 1], "specular.colorFactor"), map: e(a.map, "specular.map"), colorMap: e(a.colorMap, "specular.colorMap") });
|
|
265
|
+
}
|
|
266
|
+
let h = null;
|
|
267
|
+
if (r.transmission) {
|
|
268
|
+
const a = A(r.transmission, "transmission", Oe), d = a.attenuationDistance ?? Number.POSITIVE_INFINITY;
|
|
269
|
+
if (!(d > 0))
|
|
270
|
+
throw new l("invalid-option", "[Nova3D] transmission.attenuationDistance must be positive.");
|
|
271
|
+
h = Object.freeze({ factor: M(a.factor ?? 1, "transmission.factor", 0, 1), map: e(a.map, "transmission.map"), thickness: M(a.thickness ?? 0, "transmission.thickness", 0, 1e6), thicknessMap: e(a.thicknessMap, "transmission.thicknessMap"), attenuationDistance: d, attenuationColor: W(a.attenuationColorLinear ?? [1, 1, 1], "transmission.attenuationColorLinear") });
|
|
272
|
+
}
|
|
273
|
+
return t === 1.5 && o === 1 && !n && !i && !s && !c && !b && !h ? Y : Object.freeze({ ior: t, emissiveStrength: o, clearcoat: n, sheen: i, iridescence: s, anisotropy: c, specular: b, transmission: h });
|
|
274
|
+
}
|
|
275
|
+
function J(r) {
|
|
276
|
+
return [r.clearcoat?.map ?? null, r.clearcoat?.roughnessMap ?? null, r.clearcoat?.normalMap ?? null, r.sheen?.colorMap ?? null, r.sheen?.roughnessMap ?? null, r.iridescence?.map ?? null, r.iridescence?.thicknessMap ?? null, r.anisotropy?.map ?? null, r.specular?.map ?? null, r.specular?.colorMap ?? null, r.transmission?.map ?? null, r.transmission?.thicknessMap ?? null];
|
|
277
|
+
}
|
|
278
|
+
function je(r) {
|
|
279
|
+
return Se.has(le[r]);
|
|
280
|
+
}
|
|
281
|
+
const re = /* @__PURE__ */ new Map(), H = [""];
|
|
282
|
+
function or(r) {
|
|
283
|
+
return H[r];
|
|
284
|
+
}
|
|
285
|
+
const Z = Object.freeze({ id: 0, units: Object.freeze([]), matrices: new Float32Array(36), slots: Object.freeze([]), sets: 0, mapUnits: Object.freeze(le.map(() => -1)) });
|
|
286
|
+
function te(r, e) {
|
|
287
|
+
if (r === Y)
|
|
288
|
+
return Z;
|
|
289
|
+
const t = [], o = [], n = [], i = J(r);
|
|
290
|
+
for (const p of i) {
|
|
291
|
+
if (!p) {
|
|
292
|
+
n.push(-1);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
let u = 0;
|
|
296
|
+
for (; u < t.length && !(t[u] === p.texture && Ve(o[u], p.transform)); )
|
|
297
|
+
u++;
|
|
298
|
+
if (u === t.length) {
|
|
299
|
+
if (t.length === ee)
|
|
300
|
+
throw new l("invalid-option", `[Nova3D] A PBR material samples at most ${ee} distinct extension textures.`);
|
|
301
|
+
t.push(p.texture), o.push(p.transform);
|
|
302
|
+
}
|
|
303
|
+
n.push(u);
|
|
304
|
+
}
|
|
305
|
+
const s = new Float32Array(36);
|
|
306
|
+
let c = 0;
|
|
307
|
+
for (let p = 0; p < t.length; p++)
|
|
308
|
+
e(s, p, o[p]), o[p]?.texCoord === 1 && (c |= 1 << p);
|
|
309
|
+
const h = `${[r.ior !== 1.5 && "I", r.specular && "S", r.clearcoat && "C", r.sheen && "H", r.iridescence && "R", r.anisotropy && "A", r.transmission && "T"].filter(Boolean).join("")}|${n.join(",")}|${c}`;
|
|
310
|
+
let a = re.get(h);
|
|
311
|
+
if (a === void 0) {
|
|
312
|
+
if (a = H.length, a >= 32768)
|
|
313
|
+
throw new l("invalid-option", "[Nova3D] Too many distinct PBR extension layouts.");
|
|
314
|
+
re.set(h, a), H.push(h);
|
|
315
|
+
}
|
|
316
|
+
const d = Object.freeze(t.map((p, u) => s.subarray(u * 9, u * 9 + 9)));
|
|
317
|
+
return Object.freeze({ id: a, units: Object.freeze(t), matrices: s, slots: d, sets: c, mapUnits: Object.freeze(n) });
|
|
318
|
+
}
|
|
319
|
+
function Ve(r, e) {
|
|
320
|
+
return r === e ? !0 : !r || !e ? !1 : r.texCoord === e.texCoord && r.rotation === e.rotation && r.offset[0] === e.offset[0] && r.offset[1] === e.offset[1] && r.scale[0] === e.scale[0] && r.scale[1] === e.scale[1];
|
|
321
|
+
}
|
|
322
|
+
function $e(r) {
|
|
323
|
+
const e = [];
|
|
324
|
+
for (const t of J(r))
|
|
325
|
+
t && !e.includes(t.texture) && e.push(t.texture);
|
|
326
|
+
return e;
|
|
327
|
+
}
|
|
328
|
+
const O = { opacity: !0, side: !0, alphaMode: !0, alphaCutoff: !0, blending: !0, depthTest: !0, depthWrite: !0, alphaToCoverage: !0 }, oe = { ...O, type: !0, color: !0, map: !0, fog: !0, mapTransform: !0, pointSize: !0, sizeAttenuation: !0, billboard: !0, billboardRotation: !0, spriteSheet: !0 }, R = { ...O, fog: !0, baseColorFactor: !0, baseColorMap: !0, normalMap: !0, occlusionMap: !0, emissiveMap: !0, baseColorMapTransform: !0, normalMapTransform: !0, occlusionMapTransform: !0, emissiveMapTransform: !0, normalScale: !0, occlusionStrength: !0, emissiveFactor: !0, lightMap: !0, lightMapIntensity: !0, lightMapTransform: !0 }, ke = {
|
|
329
|
+
basic: g(oe),
|
|
330
|
+
matcap: g({ ...oe, matcap: !0 }),
|
|
331
|
+
normal: g({ ...O, type: !0, pointSize: !0, sizeAttenuation: !0 }),
|
|
332
|
+
depth: g({ ...O, type: !0, pointSize: !0, sizeAttenuation: !0 }),
|
|
333
|
+
shader: g({ ...O, type: !0, vertex: !0, fragment: !0, uniforms: !0, defines: !0, wgsl: !0, billboard: !0 }),
|
|
334
|
+
line: g({ ...O, type: !0, color: !0, fog: !0, width: !0, worldUnits: !0, dashSize: !0, gapSize: !0, dashOffset: !0 }),
|
|
335
|
+
pbr: g({ ...R, type: !0, ior: !0, emissiveStrength: !0, clearcoat: !0, sheen: !0, iridescence: !0, anisotropy: !0, specular: !0, transmission: !0, metallicFactor: !0, roughnessFactor: !0, metallicRoughnessMap: !0, metallicRoughnessMapTransform: !0, nodes: !0 }),
|
|
336
|
+
lambert: g({ ...R, type: !0 }),
|
|
337
|
+
phong: g({ ...R, type: !0, specularColor: !0, shininess: !0, specularMap: !0, specularMapTransform: !0 }),
|
|
338
|
+
toon: g({ ...R, type: !0, gradientMap: !0 })
|
|
339
|
+
}, Re = g({ texCoord: !0, offset: !0, rotation: !0, scale: !0 }), Pe = g({ columns: !0, rows: !0, frame: !0 }), Ue = g({ vertex: !0, fragment: !0 }), Ee = /* @__PURE__ */ new Set(["texture", "transform"]);
|
|
340
|
+
function Ie(r) {
|
|
341
|
+
if (r == null)
|
|
342
|
+
return null;
|
|
343
|
+
z(r, Pe, "spriteSheet");
|
|
344
|
+
const { columns: e, rows: t, frame: o = 0 } = r;
|
|
345
|
+
if (!Number.isInteger(e) || !Number.isInteger(t) || e < 1 || t < 1 || e > 4096 || t > 4096 || !Number.isInteger(o) || o < 0 || o >= e * t)
|
|
346
|
+
throw new l("invalid-option", "[Nova3D] spriteSheet needs 1..4096 integer columns and rows and a frame inside the grid.");
|
|
347
|
+
return Object.freeze({ columns: e, rows: t, frame: o });
|
|
348
|
+
}
|
|
349
|
+
const K = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map();
|
|
350
|
+
function We(r, e = "") {
|
|
351
|
+
if (r == null)
|
|
352
|
+
return null;
|
|
353
|
+
z(r, Ue, "wgsl");
|
|
354
|
+
const { vertex: t = xe, fragment: o } = r;
|
|
355
|
+
if (typeof o != "string" || !/@fragment\s+fn\s+fragmentMain\s*\(/.test(o))
|
|
356
|
+
throw new l("invalid-option", "[Nova3D] wgsl.fragment must declare @fragment fn fragmentMain.");
|
|
357
|
+
if (typeof t != "string" || !/@vertex\s+fn\s+vertexMain\s*\(/.test(t))
|
|
358
|
+
throw new l("invalid-option", "[Nova3D] wgsl.vertex must declare @vertex fn vertexMain.");
|
|
359
|
+
const n = `${t}\0${o}\0${e}`;
|
|
360
|
+
let i = L.get(n);
|
|
361
|
+
return i === void 0 && (i = String(L.size), L.set(n, i)), Object.freeze({ vertex: t, fragment: o, sourceKey: i });
|
|
362
|
+
}
|
|
363
|
+
const Ke = /^(?:nova|gl_)|^(?:modelMatrix|normalMatrix|viewMatrix|projectionMatrix|viewProjectionMatrix|cameraPosition)$/;
|
|
364
|
+
function ne(r, e, t) {
|
|
365
|
+
if (!/^[A-Z_]\w*$/i.test(r) || Ke.test(r))
|
|
366
|
+
throw new l("invalid-option", `[Nova3D] Invalid or reserved shader uniform name ${r}.`);
|
|
367
|
+
if (typeof e == "number") {
|
|
368
|
+
if (!Number.isFinite(e))
|
|
369
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${r} must be finite.`);
|
|
370
|
+
return e;
|
|
371
|
+
}
|
|
372
|
+
if (typeof e == "boolean")
|
|
373
|
+
return e;
|
|
374
|
+
if (Array.isArray(e) || e instanceof Float32Array) {
|
|
375
|
+
if (![2, 3, 4, 9, 16].includes(e.length) || !Array.from(e).every(Number.isFinite))
|
|
376
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${r} must be 2, 3, 4, 9 or 16 finite numbers.`);
|
|
377
|
+
return Float32Array.from(e);
|
|
378
|
+
}
|
|
379
|
+
if (e && typeof e == "object" && "owner" in e && "version" in e) {
|
|
380
|
+
const o = e;
|
|
381
|
+
if (o.destroyed || o.owner !== t)
|
|
382
|
+
throw new l("owner", `[Nova3D] Shader uniform ${r} texture must be live and belong to the same app.`);
|
|
383
|
+
return o;
|
|
384
|
+
}
|
|
385
|
+
throw new l("invalid-option", `[Nova3D] Unsupported value for shader uniform ${r}.`);
|
|
386
|
+
}
|
|
387
|
+
function B(r) {
|
|
388
|
+
return typeof r == "number" ? "float" : typeof r == "boolean" ? "bool" : r instanceof Float32Array || Array.isArray(r) ? `vec${r.length}` : `texture:${r._readSource().dimension}`;
|
|
389
|
+
}
|
|
390
|
+
const ie = { basic: 0, matcap: 1, normal: 2, depth: 3 }, Le = { pbr: 0, lambert: 1, phong: 2, toon: 3 }, G = P(17 / 255);
|
|
391
|
+
function U(r) {
|
|
392
|
+
return "shading" in r;
|
|
393
|
+
}
|
|
394
|
+
function Be(r) {
|
|
395
|
+
if (!Number.isFinite(r) || r < 0 || r > 65504)
|
|
396
|
+
throw new l("invalid-option", "[Nova3D] lightMapIntensity must be finite and nonnegative.");
|
|
397
|
+
return r;
|
|
398
|
+
}
|
|
399
|
+
function j(r, e) {
|
|
400
|
+
if (!Number.isFinite(r) || r < 0 || r > 1)
|
|
401
|
+
throw new l("invalid-option", `[Nova3D] ${e} must be normalized.`);
|
|
402
|
+
return r;
|
|
403
|
+
}
|
|
404
|
+
function ae(r, e, t) {
|
|
405
|
+
if (r.length !== e || !Array.from(r).every((o) => Number.isFinite(o) && o >= 0 && o <= t))
|
|
406
|
+
throw new l("invalid-option", "[Nova3D] Invalid linear color factor.");
|
|
407
|
+
return [...r];
|
|
408
|
+
}
|
|
409
|
+
function Ge(r, e) {
|
|
410
|
+
if (r == null)
|
|
411
|
+
return null;
|
|
412
|
+
if (typeof r == "object" && "texture" in r && !("_readSource" in r)) {
|
|
413
|
+
if (z(r, Ee, e), !r.texture || typeof r.texture._readSource != "function")
|
|
414
|
+
throw new l("invalid-option", `[Nova3D] ${e} must reference a texture.`);
|
|
415
|
+
return Object.freeze({ texture: r.texture, transform: D(r.transform) });
|
|
416
|
+
}
|
|
417
|
+
if (typeof r._readSource != "function")
|
|
418
|
+
throw new l("invalid-option", `[Nova3D] ${e} must be a texture or { texture, transform }.`);
|
|
419
|
+
return Object.freeze({ texture: r, transform: null });
|
|
420
|
+
}
|
|
421
|
+
function D(r) {
|
|
422
|
+
if (r == null)
|
|
423
|
+
return null;
|
|
424
|
+
z(r, Re, "texture transform");
|
|
425
|
+
const e = r.offset ?? [0, 0], t = r.scale ?? [1, 1], o = r.rotation ?? 0, n = r.texCoord ?? 0;
|
|
426
|
+
if (e.length !== 2 || t.length !== 2 || ![...e, ...t, o].every(Number.isFinite))
|
|
427
|
+
throw new l("invalid-option", "[Nova3D] Texture transform requires finite offset[2], scale[2] and rotation.");
|
|
428
|
+
if (n !== 0 && n !== 1)
|
|
429
|
+
throw new l("invalid-option", "[Nova3D] Texture transform texCoord must be 0 or 1.");
|
|
430
|
+
return n === 0 && ce(e, t, o) ? null : Object.freeze({ texCoord: n, offset: Object.freeze([e[0], e[1]]), rotation: o, scale: Object.freeze([t[0], t[1]]) });
|
|
431
|
+
}
|
|
432
|
+
function ce(r, e, t) {
|
|
433
|
+
return r[0] === 0 && r[1] === 0 && e[0] === 1 && e[1] === 1 && t === 0;
|
|
434
|
+
}
|
|
435
|
+
function q(r, e, t) {
|
|
436
|
+
const o = e * 9, n = t?.offset ?? [0, 0], i = t?.scale ?? [1, 1], s = Math.cos(t?.rotation ?? 0), c = Math.sin(t?.rotation ?? 0);
|
|
437
|
+
r[o] = s * i[0], r[o + 1] = -c * i[0], r[o + 2] = 0, r[o + 3] = c * i[1], r[o + 4] = s * i[1], r[o + 5] = 0, r[o + 6] = n[0], r[o + 7] = n[1], r[o + 8] = 1;
|
|
438
|
+
}
|
|
439
|
+
function V(r, e) {
|
|
440
|
+
const t = /* @__PURE__ */ new Set();
|
|
441
|
+
if (r.map && t.add(r.map), r.type === "shader")
|
|
442
|
+
for (const o of e ? e.values() : Object.values(r.uniforms))
|
|
443
|
+
typeof o == "object" && !Array.isArray(o) && !(o instanceof Float32Array) && t.add(o);
|
|
444
|
+
else if (!U(r))
|
|
445
|
+
r.matcap && t.add(r.matcap);
|
|
446
|
+
else {
|
|
447
|
+
for (const o of [r.metallicRoughnessMap, r.normalMap, r.occlusionMap, r.emissiveMap, r.lightMap])
|
|
448
|
+
o && t.add(o);
|
|
449
|
+
for (const o of $e(r.extensions))
|
|
450
|
+
t.add(o);
|
|
451
|
+
for (const o of r.nodes?.textures ?? [])
|
|
452
|
+
t.add(o);
|
|
453
|
+
}
|
|
454
|
+
return t;
|
|
455
|
+
}
|
|
456
|
+
function qe(r, e, t) {
|
|
457
|
+
const o = { opacity: r.opacity, side: r.side, alphaMode: r.alphaMode, alphaCutoff: r.alphaCutoff, blending: r.blending, depthTest: r.depthTest, alphaToCoverage: r.alphaToCoverage, ...r.depthWrite === "auto" ? {} : { depthWrite: r.depthWrite } };
|
|
458
|
+
if (r.type === "shader")
|
|
459
|
+
return { type: "shader", ...o, vertex: r.vertex, fragment: r.fragment, uniforms: { ...r.uniforms }, defines: { ...r.defines }, ...r.wgsl ? { wgsl: { vertex: r.wgsl.vertex, fragment: r.wgsl.fragment } } : {}, billboard: r.billboard };
|
|
460
|
+
if (r.type === "line")
|
|
461
|
+
return { type: "line", ...o, color: [...r.color], fog: r.fog, width: r.width, worldUnits: r.worldUnits, dashSize: r.dashSize, gapSize: r.gapSize, dashOffset: r.dashOffset };
|
|
462
|
+
if (r.type === "normal" || r.type === "depth")
|
|
463
|
+
return { type: r.type, ...o, pointSize: r.pointSize, sizeAttenuation: r.sizeAttenuation };
|
|
464
|
+
if (!U(r)) {
|
|
465
|
+
const i = { ...o, color: [...r.color], map: r.map, fog: r.fog, mapTransform: r.mapTransform, pointSize: r.pointSize, sizeAttenuation: r.sizeAttenuation, billboard: r.billboard, billboardRotation: r.billboardRotation, spriteSheet: r.spriteSheet };
|
|
466
|
+
return r.type === "matcap" ? { type: "matcap", ...i, matcap: r.matcap } : { type: "basic", ...i };
|
|
467
|
+
}
|
|
468
|
+
const n = { ...o, fog: r.fog, baseColorFactor: [...r.baseColorFactor], baseColorMap: r.baseColorMap, normalMap: r.normalMap, occlusionMap: r.occlusionMap, emissiveMap: r.emissiveMap, baseColorMapTransform: r.baseColorMapTransform, normalMapTransform: r.normalMapTransform, occlusionMapTransform: r.occlusionMapTransform, emissiveMapTransform: r.emissiveMapTransform, normalScale: r.normalScale, occlusionStrength: r.occlusionStrength, emissiveFactor: [...r.emissiveFactor], lightMap: r.lightMap, lightMapIntensity: r.lightMapIntensity, lightMapTransform: r.lightMapTransform };
|
|
469
|
+
return r.type === "pbr" ? { type: "pbr", ...n, ...ze(r.extensions), metallicFactor: r.metallicFactor, roughnessFactor: r.roughnessFactor, metallicRoughnessMap: r.metallicRoughnessMap, metallicRoughnessMapTransform: r.metallicRoughnessMapTransform, nodes: e } : r.type === "phong" ? { type: "phong", ...n, specularColor: t, shininess: r.shininess, specularMap: r.specularMap, specularMapTransform: r.specularMapTransform } : r.type === "toon" ? { type: "toon", ...n, gradientMap: r.gradientMap } : { type: "lambert", ...n };
|
|
470
|
+
}
|
|
471
|
+
const se = Object.freeze([17 / 255, 17 / 255, 17 / 255]);
|
|
472
|
+
let He = 1;
|
|
473
|
+
class ue {
|
|
474
|
+
/** @internal */
|
|
475
|
+
constructor(e, t, o = () => {
|
|
476
|
+
}) {
|
|
477
|
+
this._release = o, this.owner = e, this._options = this._validate(t), this._resetUniforms();
|
|
478
|
+
for (const n of V(this._options))
|
|
479
|
+
n._retain(this, () => this._changed());
|
|
480
|
+
}
|
|
481
|
+
/** Stable order of materials for opaque draw sorting. @internal */
|
|
482
|
+
_sortKey = He++;
|
|
483
|
+
_options;
|
|
484
|
+
/** Normalized options the state was built from (`getOptions`). */
|
|
485
|
+
_source;
|
|
486
|
+
_uniformValues = /* @__PURE__ */ new Map();
|
|
487
|
+
_uniformVersion = 0;
|
|
488
|
+
_uniformView = { values: this._uniformValues, version: 0 };
|
|
489
|
+
_users = /* @__PURE__ */ new Map();
|
|
490
|
+
_documentWrite;
|
|
491
|
+
_destroyed = !1;
|
|
492
|
+
_linear = [0, 0, 0, 0];
|
|
493
|
+
_linearSource;
|
|
494
|
+
/** Column-major 3×3 map transforms (basic: slot 0; PBR: base, metal-rough, normal, occlusion, emissive). */
|
|
495
|
+
_transforms = ue._createTransforms();
|
|
496
|
+
_transformSource;
|
|
497
|
+
_extensionLayout = Z;
|
|
498
|
+
_extensionSource;
|
|
499
|
+
_version = 1;
|
|
500
|
+
/** App that created this object (a model asset's own token until its first instantiate); checked when objects are combined. @internal */
|
|
501
|
+
owner;
|
|
502
|
+
/**
|
|
503
|
+
* Moves a resource created by a model asset into the app of its first instance.
|
|
504
|
+
* @internal
|
|
505
|
+
*/
|
|
506
|
+
_adopt(e, t) {
|
|
507
|
+
this.owner = e, this._release = t;
|
|
508
|
+
}
|
|
509
|
+
get version() {
|
|
510
|
+
return this._version;
|
|
511
|
+
}
|
|
512
|
+
get destroyed() {
|
|
513
|
+
return this._destroyed;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* The material's options with every default filled in: colours as normalized sRGB
|
|
517
|
+
* components, identity texture transforms as null, a shader's live uniform values.
|
|
518
|
+
* `depthWrite` is present only when it was set explicitly.
|
|
519
|
+
*/
|
|
520
|
+
getOptions() {
|
|
521
|
+
const e = this._source;
|
|
522
|
+
return e.type === "shader" ? { ...e, uniforms: Object.fromEntries(this._uniformValues) } : { ...e };
|
|
523
|
+
}
|
|
524
|
+
/** Patches the options of the material's type; `type` cannot change. */
|
|
525
|
+
set(e) {
|
|
526
|
+
if (this._documentWrite?.(), this._assertAlive(), e === null || typeof e != "object")
|
|
527
|
+
throw new l("invalid-option", "[Nova3D] Material patch must be an object.");
|
|
528
|
+
if (e.type !== void 0 && e.type !== this._options.type)
|
|
529
|
+
throw new l("invalid-option", "[Nova3D] Material kind is immutable; create a replacement material.");
|
|
530
|
+
const t = this._validate({ ...this.getOptions(), ...e }), o = V(this._options, this._uniformValues), n = V(t);
|
|
531
|
+
for (const i of n)
|
|
532
|
+
o.has(i) || i._retain(this, () => this._changed());
|
|
533
|
+
for (const i of o)
|
|
534
|
+
n.has(i) || i._releaseUser(this);
|
|
535
|
+
this._options = t, this._resetUniforms(), this._changed();
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Updates one declared uniform of a shader material without revalidating the
|
|
539
|
+
* material: the value keeps its kind (float, bool, vecN/matN or texture
|
|
540
|
+
* dimension).
|
|
541
|
+
* @experimental
|
|
542
|
+
*/
|
|
543
|
+
setUniform(e, t) {
|
|
544
|
+
if (this._documentWrite?.(), this._assertAlive(), this._options.type !== "shader")
|
|
545
|
+
throw new l("invalid-option", "[Nova3D] setUniform requires a shader material.");
|
|
546
|
+
const o = this._uniformValues.get(e);
|
|
547
|
+
if (o === void 0)
|
|
548
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${e} was not declared in the material options.`);
|
|
549
|
+
if (typeof t == "number" && typeof o == "number") {
|
|
550
|
+
if (!Number.isFinite(t))
|
|
551
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${e} must be finite.`);
|
|
552
|
+
t !== o && (this._uniformValues.set(e, t), this._uniformVersion++, this._changed());
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (o instanceof Float32Array && (Array.isArray(t) || t instanceof Float32Array) && t.length === o.length) {
|
|
556
|
+
let i = !1;
|
|
557
|
+
for (let s = 0; s < t.length; s++) {
|
|
558
|
+
const c = t[s];
|
|
559
|
+
if (typeof c != "number" || !Number.isFinite(c))
|
|
560
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${e} must be 2, 3, 4, 9 or 16 finite numbers.`);
|
|
561
|
+
i ||= Math.fround(c) !== o[s];
|
|
562
|
+
}
|
|
563
|
+
i && (o.set(t), this._uniformVersion++, this._changed());
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
const n = ne(e, t, this.owner);
|
|
567
|
+
if (B(n) !== B(o))
|
|
568
|
+
throw new l("invalid-option", `[Nova3D] Shader uniform ${e} must stay ${B(o)}.`);
|
|
569
|
+
n instanceof Float32Array && o instanceof Float32Array ? o.set(n) : (typeof o == "object" && !(o instanceof Float32Array) && ![...this._uniformValues].some(([s, c]) => s !== e && c === o) && o !== n && o._releaseUser(this), typeof n == "object" && !(n instanceof Float32Array) && n._retain(this, () => this._changed()), this._uniformValues.set(e, n)), this._uniformVersion++, this._changed();
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Live uniform values of a shader material and their revision.
|
|
573
|
+
* @internal
|
|
574
|
+
*/
|
|
575
|
+
_shaderUniforms() {
|
|
576
|
+
return this._uniformView.version = this._uniformVersion, this._uniformView;
|
|
577
|
+
}
|
|
578
|
+
_resetUniforms() {
|
|
579
|
+
if (this._uniformValues.clear(), this._options.type === "shader")
|
|
580
|
+
for (const [e, t] of Object.entries(this._options.uniforms))
|
|
581
|
+
this._uniformValues.set(e, t instanceof Float32Array ? t.slice() : t);
|
|
582
|
+
this._uniformVersion++;
|
|
583
|
+
}
|
|
584
|
+
destroy() {
|
|
585
|
+
if (!this._destroyed) {
|
|
586
|
+
if (this._documentWrite?.(), this._users.size > 0)
|
|
587
|
+
throw new l("state", "[Nova3D] Material is still referenced by a node.");
|
|
588
|
+
this._destroyed = !0, this._documentWrite = void 0;
|
|
589
|
+
for (const e of V(this._options, this._uniformValues))
|
|
590
|
+
e._releaseUser(this);
|
|
591
|
+
this._release();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* @internal
|
|
596
|
+
*/
|
|
597
|
+
_readOptions() {
|
|
598
|
+
return this._options;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Linear RGB and alpha × opacity of a basic material, cached per options snapshot.
|
|
602
|
+
* @internal
|
|
603
|
+
*/
|
|
604
|
+
_linearColor() {
|
|
605
|
+
if (this._linearSource !== this._options) {
|
|
606
|
+
const e = this._options.color;
|
|
607
|
+
this._linear[0] = P(e[0]), this._linear[1] = P(e[1]), this._linear[2] = P(e[2]), this._linear[3] = e[3] * this._options.opacity, this._linearSource = this._options;
|
|
608
|
+
}
|
|
609
|
+
return this._linear;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Map transform matrices, a bit mask of slots with a non-identity matrix and a
|
|
613
|
+
* bit mask of slots sampling the second UV set, cached per options snapshot.
|
|
614
|
+
* @internal
|
|
615
|
+
*/
|
|
616
|
+
_textureTransforms() {
|
|
617
|
+
const e = this._options, t = this._transforms;
|
|
618
|
+
if (this._transformSource !== e) {
|
|
619
|
+
const o = U(e) ? [e.baseColorMapTransform, e.metallicRoughnessMapTransform, e.normalMapTransform, e.occlusionMapTransform, e.emissiveMapTransform, e.lightMapTransform] : [e.mapTransform];
|
|
620
|
+
let n = 0, i = 0;
|
|
621
|
+
for (let s = 0; s < 6; s++) {
|
|
622
|
+
const c = o[s] ?? null;
|
|
623
|
+
q(t.matrices, s, c), c && !ce(c.offset, c.scale, c.rotation) && (n |= 1 << s), c?.texCoord === 1 && (i |= 1 << s);
|
|
624
|
+
}
|
|
625
|
+
t.mask = n, t.sets = i, this._transformSource = e;
|
|
626
|
+
}
|
|
627
|
+
return t;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Units, UV transforms and the interned variant signature of PBR extension maps,
|
|
631
|
+
* cached per options snapshot.
|
|
632
|
+
* @internal
|
|
633
|
+
*/
|
|
634
|
+
_extensions() {
|
|
635
|
+
const e = this._options;
|
|
636
|
+
return this._extensionSource !== e && (this._extensionLayout = U(e) ? te(e.extensions, q) : Z, this._extensionSource = e), this._extensionLayout;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* @internal
|
|
640
|
+
*/
|
|
641
|
+
_readColor() {
|
|
642
|
+
return this._options.color;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @internal
|
|
646
|
+
*/
|
|
647
|
+
_retain(e, t) {
|
|
648
|
+
this._assertAlive(), this._documentWrite?.(), this._users.set(e, t);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @internal
|
|
652
|
+
*/
|
|
653
|
+
_releaseUser(e) {
|
|
654
|
+
this._users.delete(e);
|
|
655
|
+
}
|
|
656
|
+
/** @internal */
|
|
657
|
+
_hasOtherUsers(e) {
|
|
658
|
+
return [...this._users.keys()].some((t) => !e.has(t));
|
|
659
|
+
}
|
|
660
|
+
/** @internal */
|
|
661
|
+
_assertDocumentUse() {
|
|
662
|
+
this._documentWrite?.();
|
|
663
|
+
}
|
|
664
|
+
/** @internal */
|
|
665
|
+
_guardDocument(e) {
|
|
666
|
+
if (this._documentWrite && this._documentWrite !== e)
|
|
667
|
+
throw new l("owner", "[Nova3D] Resource already has a document owner.");
|
|
668
|
+
this._documentWrite = e;
|
|
669
|
+
}
|
|
670
|
+
static _createTransforms() {
|
|
671
|
+
const e = new Float32Array(54);
|
|
672
|
+
return { matrices: e, slots: [0, 1, 2, 3, 4, 5].map((t) => e.subarray(t * 9, t * 9 + 9)), mask: 0, sets: 0 };
|
|
673
|
+
}
|
|
674
|
+
_assertAlive() {
|
|
675
|
+
if (this._destroyed)
|
|
676
|
+
throw new l("destroyed", "[Nova3D] Material is destroyed.");
|
|
677
|
+
}
|
|
678
|
+
_changed() {
|
|
679
|
+
this._version++;
|
|
680
|
+
for (const e of this._users.values())
|
|
681
|
+
e();
|
|
682
|
+
}
|
|
683
|
+
/** Validates options and records their normalized form as `_source`. */
|
|
684
|
+
_validate(e) {
|
|
685
|
+
if (e === null || typeof e != "object")
|
|
686
|
+
throw new l("invalid-option", "[Nova3D] Material options must be an object.");
|
|
687
|
+
const t = ke[e.type];
|
|
688
|
+
if (!t)
|
|
689
|
+
throw new l("invalid-option", "[Nova3D] Unsupported material kind.");
|
|
690
|
+
z(e, t, `${e.type} material`);
|
|
691
|
+
let o = se;
|
|
692
|
+
const n = this._state(e, (i) => (o = ye(i, se), i === void 0 ? [G, G, G] : ve(o)));
|
|
693
|
+
return this._source = qe(n, e.type === "pbr" ? e.nodes ?? null : null, o), n;
|
|
694
|
+
}
|
|
695
|
+
_state(e, t) {
|
|
696
|
+
const o = j(e.opacity ?? 1, "opacity"), n = e.side ?? "front", i = e.alphaMode ?? "opaque", s = j(e.alphaCutoff ?? 0.5, "alphaCutoff"), c = ("fog" in e ? e.fog : void 0) ?? !0;
|
|
697
|
+
if (!["front", "back", "double"].includes(n) || !["opaque", "mask", "blend"].includes(i) || typeof c != "boolean")
|
|
698
|
+
throw new l("invalid-option", "[Nova3D] Unsupported material option.");
|
|
699
|
+
const b = e.depthWrite ?? "auto", h = { blending: e.blending ?? "normal", depthTest: e.depthTest ?? !0, depthWrite: b, alphaToCoverage: e.alphaToCoverage ?? !1 };
|
|
700
|
+
if (!["normal", "additive", "multiply", "subtractive"].includes(h.blending) || typeof h.depthTest != "boolean" || b !== "auto" && typeof b != "boolean" || typeof h.alphaToCoverage != "boolean")
|
|
701
|
+
throw new l("invalid-option", "[Nova3D] Unsupported material render state.");
|
|
702
|
+
let a;
|
|
703
|
+
const d = "billboard" in e ? e.billboard ?? "none" : "none", p = "billboardRotation" in e ? e.billboardRotation ?? 0 : 0;
|
|
704
|
+
if (!["none", "spherical", "vertical"].includes(d) || !Number.isFinite(p))
|
|
705
|
+
throw new l("invalid-option", "[Nova3D] billboard must be none, spherical or vertical with a finite rotation.");
|
|
706
|
+
const u = "spriteSheet" in e ? Ie(e.spriteSheet) : null, m = "pointSize" in e ? e.pointSize ?? 1 : 1, y = "sizeAttenuation" in e ? e.sizeAttenuation ?? !1 : !1;
|
|
707
|
+
if (!Number.isFinite(m) || m <= 0 || m > 4096 || typeof y != "boolean")
|
|
708
|
+
throw new l("invalid-option", "[Nova3D] pointSize must be in (0, 4096] and sizeAttenuation boolean.");
|
|
709
|
+
if (e.type === "line") {
|
|
710
|
+
const f = e.width ?? 1, v = e.dashSize ?? 0, w = e.gapSize ?? 0, T = e.dashOffset ?? 0, N = e.worldUnits ?? !1;
|
|
711
|
+
if (!Number.isFinite(f) || f <= 0 || f > 65504 || ![v, w].every((_) => Number.isFinite(_) && _ >= 0) || !Number.isFinite(T) || typeof N != "boolean")
|
|
712
|
+
throw new l("invalid-option", "[Nova3D] Line width must be positive and dashes finite and nonnegative.");
|
|
713
|
+
a = { type: "line", width: f, worldUnits: N, dashSize: v, gapSize: w, dashOffset: T, color: X(e.color), map: null, matcap: null, opacity: o, side: n, alphaMode: i, alphaCutoff: s, ...h, fog: c, mapTransform: null, pointSize: m, sizeAttenuation: y, billboard: "none", billboardRotation: 0, spriteSheet: null };
|
|
714
|
+
} else if (e.type === "shader") {
|
|
715
|
+
const f = e.vertex ?? we, v = e.fragment;
|
|
716
|
+
if (typeof f != "string" || typeof v != "string" || !/\bmain\s*\(/.test(f) || !/\bmain\s*\(/.test(v))
|
|
717
|
+
throw new l("invalid-option", "[Nova3D] Shader material stages must be GLSL sources with main().");
|
|
718
|
+
const w = {};
|
|
719
|
+
for (const [x, S] of Object.entries(e.defines ?? {})) {
|
|
720
|
+
if (!/^[A-Z_]\w*$/i.test(x) || x.startsWith("NOVA_") || !["string", "number", "boolean"].includes(typeof S) || /[\n\r]/.test(String(S)))
|
|
721
|
+
throw new l("invalid-option", `[Nova3D] Invalid shader define ${x}.`);
|
|
722
|
+
w[x] = S;
|
|
723
|
+
}
|
|
724
|
+
const T = Object.entries(w).map(([x, S]) => S === !0 ? `#define ${x}` : S === !1 ? "" : `#define ${x} ${S}`).join(`
|
|
725
|
+
`), N = `${f}\0${v}\0${T}`;
|
|
726
|
+
let _ = K.get(N);
|
|
727
|
+
_ === void 0 && (_ = String(K.size), K.set(N, _));
|
|
728
|
+
const C = {};
|
|
729
|
+
for (const [x, S] of Object.entries(e.uniforms ?? {}))
|
|
730
|
+
C[x] = ne(x, S, this.owner);
|
|
731
|
+
const $ = We(e.wgsl, T);
|
|
732
|
+
a = { type: "shader", vertex: f, fragment: v, defines: Object.freeze(w), defineSource: T, sourceKey: _, uniforms: Object.freeze(C), wgsl: $, color: [1, 1, 1, 1], map: null, matcap: null, opacity: o, side: n, alphaMode: i, alphaCutoff: s, ...h, fog: !1, mapTransform: null, pointSize: m, sizeAttenuation: y, billboard: d, billboardRotation: p, spriteSheet: null };
|
|
733
|
+
} else if (e.type === "basic" || e.type === "matcap")
|
|
734
|
+
a = { type: e.type, shade: ie[e.type], color: X(e.color), map: e.map ?? null, matcap: e.type === "matcap" ? e.matcap ?? null : null, opacity: o, side: n, alphaMode: i, alphaCutoff: s, ...h, fog: c, mapTransform: D(e.mapTransform), pointSize: m, sizeAttenuation: y, billboard: d, billboardRotation: p, spriteSheet: u };
|
|
735
|
+
else if (e.type === "normal" || e.type === "depth")
|
|
736
|
+
a = { type: e.type, shade: ie[e.type], color: [1, 1, 1, 1], map: null, matcap: null, opacity: o, side: n, alphaMode: i, alphaCutoff: s, ...h, fog: !1, mapTransform: null, pointSize: m, sizeAttenuation: y, billboard: d, billboardRotation: p, spriteSheet: null };
|
|
737
|
+
else if (e.type === "pbr" || e.type === "lambert" || e.type === "phong" || e.type === "toon") {
|
|
738
|
+
const f = e.type === "pbr" ? e : null, v = e.type === "phong" ? e : null, w = e.type === "toon" ? e : null, T = t(v?.specularColor), N = v?.shininess ?? 30;
|
|
739
|
+
if (!Number.isFinite(N) || N < 0 || N > 65504)
|
|
740
|
+
throw new l("invalid-option", "[Nova3D] shininess must be finite and nonnegative.");
|
|
741
|
+
const _ = v?.specularMap ?? null, C = w?.gradientMap ?? null, $ = D(v?.specularMapTransform), x = f ? f.metallicRoughnessMap ?? null : _ ?? C, S = f ? D(f.metallicRoughnessMapTransform) : $, Q = ae(e.baseColorFactor ?? [1, 1, 1, 1], 4, 1), fe = ae(e.emissiveFactor ?? [0, 0, 0], 3, 65504), E = e.normalScale ?? 1;
|
|
742
|
+
if (!Number.isFinite(E) || E < 0)
|
|
743
|
+
throw new l("invalid-option", "[Nova3D] normalScale must be finite and nonnegative.");
|
|
744
|
+
const k = f ? Fe(f, Ge) : Y, I = f?.nodes ? he(f.nodes) : null;
|
|
745
|
+
if (a = { ...k, extensions: k, nodes: I, type: e.type, shading: Le[e.type], opacity: o, side: n, alphaMode: i, alphaCutoff: s, ...h, fog: c, color: Q, map: e.baseColorMap ?? null, baseColorFactor: Q, metallicFactor: f ? j(f.metallicFactor ?? 1, "metallicFactor") : 0, roughnessFactor: f ? j(f.roughnessFactor ?? 1, "roughnessFactor") : 1, baseColorMap: e.baseColorMap ?? null, metallicRoughnessMap: x, normalMap: e.normalMap ?? null, occlusionMap: e.occlusionMap ?? null, emissiveMap: e.emissiveMap ?? null, baseColorMapTransform: D(e.baseColorMapTransform), metallicRoughnessMapTransform: S, normalMapTransform: D(e.normalMapTransform), occlusionMapTransform: D(e.occlusionMapTransform), emissiveMapTransform: D(e.emissiveMapTransform), normalScale: E, occlusionStrength: j(e.occlusionStrength ?? 1, "occlusionStrength"), emissiveFactor: fe, lightMap: e.lightMap ?? null, lightMapIntensity: Be(e.lightMapIntensity ?? 1), lightMapTransform: D(e.lightMapTransform), specularColor: T, shininess: N, specularMap: _, specularMapTransform: $, gradientMap: C }, _ && C)
|
|
746
|
+
throw new l("invalid-option", "[Nova3D] A material has either a specular or a gradient map.");
|
|
747
|
+
for (const F of [_, a.normalMap, a.occlusionMap, f ? a.metallicRoughnessMap : null])
|
|
748
|
+
if (F && F._readSource().colorSpace !== "linear")
|
|
749
|
+
throw new l("invalid-option", "[Nova3D] PBR data maps require linear textures.");
|
|
750
|
+
const pe = te(k, q);
|
|
751
|
+
if (I && pe.units.length + I.textures.length > 4)
|
|
752
|
+
throw new l("invalid-option", "[Nova3D] Extension maps and node textures share 4 texture units.");
|
|
753
|
+
J(k).forEach((F, me) => {
|
|
754
|
+
if (F && !je(me) && F.texture._readSource().colorSpace !== "linear")
|
|
755
|
+
throw new l("invalid-option", "[Nova3D] PBR extension data maps require linear textures.");
|
|
756
|
+
});
|
|
757
|
+
} else
|
|
758
|
+
throw new l("invalid-option", "[Nova3D] Unsupported material kind.");
|
|
759
|
+
for (const f of V(a)) {
|
|
760
|
+
if (f._assertDocumentUse(), f.destroyed || f.owner !== this.owner)
|
|
761
|
+
throw new l("owner", "[Nova3D] Material texture must be live and belong to the same app.");
|
|
762
|
+
if (a.type !== "shader" && f._readSource().dimension !== "2d")
|
|
763
|
+
throw new l("invalid-option", "[Nova3D] Built-in material maps require 2D textures; arrays and volumes need a shader material.");
|
|
764
|
+
}
|
|
765
|
+
return a;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
export {
|
|
769
|
+
ue as N,
|
|
770
|
+
rr as S,
|
|
771
|
+
le as a,
|
|
772
|
+
Z as b,
|
|
773
|
+
Y as d,
|
|
774
|
+
or as e,
|
|
775
|
+
tr as f,
|
|
776
|
+
U as l
|
|
777
|
+
};
|