@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,41 @@
|
|
|
1
|
+
import { Nova3DGeometry } from '../model/Geometry.js';
|
|
2
|
+
import { BasicVariant3D } from '../services/BasicShader.js';
|
|
3
|
+
/** Attribute bit: per-vertex attributes step per instance (one quad of six vertices per point). */
|
|
4
|
+
export declare const pointAttributes3D = 512;
|
|
5
|
+
/** Vertex attributes of a point variant: position, normal (matcap and normal shades), colour. */
|
|
6
|
+
export declare function pointVariantAttributes3D(variant: BasicVariant3D): number;
|
|
7
|
+
/**
|
|
8
|
+
* WGSL of a point-primitive basic variant. WebGPU rasterizes 1-pixel points
|
|
9
|
+
* only, so each point is a screen-aligned quad of `gl_PointSize` device pixels
|
|
10
|
+
* built from the vertex index; the map reads the quad coordinate as
|
|
11
|
+
* BasicShader.ts reads gl_PointCoord (v = 0 at the bottom). Sizes follow the
|
|
12
|
+
* WebGL program: pointSize × pixel ratio, attenuated by half the view height in
|
|
13
|
+
* CSS pixels over the clip w for perspective views, at least one pixel.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pointsShaderSource3D(variant: BasicVariant3D): string;
|
|
16
|
+
/** Point attributes gathered through the index buffer over the draw range. */
|
|
17
|
+
export interface FlatPoints3D {
|
|
18
|
+
positions: GPUBuffer;
|
|
19
|
+
normals?: GPUBuffer;
|
|
20
|
+
colors?: GPUBuffer;
|
|
21
|
+
version: number;
|
|
22
|
+
start: number;
|
|
23
|
+
count: number;
|
|
24
|
+
bytes: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Indexed point geometry: instance-stepped attributes cannot follow an index
|
|
28
|
+
* buffer, so the indexed draw range is gathered once per geometry revision.
|
|
29
|
+
*/
|
|
30
|
+
export declare class WebGPUPoints3D {
|
|
31
|
+
private readonly _device;
|
|
32
|
+
private readonly _flat;
|
|
33
|
+
bytes: number;
|
|
34
|
+
uploads: number;
|
|
35
|
+
constructor(_device: GPUDevice);
|
|
36
|
+
/** The gathered attributes of an indexed point geometry, rebuilt when it or its draw range changed. */
|
|
37
|
+
ensure(geometry: Nova3DGeometry): FlatPoints3D;
|
|
38
|
+
get(geometry: Nova3DGeometry): FlatPoints3D;
|
|
39
|
+
release(geometry: Nova3DGeometry): void;
|
|
40
|
+
reset(lost: boolean): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Nova3DReflectionProbe } from '../model/ReflectionProbe.js';
|
|
2
|
+
import { CubeFilter3D, CubeMipPass3D } from './Environment.js';
|
|
3
|
+
/** A captured probe: the face cube, its prefiltered cubes and the influence box of this frame. */
|
|
4
|
+
export interface ProbeResident3D {
|
|
5
|
+
readonly probe: Nova3DReflectionProbe;
|
|
6
|
+
readonly size: number;
|
|
7
|
+
readonly cube: GPUTexture;
|
|
8
|
+
readonly faces: readonly GPUTextureView[];
|
|
9
|
+
readonly depth: GPUTexture;
|
|
10
|
+
readonly depthView: GPUTextureView;
|
|
11
|
+
readonly diffuse: GPUTexture;
|
|
12
|
+
readonly specular: GPUTexture;
|
|
13
|
+
readonly diffuseView: GPUTextureView;
|
|
14
|
+
readonly specularView: GPUTextureView;
|
|
15
|
+
readonly prefilterGroup: GPUBindGroup;
|
|
16
|
+
/** Passes that rebuild the capture's mip chain before prefiltering. */
|
|
17
|
+
readonly mips: readonly CubeMipPass3D[];
|
|
18
|
+
readonly center: Float32Array;
|
|
19
|
+
readonly min: Float32Array;
|
|
20
|
+
readonly max: Float32Array;
|
|
21
|
+
readonly bytes: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reflection probes of the WebGPU renderer (WebGLRenderer._captureProbe): the
|
|
25
|
+
* renderer draws the scene into six RGBA16F cube faces, then this class
|
|
26
|
+
* prefilters them into the irradiance and roughness cubes of the PBR shader.
|
|
27
|
+
*/
|
|
28
|
+
export declare class WebGPUProbes3D {
|
|
29
|
+
private readonly _device;
|
|
30
|
+
private readonly _filter;
|
|
31
|
+
private readonly _residents;
|
|
32
|
+
/** Prefilter passes encoded since the last consume. */
|
|
33
|
+
passes: number;
|
|
34
|
+
constructor(_device: GPUDevice, _filter: CubeFilter3D);
|
|
35
|
+
get bytes(): number;
|
|
36
|
+
get(probe: Nova3DReflectionProbe): ProbeResident3D | undefined;
|
|
37
|
+
/** The probe's textures, allocated on first use (capture resolution changes reallocate). */
|
|
38
|
+
ensure(probe: Nova3DReflectionProbe): ProbeResident3D;
|
|
39
|
+
/** Encodes the capture's mip chain and the irradiance and roughness passes of a captured probe. */
|
|
40
|
+
prefilter(encoder: GPUCommandEncoder, resident: ProbeResident3D): void;
|
|
41
|
+
/** Releases probes that were destroyed. */
|
|
42
|
+
sweep(): void;
|
|
43
|
+
release(probe: Nova3DReflectionProbe): void;
|
|
44
|
+
reset(lost: boolean): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WGSL ports of the GLSL chunks shared by every WebGL program: tone mapping
|
|
3
|
+
* (three.js r186 operators), sRGB encoding and scene fog. The formulas match
|
|
4
|
+
* ToneMapping.ts and FogShader.ts term for term.
|
|
5
|
+
*/
|
|
6
|
+
export declare const toneMappingWGSL3D = "\nfn novaRRTAndODTFit(v: vec3f) -> vec3f {\n let a = v * (v + 0.0245786) - 0.000090537;\n let b = v * (0.983729 * v + 0.4329510) + 0.238081;\n return a / b;\n}\nfn novaAgXContrast(x: vec3f) -> vec3f {\n let x2 = x * x;\n let x4 = x2 * x2;\n return 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232;\n}\nfn novaToneMap(input: vec3f, exposure: f32, mode: i32) -> vec3f {\n var color = max(input, vec3f(0.0)) * exposure;\n if (mode == 1) {\n color = color / (vec3f(1.0) + color);\n }\n else if (mode == 2) {\n color = max(vec3f(0.0), color - 0.004);\n color = pow((color * (6.2 * color + 0.5)) / (color * (6.2 * color + 1.7) + 0.06), vec3f(2.2));\n }\n else if (mode == 3) {\n let inputMat = mat3x3f(vec3f(0.59719, 0.07600, 0.02840), vec3f(0.35458, 0.90834, 0.13383), vec3f(0.04823, 0.01566, 0.83777));\n let outputMat = mat3x3f(vec3f(1.60475, -0.10208, -0.00327), vec3f(-0.53108, 1.10813, -0.07276), vec3f(-0.07367, -0.00605, 1.07602));\n color = outputMat * novaRRTAndODTFit(inputMat * (color / 0.6));\n }\n else if (mode == 4) {\n let toRec2020 = mat3x3f(vec3f(0.6274, 0.0691, 0.0164), vec3f(0.3293, 0.9195, 0.0880), vec3f(0.0433, 0.0113, 0.8956));\n let fromRec2020 = mat3x3f(vec3f(1.6605, -0.1246, -0.0182), vec3f(-0.5876, 1.1329, -0.1006), vec3f(-0.0728, -0.0083, 1.1187));\n let inset = mat3x3f(vec3f(0.856627153315983, 0.137318972929847, 0.11189821299995), vec3f(0.0951212405381588, 0.761241990602591, 0.0767994186031903), vec3f(0.0482516061458583, 0.101439036467562, 0.811302368396859));\n let outset = mat3x3f(vec3f(1.1271005818144368, -0.1413297634984383, -0.14132976349843826), vec3f(-0.11060664309660323, 1.157823702216272, -0.11060664309660294), vec3f(-0.016493938717834573, -0.016493938717834257, 1.2519364065950405));\n color = inset * (toRec2020 * color);\n color = clamp((log2(max(color, vec3f(1e-10))) + 12.47393) / (4.026069 + 12.47393), vec3f(0.0), vec3f(1.0));\n color = outset * novaAgXContrast(color);\n color = fromRec2020 * pow(max(vec3f(0.0), color), vec3f(2.2));\n }\n else if (mode == 5) {\n let x = min(color.r, min(color.g, color.b));\n color = color - select(0.04, x - 6.25 * x * x, x < 0.08);\n let peak = max(color.r, max(color.g, color.b));\n if (peak >= 0.76) {\n let d = 0.24;\n let newPeak = 1.0 - d * d / (peak + d - 0.76);\n color = color * (newPeak / peak);\n color = mix(color, vec3f(newPeak), 1.0 - 1.0 / (0.15 * (peak - newPeak) + 1.0));\n }\n }\n return clamp(color, vec3f(0.0), vec3f(1.0));\n}\nfn novaEncodeSRGB(linear: vec3f) -> vec3f {\n return mix(12.92 * linear, 1.055 * pow(linear, vec3f(1.0 / 2.4)) - 0.055, step(vec3f(0.0031308), linear));\n}\n";
|
|
7
|
+
/** `novaFog(color, depth)` for fog mode 1 linear, 2 exp, 3 exp2 (FogShader.ts). */
|
|
8
|
+
export declare function fogWGSL3D(mode: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* Clip position from a world position: WebGL clip space with y flipped for
|
|
11
|
+
* render targets and z mapped from [−w, w] to WebGPU's [0, w], so depth
|
|
12
|
+
* values equal WebGL window depth.
|
|
13
|
+
*/
|
|
14
|
+
export declare const clipWGSL3D = "\nfn novaClip(world: vec4f) -> vec4f {\n var clip = view.viewProjection * world;\n clip.y = clip.y * view.flipY;\n clip.z = 0.5 * (clip.z + clip.w);\n return clip;\n}\n";
|
|
15
|
+
/** Bindings of group 0 shared by every scene pipeline. */
|
|
16
|
+
export declare const viewBindingsWGSL3D = "\n@group(0) @binding(0) var<uniform> view: View;\n@group(0) @binding(1) var shadowAtlas: texture_depth_2d;\n@group(0) @binding(2) var shadowSampler: sampler_comparison;\n@group(0) @binding(3) var diffuseEnvironment: texture_cube<f32>;\n@group(0) @binding(4) var specularEnvironment: texture_cube<f32>;\n@group(0) @binding(5) var environmentSampler: sampler;\n";
|
|
17
|
+
/** Full-screen triangle vertex positions in normalized device coordinates. */
|
|
18
|
+
export declare const fullscreenWGSL3D = "\nfn novaFullscreen(index: u32) -> vec2f {\n return vec2f(f32((index << 1u) & 2u), f32(index & 2u)) * 2.0 - 1.0;\n}\n";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ShaderMaterialState3D, ShaderUniformValue3D } from '../model/Material.js';
|
|
2
|
+
import { Nova3DTexture } from '../model/Texture.js';
|
|
3
|
+
import { UniformLayout3D } from './UniformLayout.js';
|
|
4
|
+
/** Variant bits of a WGSL shader material that change the generated prelude. */
|
|
5
|
+
export interface ShaderMaterialVariant3D {
|
|
6
|
+
instanced: boolean;
|
|
7
|
+
/** 0 opaque, 1 mask, 2 blend. */
|
|
8
|
+
mode: 0 | 1 | 2;
|
|
9
|
+
coverage: boolean;
|
|
10
|
+
}
|
|
11
|
+
type UniformValues3D = ReadonlyMap<string, ShaderUniformValue3D>;
|
|
12
|
+
/** Uniform block and texture names of a material's uniform values (declaration order). */
|
|
13
|
+
export declare function shaderMaterialShape3D(values: UniformValues3D): {
|
|
14
|
+
layout: UniformLayout3D;
|
|
15
|
+
textures: string[];
|
|
16
|
+
key: string;
|
|
17
|
+
};
|
|
18
|
+
/** The prelude every WGSL shader-material module starts with. */
|
|
19
|
+
export declare function shaderMaterialPrelude3D(options: Readonly<ShaderMaterialState3D>, layout: UniformLayout3D, textures: readonly string[], variant: ShaderMaterialVariant3D): string;
|
|
20
|
+
/**
|
|
21
|
+
* WGSL shader materials of the WebGPU renderer (ShaderPrograms3D for WebGL):
|
|
22
|
+
* modules per source, uniform shape and variant; pipelines per vertex-buffer
|
|
23
|
+
* presence and render state; one uniform block and bind group per material,
|
|
24
|
+
* rewritten when its uniform revision changes.
|
|
25
|
+
*/
|
|
26
|
+
export declare class WebGPUShaderMaterials3D {
|
|
27
|
+
private readonly _device;
|
|
28
|
+
private readonly _groups;
|
|
29
|
+
private readonly _programs;
|
|
30
|
+
private readonly _layouts;
|
|
31
|
+
private _residents;
|
|
32
|
+
/** A vec4 (0, 0, 0, 1) that missing attributes read with stride 0. */
|
|
33
|
+
readonly defaults: GPUBuffer;
|
|
34
|
+
uploads: number;
|
|
35
|
+
constructor(_device: GPUDevice, _groups: {
|
|
36
|
+
view: GPUBindGroupLayout;
|
|
37
|
+
object: GPUBindGroupLayout;
|
|
38
|
+
scene: GPUBindGroupLayout;
|
|
39
|
+
});
|
|
40
|
+
/** Group 1 and pipeline layouts for `textures` material textures. */
|
|
41
|
+
layouts(textures: number): {
|
|
42
|
+
group: GPUBindGroupLayout;
|
|
43
|
+
pipeline: GPUPipelineLayout;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Uniform block and bind group of a material, refreshed when its options or
|
|
47
|
+
* uniform revision change; `view`/`sampler` resolve textures.
|
|
48
|
+
*/
|
|
49
|
+
bindGroup(material: object, options: Readonly<ShaderMaterialState3D>, values: UniformValues3D, version: number, view: (texture: Nova3DTexture) => GPUTextureView, sampler: (texture: Nova3DTexture) => GPUSampler): GPUBindGroup;
|
|
50
|
+
/**
|
|
51
|
+
* Pipeline of a material for vertex attributes `present` (bit 0 position,
|
|
52
|
+
* 1 normal, 2 uv, 3 colour, 4 uv1) and a render-state descriptor.
|
|
53
|
+
*/
|
|
54
|
+
pipeline(material: object, options: Readonly<ShaderMaterialState3D>, variant: ShaderMaterialVariant3D, present: number, stateKey: number, describe: (layout: GPUPipelineLayout, module: GPUShaderModule, buffers: GPUVertexBufferLayout[]) => GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
55
|
+
reset(lost: boolean): void;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default WGSL vertex stage of shader materials: world position, normal and the
|
|
3
|
+
* first UV set for the fragment stage, which receives them as `NovaVaryings`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultShaderVertexWGSL3D = "struct NovaVaryings {\n @builtin(position) position: vec4f,\n @location(0) worldPosition: vec3f,\n @location(1) worldNormal: vec3f,\n @location(2) uv: vec2f,\n}\n@vertex\nfn vertexMain(input: NovaVertexInput) -> NovaVaryings {\n var out: NovaVaryings;\n let world = novaWorldPosition(input, input.position);\n out.worldPosition = world.xyz;\n out.worldNormal = novaWorldNormal(input, input.normal);\n out.uv = input.uv;\n out.position = novaClip(world);\n return out;\n}";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mat4 as Matrix4 } from 'gl-matrix';
|
|
2
|
+
import { Nova3DLight } from '../model/Light.js';
|
|
3
|
+
import { ShadowCamera3D } from '../services/ShadowMaps.js';
|
|
4
|
+
/** One shadow source in the atlas, as ShadowBinding3D of the WebGL renderer. */
|
|
5
|
+
export interface ShadowTile3D {
|
|
6
|
+
readonly light: Nova3DLight;
|
|
7
|
+
readonly cube: boolean;
|
|
8
|
+
/** View-projection per face or cascade (WebGL clip conventions). */
|
|
9
|
+
readonly matrices: Matrix4[];
|
|
10
|
+
readonly resolution: number;
|
|
11
|
+
readonly cascades: number;
|
|
12
|
+
readonly width: number;
|
|
13
|
+
readonly height: number;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
readonly splits: Float32Array;
|
|
17
|
+
readonly frustums: Float32Array;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The shadow atlas of ShadowMaps.ts on WebGPU: four sources per scene in one
|
|
21
|
+
* depth32float atlas of at most 4096², the same shelf packing, face layout and
|
|
22
|
+
* light matrices. Tiles are drawn with clip y flipped, so texel rows and the
|
|
23
|
+
* lookups in the lit shader match the WebGL atlas exactly.
|
|
24
|
+
*/
|
|
25
|
+
export declare class WebGPUShadows3D {
|
|
26
|
+
private readonly _device;
|
|
27
|
+
private readonly _residents;
|
|
28
|
+
private readonly _selected;
|
|
29
|
+
private _bindings;
|
|
30
|
+
texture: GPUTexture | null;
|
|
31
|
+
view: GPUTextureView | null;
|
|
32
|
+
size: number;
|
|
33
|
+
/** Advances when the atlas texture is replaced. */
|
|
34
|
+
epoch: number;
|
|
35
|
+
constructor(_device: GPUDevice);
|
|
36
|
+
get bytes(): number;
|
|
37
|
+
get active(): boolean;
|
|
38
|
+
activeFor(scene: object): boolean;
|
|
39
|
+
/** Keeps tiles for exactly the enabled shadows of `lights` and repacks when that set changed. */
|
|
40
|
+
reserve(lights: readonly Nova3DLight[]): void;
|
|
41
|
+
/** Validates a scene's shadowed lights and fits their matrices; returns its tiles in slot order. */
|
|
42
|
+
prepare(scene: object, lights: readonly Nova3DLight[], camera?: ShadowCamera3D): readonly ShadowTile3D[];
|
|
43
|
+
release(light: Nova3DLight): void;
|
|
44
|
+
reset(lost: boolean): void;
|
|
45
|
+
private _free;
|
|
46
|
+
private _pack;
|
|
47
|
+
private _matrices;
|
|
48
|
+
private _fitCascades;
|
|
49
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Nova3DMesh } from '../model/Mesh.js';
|
|
2
|
+
/** Splat block (group 1): covariance scale, SH scale and offset, largest axis; viewport; opacity; texels per layer. */
|
|
3
|
+
export declare const splatLayout3D: import('./UniformLayout.js').UniformLayout3D;
|
|
4
|
+
/** Compile-time options of a splat shader: the SplatShader.ts defines. */
|
|
5
|
+
export interface SplatVariant3D {
|
|
6
|
+
readonly degree: number;
|
|
7
|
+
/** SH texels evaluated (SPLAT_SH_TEXELS). */
|
|
8
|
+
readonly texels: number;
|
|
9
|
+
readonly srgb: boolean;
|
|
10
|
+
readonly antialias: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** True for the procedural splat meshes of `@nova-lab/core/3d/splats`. */
|
|
13
|
+
export declare function isSplatMesh3D(node: Nova3DMesh): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* WGSL of the splat vertex and fragment stages (SplatShader.ts term for term):
|
|
16
|
+
* the packed RGBA8 texels of the data texture and the sorted order are read as
|
|
17
|
+
* storage-buffer words (one word per texel), instance = sorted slot and the
|
|
18
|
+
* quad corner from the vertex index; output is premultiplied as novaOutput blends.
|
|
19
|
+
*/
|
|
20
|
+
export declare function splatShaderSource3D(variant: SplatVariant3D): string;
|
|
21
|
+
/** Builds a scene pipeline descriptor for a layout, module and state key (no vertex buffers). */
|
|
22
|
+
export type SplatPipelineDescriptor3D = (layout: GPUPipelineLayout, module: GPUShaderModule, stateKey: number) => GPURenderPipelineDescriptor;
|
|
23
|
+
/**
|
|
24
|
+
* Gaussian splats on WebGPU: the packed data texture and the sorted order
|
|
25
|
+
* texture of a splat mesh mirrored into storage buffers (the order re-uploads
|
|
26
|
+
* only its dirty rows after each sort), a uniform block per mesh and pipelines
|
|
27
|
+
* per shader variant and state. Sorting stays on the CPU worker.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WebGPUSplats3D {
|
|
30
|
+
private readonly _device;
|
|
31
|
+
readonly layout: GPUBindGroupLayout;
|
|
32
|
+
private readonly _meshes;
|
|
33
|
+
private readonly _shaders;
|
|
34
|
+
private _pipelineLayout?;
|
|
35
|
+
bytes: number;
|
|
36
|
+
uploads: number;
|
|
37
|
+
constructor(_device: GPUDevice);
|
|
38
|
+
/** Uploads the splat data once, the order after each sort and the uniform block when the material changed. */
|
|
39
|
+
prepare(node: Nova3DMesh): void;
|
|
40
|
+
/** Draws a prepared splat mesh; groups 0 and 2 are bound by the caller. */
|
|
41
|
+
draw(pass: GPURenderPassEncoder, node: Nova3DMesh, stateKey: number, view: GPUBindGroupLayout, object: GPUBindGroupLayout, descriptor: SplatPipelineDescriptor3D): void;
|
|
42
|
+
releaseNode(node: Nova3DMesh): void;
|
|
43
|
+
reset(lost: boolean): void;
|
|
44
|
+
private _create;
|
|
45
|
+
/** Copies the texture's pending rows (all of them first) into its storage mirror. */
|
|
46
|
+
private _refresh;
|
|
47
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Nova3DTexture, TextureOptions3D } from '../model/Texture.js';
|
|
2
|
+
/** GPU copy of one texture source. */
|
|
3
|
+
export interface TextureResident3D {
|
|
4
|
+
readonly texture: GPUTexture;
|
|
5
|
+
readonly view: GPUTextureView;
|
|
6
|
+
readonly version: number;
|
|
7
|
+
/** Uploaded content revision; −1 while an image source is not decodable yet. */
|
|
8
|
+
content: number;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
readonly bytes: number;
|
|
12
|
+
readonly levels: number;
|
|
13
|
+
readonly format: GPUTextureFormat;
|
|
14
|
+
}
|
|
15
|
+
/** IEEE half-float bits of `value`, rounded to nearest even, as RGBA16F uploads convert. */
|
|
16
|
+
export declare function halfFloatBits3D(value: number): number;
|
|
17
|
+
/** Sampler descriptor key: filters, mip filter, base-level clamp, wraps and anisotropy. */
|
|
18
|
+
export declare function samplerKey3D(options: Pick<Required<TextureOptions3D>, 'minFilter' | 'magFilter' | 'wrapS' | 'wrapT' | 'anisotropy'>): number;
|
|
19
|
+
/**
|
|
20
|
+
* Texture residency of one device: uploads, partial updates, image sources,
|
|
21
|
+
* mip generation and the sampler cache.
|
|
22
|
+
*/
|
|
23
|
+
export declare class WebGPUTextures3D {
|
|
24
|
+
private readonly _device;
|
|
25
|
+
private readonly _residents;
|
|
26
|
+
private readonly _samplers;
|
|
27
|
+
private readonly _mipPipelines;
|
|
28
|
+
private _mipSampler?;
|
|
29
|
+
private _mipModule?;
|
|
30
|
+
private _white?;
|
|
31
|
+
private _bytes;
|
|
32
|
+
/** Advances whenever a resident GPU texture is created or replaced. */
|
|
33
|
+
epoch: number;
|
|
34
|
+
uploads: number;
|
|
35
|
+
constructor(_device: GPUDevice);
|
|
36
|
+
get count(): number;
|
|
37
|
+
get bytes(): number;
|
|
38
|
+
sampler(options: Pick<Required<TextureOptions3D>, 'minFilter' | 'magFilter' | 'wrapS' | 'wrapT' | 'anisotropy'>): GPUSampler;
|
|
39
|
+
/** A 1×1 white RGBA8 texture for absent optional maps. */
|
|
40
|
+
white(): GPUTextureView;
|
|
41
|
+
/** Uploads or refreshes the GPU copy of a CPU or image texture (not a render-target texture). */
|
|
42
|
+
ensure(texture: Nova3DTexture): TextureResident3D;
|
|
43
|
+
release(texture: Nova3DTexture): void;
|
|
44
|
+
/** Drops every resident; `lost` skips destroy calls on objects of a lost device. */
|
|
45
|
+
reset(lost: boolean): void;
|
|
46
|
+
/** Re-uploads changed pixels into the existing storage; false when it must be reallocated. */
|
|
47
|
+
private _refresh;
|
|
48
|
+
private _copyImage;
|
|
49
|
+
private _writeData;
|
|
50
|
+
/** Fills levels 1… by rendering each level from the one above (linear-space for sRGB formats). */
|
|
51
|
+
private _generateMipmaps;
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KHR_materials_transmission backdrop (WebGLRenderer._grabTransmission): after a
|
|
3
|
+
* view's opaque meshes the attachment is copied into a mipmapped RGBA16F
|
|
4
|
+
* texture of the framebuffer size, which transmissive meshes sample with a
|
|
5
|
+
* roughness-dependent level. Copies of unused sizes are released after a while.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebGPUTransmission3D {
|
|
8
|
+
private readonly _device;
|
|
9
|
+
private readonly _copies;
|
|
10
|
+
private _copyPipeline?;
|
|
11
|
+
private _mipPipeline?;
|
|
12
|
+
private _sampler?;
|
|
13
|
+
private _sources;
|
|
14
|
+
private readonly _attachment;
|
|
15
|
+
private readonly _pass;
|
|
16
|
+
private _frame;
|
|
17
|
+
/** Passes encoded since the last consume. */
|
|
18
|
+
passes: number;
|
|
19
|
+
constructor(_device: GPUDevice);
|
|
20
|
+
get bytes(): number;
|
|
21
|
+
/** The sampled copy of a framebuffer size, created on first use. */
|
|
22
|
+
view(width: number, height: number): GPUTextureView;
|
|
23
|
+
/** Copies `source` (a single-sampled attachment of the given size) and filters its mip chain. */
|
|
24
|
+
grab(encoder: GPUCommandEncoder, source: GPUTextureView, width: number, height: number): void;
|
|
25
|
+
/** Ends a frame: copies unused for a while are released. */
|
|
26
|
+
endFrame(): void;
|
|
27
|
+
reset(lost: boolean): void;
|
|
28
|
+
private _copy;
|
|
29
|
+
private _ensurePipelines;
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** WGSL host-shareable types used in Nova uniform blocks. */
|
|
2
|
+
export type UniformType3D = 'f32' | 'i32' | 'u32' | 'vec2f' | 'vec3f' | 'vec4f' | 'mat3x3f' | 'mat4x4f';
|
|
3
|
+
/** Field name, type and optional array length. */
|
|
4
|
+
export type UniformField3D = readonly [name: string, type: UniformType3D, count?: number];
|
|
5
|
+
/**
|
|
6
|
+
* Byte offsets of a uniform struct laid out by the WGSL rules for the uniform
|
|
7
|
+
* address space, plus its WGSL declaration: the shader and the host writer
|
|
8
|
+
* share one definition, so they cannot disagree.
|
|
9
|
+
*/
|
|
10
|
+
export interface UniformLayout3D {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
/** Struct size in bytes, a multiple of 16. */
|
|
13
|
+
readonly size: number;
|
|
14
|
+
/** Byte offset of each field. */
|
|
15
|
+
readonly offsets: Readonly<Record<string, number>>;
|
|
16
|
+
/** Byte stride of array fields. */
|
|
17
|
+
readonly strides: Readonly<Record<string, number>>;
|
|
18
|
+
readonly wgsl: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Lays out `fields` in order. Arrays in the uniform address space need a
|
|
22
|
+
* 16-byte multiple element stride, so arrays of scalars and vec2 are rejected.
|
|
23
|
+
*/
|
|
24
|
+
export declare function uniformLayout3D(name: string, fields: readonly UniformField3D[]): UniformLayout3D;
|
|
25
|
+
/** Float index (byte offset / 4) of every field, for writes into a Float32Array. */
|
|
26
|
+
export declare function floatOffsets3D(layout: UniformLayout3D): Readonly<Record<string, number>>;
|
|
27
|
+
/** Writes a column-major 3×3 matrix as three 16-byte columns. */
|
|
28
|
+
export declare function writeMat3x3(out: Float32Array, index: number, matrix: ArrayLike<number>): void;
|
|
29
|
+
/** Writes a column-major 4×4 matrix. */
|
|
30
|
+
export declare function writeMat4x4(out: Float32Array, index: number, matrix: ArrayLike<number>): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shadow caster (ShadowMaps.ts): depth only, instance parity culling and
|
|
3
|
+
* alpha-mask discards. `uvSet` is 0 without a masked map, 1 for uv, 2 for uv1.
|
|
4
|
+
* Atlas tiles are written with clip y flipped, so the atlas has the WebGL row order.
|
|
5
|
+
*/
|
|
6
|
+
export declare function casterShaderSource3D(instanced: boolean, uvSet: 0 | 1 | 2): string;
|
|
7
|
+
/**
|
|
8
|
+
* Environment background (Background.ts): 0 equirect sky, 1 blurred specular
|
|
9
|
+
* cube, 2 screen-filling 2D texture. Drawn at the far plane without depth access.
|
|
10
|
+
*/
|
|
11
|
+
export declare function backgroundShaderSource3D(mode: 0 | 1 | 2): string;
|
|
12
|
+
/** Display pass: linear premultiplied target to sRGB canvas with exposure and tone mapping. */
|
|
13
|
+
export declare const displayShaderSource3D: string;
|
|
14
|
+
/** Clears a view rectangle: colour from the view block, depth 1 at the far plane. */
|
|
15
|
+
export declare const clearShaderSource3D: string;
|
|
16
|
+
/**
|
|
17
|
+
* Equirect to cube face (EnvironmentMaps.ts mode 2): four taps per texel so
|
|
18
|
+
* sources wider than 4·size still average. Face texels come from the fragment
|
|
19
|
+
* position, so rows match the WebGL cube layout.
|
|
20
|
+
*/
|
|
21
|
+
export declare const equirectCubeShaderSource3D: string;
|
|
22
|
+
/**
|
|
23
|
+
* Cube mip level from the level above (EnvironmentMaps.ts mode 3): `source` is a
|
|
24
|
+
* cube view of that single level, and the texel-centre direction of the target
|
|
25
|
+
* lands on a 2×2 block corner, so the bilinear tap is the box average.
|
|
26
|
+
*/
|
|
27
|
+
export declare const cubeMipShaderSource3D: string;
|
|
28
|
+
/**
|
|
29
|
+
* Environment prefilter (EnvironmentMaps.ts): irradiance (mode 1) and GGX
|
|
30
|
+
* roughness levels (mode 0) of a mipmapped radiance cube by filtered
|
|
31
|
+
* importance sampling, 256 samples per specular and 512 per irradiance texel.
|
|
32
|
+
*/
|
|
33
|
+
export declare const prefilterShaderSource3D: string;
|
|
34
|
+
/**
|
|
35
|
+
* Box-filtered mip level from the level above (bilinear tap at each 2×2 block centre);
|
|
36
|
+
* the WebGL TextureMipmaps3D pass uses the same kernel, so both chains match.
|
|
37
|
+
*/
|
|
38
|
+
export declare const mipmapShaderSource3D = "@group(0) @binding(0) var source: texture_2d<f32>;\n@group(0) @binding(1) var sourceSampler: sampler;\n\nfn novaFullscreen(index: u32) -> vec2f {\n return vec2f(f32((index << 1u) & 2u), f32(index & 2u)) * 2.0 - 1.0;\n}\n\n@vertex\nfn vertexMain(@builtin(vertex_index) index: u32) -> @builtin(position) vec4f {\n return vec4f(novaFullscreen(index), 0.0, 1.0);\n}\n@fragment\nfn fragmentMain(@builtin(position) position: vec4f) -> @location(0) vec4f {\n let size = max(vec2f(textureDimensions(source, 0)) * 0.5, vec2f(1.0));\n let level = max(floor(size), vec2f(1.0));\n return textureSampleLevel(source, sourceSampler, position.xy / level, 0.0);\n}\n";
|