@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,198 @@
|
|
|
1
|
+
import { Quaternion3D, Vector3D } from '../../types.js';
|
|
2
|
+
import { PhysicsBackend3D, PhysicsBackendWorld3D, PhysicsBodyDesc3D, PhysicsBodyType3D, PhysicsContactEvent3D, PhysicsJointDesc3D, PhysicsJointMotor3D, PhysicsOut3D, PhysicsRayHitRecord3D, PhysicsWorldDesc3D } from '../PhysicsBackend.js';
|
|
3
|
+
import { RapierAPI } from './RapierShapes.js';
|
|
4
|
+
/**
|
|
5
|
+
* Владеет одним миром Rapier и преобразует его операции в контракт Nova.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RapierWorld implements PhysicsBackendWorld3D {
|
|
8
|
+
private readonly _api;
|
|
9
|
+
readonly backend: PhysicsBackend3D;
|
|
10
|
+
private readonly _ccd;
|
|
11
|
+
private readonly _world;
|
|
12
|
+
private _anchor;
|
|
13
|
+
private readonly _bodies;
|
|
14
|
+
private readonly _colliders;
|
|
15
|
+
private readonly _slots;
|
|
16
|
+
private readonly _freeSlots;
|
|
17
|
+
private readonly _joints;
|
|
18
|
+
private _contacts;
|
|
19
|
+
private readonly _events;
|
|
20
|
+
private readonly _position;
|
|
21
|
+
private readonly _quaternion;
|
|
22
|
+
private readonly _normal;
|
|
23
|
+
private readonly _point;
|
|
24
|
+
private readonly _local;
|
|
25
|
+
private readonly _ray;
|
|
26
|
+
private readonly _rayHit;
|
|
27
|
+
private readonly _rawGravity;
|
|
28
|
+
private readonly _rawVector;
|
|
29
|
+
private readonly _rawPoint;
|
|
30
|
+
private readonly _hooks;
|
|
31
|
+
private _destroyed;
|
|
32
|
+
private _draining;
|
|
33
|
+
private _stepping;
|
|
34
|
+
private _source;
|
|
35
|
+
private _other;
|
|
36
|
+
private _depth;
|
|
37
|
+
private _impulse;
|
|
38
|
+
private _found;
|
|
39
|
+
private _steps;
|
|
40
|
+
private readonly _visitSolid;
|
|
41
|
+
private readonly _visitSensor;
|
|
42
|
+
private readonly _visitManifold;
|
|
43
|
+
constructor(_api: RapierAPI, backend: PhysicsBackend3D, desc: PhysicsWorldDesc3D, maxContactPairs: number, _ccd: boolean);
|
|
44
|
+
/**
|
|
45
|
+
* Освобождает принадлежащие миру WASM-ресурсы; повторный вызов безопасен.
|
|
46
|
+
*/
|
|
47
|
+
destroy(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Задаёт гравитацию без изменения scheduler приложения.
|
|
50
|
+
*/
|
|
51
|
+
setGravity(gravity: Vector3D): void;
|
|
52
|
+
/**
|
|
53
|
+
* Копирует гравитацию в массив вызывающего.
|
|
54
|
+
*/
|
|
55
|
+
getGravity<T extends PhysicsOut3D>(out: T): T;
|
|
56
|
+
/**
|
|
57
|
+
* Выполняет ровно один шаг, обновляет контакты и очищает одношаговые силы.
|
|
58
|
+
*/
|
|
59
|
+
step(dt: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Создаёт тело и коллайдер; наружу возвращает независимый от Rapier handle.
|
|
62
|
+
*/
|
|
63
|
+
createBody(desc: PhysicsBodyDesc3D): number;
|
|
64
|
+
/**
|
|
65
|
+
* Удаляет тело, его соединения и ожидающие контакты без события end.
|
|
66
|
+
*/
|
|
67
|
+
destroyBody(handle: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Проверяет принадлежность handle живому миру.
|
|
70
|
+
*/
|
|
71
|
+
hasBody(handle: number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Возвращает тип движения тела.
|
|
74
|
+
*/
|
|
75
|
+
getBodyType(handle: number): PhysicsBodyType3D;
|
|
76
|
+
/**
|
|
77
|
+
* Меняет тип движения, сохраняя массу формы и запрещая движущийся trimesh/plane.
|
|
78
|
+
*/
|
|
79
|
+
setBodyType(handle: number, type: PhysicsBodyType3D): void;
|
|
80
|
+
/**
|
|
81
|
+
* Меняет массу и вычисляемую по форме инерцию.
|
|
82
|
+
*/
|
|
83
|
+
setMass(handle: number, mass: number): void;
|
|
84
|
+
/**
|
|
85
|
+
* Задаёт линейное и угловое затухание.
|
|
86
|
+
*/
|
|
87
|
+
setDamping(handle: number, linear: number, angular: number): void;
|
|
88
|
+
/**
|
|
89
|
+
* Сохраняет сочетание friction=sqrt(a*b), restitution=max(a,b) контракта basic.
|
|
90
|
+
*/
|
|
91
|
+
setMaterial(handle: number, friction: number, restitution: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* Меняет действие гравитации на отдельное тело.
|
|
94
|
+
*/
|
|
95
|
+
setGravityScale(handle: number, scale: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* Задаёт полный 32-битный фильтр и инвалидирует кеш пар Rapier.
|
|
98
|
+
*/
|
|
99
|
+
setCollisionFilter(handle: number, group: number, mask: number): void;
|
|
100
|
+
/**
|
|
101
|
+
* Читает мировую позу в массив вызывающего.
|
|
102
|
+
*/
|
|
103
|
+
getTransform<T extends PhysicsOut3D>(handle: number, out: T, offset?: number): T;
|
|
104
|
+
/**
|
|
105
|
+
* Телепортирует тело, сохраняя его скорости.
|
|
106
|
+
*/
|
|
107
|
+
setTransform(handle: number, position: Vector3D, quaternion: Quaternion3D): void;
|
|
108
|
+
/**
|
|
109
|
+
* Задаёт цель position-based kinematic на следующий фиксированный шаг.
|
|
110
|
+
*/
|
|
111
|
+
setKinematicTarget(handle: number, position: Vector3D, quaternion: Quaternion3D): void;
|
|
112
|
+
/**
|
|
113
|
+
* Читает линейную скорость без нового вектора.
|
|
114
|
+
*/
|
|
115
|
+
getLinearVelocity<T extends PhysicsOut3D>(handle: number, out: T): T;
|
|
116
|
+
/**
|
|
117
|
+
* Задаёт линейную скорость и будит тело.
|
|
118
|
+
*/
|
|
119
|
+
setLinearVelocity(handle: number, velocity: Vector3D): void;
|
|
120
|
+
/**
|
|
121
|
+
* Читает угловую скорость без нового вектора.
|
|
122
|
+
*/
|
|
123
|
+
getAngularVelocity<T extends PhysicsOut3D>(handle: number, out: T): T;
|
|
124
|
+
/**
|
|
125
|
+
* Задаёт угловую скорость и будит тело.
|
|
126
|
+
*/
|
|
127
|
+
setAngularVelocity(handle: number, velocity: Vector3D): void;
|
|
128
|
+
/**
|
|
129
|
+
* Добавляет силу на один следующий шаг в мировой точке либо начале тела.
|
|
130
|
+
*/
|
|
131
|
+
applyForce(handle: number, force: Vector3D, point?: Vector3D): void;
|
|
132
|
+
/**
|
|
133
|
+
* Немедленно изменяет импульс тела в мировой точке либо его начале.
|
|
134
|
+
*/
|
|
135
|
+
applyImpulse(handle: number, impulse: Vector3D, point?: Vector3D): void;
|
|
136
|
+
/**
|
|
137
|
+
* Добавляет момент сил на один следующий шаг.
|
|
138
|
+
*/
|
|
139
|
+
applyTorque(handle: number, torque: Vector3D): void;
|
|
140
|
+
/**
|
|
141
|
+
* Немедленно изменяет угловой импульс.
|
|
142
|
+
*/
|
|
143
|
+
applyTorqueImpulse(handle: number, impulse: Vector3D): void;
|
|
144
|
+
/**
|
|
145
|
+
* Возвращает состояние сна.
|
|
146
|
+
*/
|
|
147
|
+
getSleeping(handle: number): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Будит тело после внешнего действия.
|
|
150
|
+
*/
|
|
151
|
+
wake(handle: number): void;
|
|
152
|
+
/**
|
|
153
|
+
* Создаёт joint с локальными frames и отдельным handle Nova.
|
|
154
|
+
*/
|
|
155
|
+
createJoint(desc: PhysicsJointDesc3D): number;
|
|
156
|
+
/**
|
|
157
|
+
* Удаляет соединение и инвалидирует handle.
|
|
158
|
+
*/
|
|
159
|
+
destroyJoint(handle: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Настраивает или отключает мотор hinge/slider.
|
|
162
|
+
*/
|
|
163
|
+
setJointMotor(handle: number, motor: PhysicsJointMotor3D | null): void;
|
|
164
|
+
/**
|
|
165
|
+
* Ищет ближайшее попадание, включая ещё не прошедшие первый step коллайдеры.
|
|
166
|
+
*/
|
|
167
|
+
raycast(origin: Vector3D, direction: Vector3D, maxDistance: number, mask: number, out: PhysicsRayHitRecord3D): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Доставляет стабильную очередь переиспользуемым event; повторный drain пуст.
|
|
170
|
+
*/
|
|
171
|
+
drainContacts(visitor: (event: PhysicsContactEvent3D) => void): void;
|
|
172
|
+
/**
|
|
173
|
+
* Создаёт диагностический снимок по запросу инструмента, вне hot path.
|
|
174
|
+
*/
|
|
175
|
+
diagnostics(): Readonly<Record<string, number>>;
|
|
176
|
+
private _alive;
|
|
177
|
+
private _mutable;
|
|
178
|
+
private _body;
|
|
179
|
+
private _joint;
|
|
180
|
+
private _worldAnchor;
|
|
181
|
+
private _motion;
|
|
182
|
+
private _copyVector;
|
|
183
|
+
private _raw;
|
|
184
|
+
private _forcePoint;
|
|
185
|
+
private _writeVector;
|
|
186
|
+
private _restitution;
|
|
187
|
+
private _allows;
|
|
188
|
+
private _visitPair;
|
|
189
|
+
private _readManifold;
|
|
190
|
+
private _checkMotor;
|
|
191
|
+
private _motor;
|
|
192
|
+
private _vectorValue;
|
|
193
|
+
private _axis;
|
|
194
|
+
private _relativeRotation;
|
|
195
|
+
private _frames;
|
|
196
|
+
private _sliderOffset;
|
|
197
|
+
get destroyed(): boolean;
|
|
198
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PhysicsOut3D } from '../PhysicsBackend.js';
|
|
2
|
+
export declare function finite(value: number, label: string): number;
|
|
3
|
+
export declare function positive(value: number, label: string): number;
|
|
4
|
+
export declare function nonnegative(value: number, label: string): number;
|
|
5
|
+
export declare function vector(value: ArrayLike<number>, label: string): void;
|
|
6
|
+
export declare function rotation(value: ArrayLike<number>): void;
|
|
7
|
+
export declare function bits(value: number, label: string): number;
|
|
8
|
+
export declare function output(out: PhysicsOut3D, length: number, offset?: number): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GLState3D } from './GLState.js';
|
|
2
|
+
/**
|
|
3
|
+
* Draws an environment sky as one full-screen triangle at the far plane,
|
|
4
|
+
* before scene meshes and without depth access.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BackgroundProgram3D {
|
|
7
|
+
private readonly _gl;
|
|
8
|
+
private readonly _state;
|
|
9
|
+
private readonly _variants;
|
|
10
|
+
private _compiled;
|
|
11
|
+
constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
|
|
12
|
+
/** True once after a new variant was linked; the renderer then verifies the frame. */
|
|
13
|
+
takeCompiled(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* `texture` is the equirect source (blur 0), the prefiltered specular cube
|
|
16
|
+
* (blur > 0) or, with `screen`, a 2D texture stretched over the view.
|
|
17
|
+
* Leaves depth test and depth writes disabled; the caller restores them.
|
|
18
|
+
*/
|
|
19
|
+
draw(inverseViewProjection: Float32Array, texture: WebGLTexture, blur: number, rotation: number, intensity: number, direct: boolean, exposure: number, toneMapping: number, screen?: boolean): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
private _variant;
|
|
22
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features compiled into one basic-material program. Each draw selects the
|
|
3
|
+
* smallest variant, so disabled paths cost no shader work.
|
|
4
|
+
*/
|
|
5
|
+
export interface BasicVariant3D {
|
|
6
|
+
readonly instanced: boolean;
|
|
7
|
+
readonly skin: boolean;
|
|
8
|
+
readonly morph: boolean;
|
|
9
|
+
readonly map: boolean;
|
|
10
|
+
/** Geometry provides linear per-vertex colours at attribute 3. */
|
|
11
|
+
readonly color: boolean;
|
|
12
|
+
/** 0 opaque, 1 alpha mask, 2 premultiplied blend. */
|
|
13
|
+
readonly mode: 0 | 1 | 2;
|
|
14
|
+
/**
|
|
15
|
+
* Fragment side culling by instance/skin parity: 0 keeps logical front faces,
|
|
16
|
+
* 1 keeps back faces, 2 disables it. Fixed-function culling handles plain meshes.
|
|
17
|
+
*/
|
|
18
|
+
readonly parity: 0 | 1 | 2;
|
|
19
|
+
/** Encodes sRGB with exposure/tone mapping in the shader instead of a display pass. */
|
|
20
|
+
readonly direct: boolean;
|
|
21
|
+
/** Scene fog: 0 none, 1 linear, 2 exp, 3 exp2. */
|
|
22
|
+
readonly fog: 0 | 1 | 2 | 3;
|
|
23
|
+
/** The map has a non-identity UV transform. */
|
|
24
|
+
readonly mapTransform: boolean;
|
|
25
|
+
/** The map samples the second UV set (attribute 10). */
|
|
26
|
+
readonly mapSet: boolean;
|
|
27
|
+
/** 0 colour, 1 matcap, 2 view normal, 3 depth. */
|
|
28
|
+
readonly shade: 0 | 1 | 2 | 3;
|
|
29
|
+
/** Alpha to coverage: the output alpha drives sample coverage. */
|
|
30
|
+
readonly coverage: boolean;
|
|
31
|
+
/** Point primitives: sized points, maps read gl_PointCoord. */
|
|
32
|
+
readonly points: boolean;
|
|
33
|
+
/** 0 none, 1 spherical, 2 vertical billboard. */
|
|
34
|
+
readonly billboard: 0 | 1 | 2;
|
|
35
|
+
/** Instanced mesh with per-instance colours at attribute 15. */
|
|
36
|
+
readonly instanceColor: boolean;
|
|
37
|
+
/** Map reads one atlas cell (`spriteSheet` uniform). */
|
|
38
|
+
readonly spriteSheet: boolean;
|
|
39
|
+
/** Instanced mesh with per-instance atlas frames at attribute 14. */
|
|
40
|
+
readonly instanceFrame: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Instanced quad drawn as a plain quad list: instance data comes from
|
|
43
|
+
* textures by gl_VertexID, corners from uniforms (see `Mesh._pullQuads`).
|
|
44
|
+
*/
|
|
45
|
+
readonly pulled: boolean;
|
|
46
|
+
/** Pulled quads read compact records (InstancedMesh._quadRecords) instead of matrices, colours and frames. */
|
|
47
|
+
readonly records: boolean;
|
|
48
|
+
/** Bit mask of the record texels beyond centre and scale: 1 roll and frame, 2 colour (else the `recordColor` uniform). */
|
|
49
|
+
readonly recordLayout: number;
|
|
50
|
+
}
|
|
51
|
+
/** Instances per row of the pulled instance textures; matrices take four texels each. */
|
|
52
|
+
export declare const pulledRowInstances3D = 512;
|
|
53
|
+
export declare function basicVariantKey3D(variant: BasicVariant3D): number;
|
|
54
|
+
export declare function basicVertexSource3D(variant: BasicVariant3D): string;
|
|
55
|
+
export declare function basicFragmentSource3D(variant: BasicVariant3D): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { mat4 as Matrix4 } from 'gl-matrix';
|
|
2
|
+
import { Nova3DLight } from '../model/Light.js';
|
|
3
|
+
import { GLState3D } from './GLState.js';
|
|
4
|
+
/** Froxel grid: screen tiles × logarithmic depth slices. */
|
|
5
|
+
export declare const clusterGrid3D: readonly [16, 9, 24];
|
|
6
|
+
/** Most clustered lights and light references per frame. */
|
|
7
|
+
export declare const maxClusteredLights3D = 1024;
|
|
8
|
+
/** References one fragment walks at most. */
|
|
9
|
+
export declare const maxClusterLights3D = 64;
|
|
10
|
+
/** Per-view cluster data for the PBR program. */
|
|
11
|
+
export interface ClusterBinding3D {
|
|
12
|
+
readonly texture: WebGLTexture;
|
|
13
|
+
/** Number of clustered lights (0: none this view). */
|
|
14
|
+
count: number;
|
|
15
|
+
/** Logarithmic slicing: near and slices per log unit. */
|
|
16
|
+
readonly range: Float32Array;
|
|
17
|
+
/** View rectangle in device pixels: x, y, width, height. */
|
|
18
|
+
readonly view: Float32Array;
|
|
19
|
+
}
|
|
20
|
+
/** Texture rows (256 RGBA32UI texels each) of the cluster data. */
|
|
21
|
+
export declare const clusterRows3D: number;
|
|
22
|
+
/** First texel of the light records and of the index lists. */
|
|
23
|
+
export declare const clusterLightBase3D: number;
|
|
24
|
+
export declare const clusterIndexBase3D: number;
|
|
25
|
+
/**
|
|
26
|
+
* CPU binning of clustered lights into the froxel grid: cells (offset, count),
|
|
27
|
+
* four-texel light records and index lists packed into one RGBA32UI image
|
|
28
|
+
* (256 texels per row) that the WebGL renderer uploads as a texture and the
|
|
29
|
+
* WebGPU renderer as a storage buffer. All arrays are allocated once.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ClusterBins3D {
|
|
32
|
+
readonly data: Uint32Array<ArrayBuffer>;
|
|
33
|
+
private readonly _floats;
|
|
34
|
+
private readonly _counts;
|
|
35
|
+
private readonly _ranges;
|
|
36
|
+
/** Light references written by the last bin. */
|
|
37
|
+
references: number;
|
|
38
|
+
/** Logarithmic slicing of the last bin: near and slices per log unit. */
|
|
39
|
+
near: number;
|
|
40
|
+
logScale: number;
|
|
41
|
+
/**
|
|
42
|
+
* Bins `lights` for one view and returns the number of 256-texel rows in use.
|
|
43
|
+
* `view` is world-to-view, `projection` the camera projection, `near`/`far` its depth range.
|
|
44
|
+
*/
|
|
45
|
+
bin(lights: readonly Nova3DLight[], view: Matrix4, projection: Matrix4, near: number, far: number): number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Clustered forward lighting (PlayCanvas clustered lights, Babylon clustered light
|
|
49
|
+
* container): point and spot lights with a finite range beyond the 16 uniform lights
|
|
50
|
+
* are binned on the CPU into view froxels and read by the PBR loop from one integer
|
|
51
|
+
* texture. All buffers are allocated once; a frame only rewrites the used rows.
|
|
52
|
+
*/
|
|
53
|
+
export declare class ClusteredLights3D {
|
|
54
|
+
private readonly _gl;
|
|
55
|
+
private readonly _state;
|
|
56
|
+
private _texture?;
|
|
57
|
+
private readonly _bins;
|
|
58
|
+
private readonly _binding;
|
|
59
|
+
private _bytes;
|
|
60
|
+
constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
|
|
61
|
+
get bytes(): number;
|
|
62
|
+
/**
|
|
63
|
+
* Bins `lights` for one view. `view` is world-to-view, `projection` the camera
|
|
64
|
+
* projection; `near`/`far` its depth range; the rectangle is in device pixels.
|
|
65
|
+
*/
|
|
66
|
+
build(lights: readonly Nova3DLight[], view: Matrix4, projection: Matrix4, near: number, far: number, rect: readonly [number, number, number, number]): ClusterBinding3D;
|
|
67
|
+
private _ensureTexture;
|
|
68
|
+
reset(discard?: boolean): void;
|
|
69
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { mat4 as Matrix4 } from 'gl-matrix';
|
|
2
|
+
import { Nova3DMesh } from '../model/Mesh.js';
|
|
3
|
+
/**
|
|
4
|
+
* Cached draw order of one view (WebGL and WebGPU share it). Keys live on the meshes
|
|
5
|
+
* and are stamped with the view's camera stamp, so a mesh keyed by another view or
|
|
6
|
+
* an older camera is re-keyed and the view re-checks its order.
|
|
7
|
+
*/
|
|
8
|
+
export interface DrawOrderState3D {
|
|
9
|
+
/** Meshes of the last ordered frame in culling order. */
|
|
10
|
+
readonly culled: Nova3DMesh[];
|
|
11
|
+
/** The draw order of `culled`. */
|
|
12
|
+
readonly visible: Nova3DMesh[];
|
|
13
|
+
/** Camera stamp; unique across views and renderers, new whenever the view camera matrix is recomputed. */
|
|
14
|
+
stamp: number;
|
|
15
|
+
/** `visible` is the complete order of `culled`; false until the first order and after an interrupted one. */
|
|
16
|
+
valid: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function createDrawOrder3D(): DrawOrderState3D;
|
|
19
|
+
/** Invalidates every depth key of the view; called whenever its view matrix is recomputed. */
|
|
20
|
+
export declare function drawOrderCameraChanged3D(state: DrawOrderState3D): void;
|
|
21
|
+
/**
|
|
22
|
+
* One order for every view: opaque, then transmissive, then blended; then renderOrder.
|
|
23
|
+
* Opaque meshes go by material (fewer program and state changes), then front to back so
|
|
24
|
+
* early depth rejection skips occluded fragments (three.js `material.id`, then `z`).
|
|
25
|
+
* Transmissive and blended meshes go back to front by view-space z of their origin.
|
|
26
|
+
* Coplanar opaque surfaces (decals) are ordered by `renderOrder`, not by scene order.
|
|
27
|
+
* Remaining ties keep culling order (`_sortIndex`), so the order is total: sorting the
|
|
28
|
+
* previous order gives exactly what a stable sort of the culling order gives.
|
|
29
|
+
*/
|
|
30
|
+
export declare function drawOrder3D(a: Nova3DMesh, b: Nova3DMesh): number;
|
|
31
|
+
/**
|
|
32
|
+
* Orders the culled meshes of a view (`_sortBlend` already written) and returns
|
|
33
|
+
* `state.visible`. Depth keys are recomputed only for meshes whose world matrix or view
|
|
34
|
+
* camera changed; when the culled list and every key match the last frame, the last
|
|
35
|
+
* order is reused without a check. Allocates nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare function orderView3D(state: DrawOrderState3D, meshes: readonly Nova3DMesh[], inverseCamera: Matrix4): Nova3DMesh[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Nova3DMesh } from '../model/Mesh.js';
|
|
2
|
+
import { Nova3DScene } from '../model/Scene.js';
|
|
3
|
+
import { Nova3DTexture } from '../model/Texture.js';
|
|
4
|
+
/**
|
|
5
|
+
* Per-frame inputs the renderer hands to the effects processor. One record is
|
|
6
|
+
* reused for every frame; matrices are copied in place.
|
|
7
|
+
*/
|
|
8
|
+
export interface EffectsFrame3D {
|
|
9
|
+
/** Window depth of the canvas scene (DEPTH_COMPONENT24), null unless the processor asked for depth. */
|
|
10
|
+
depth: WebGLTexture | null;
|
|
11
|
+
/** Camera data of the first canvas view; meaningful while `scene` is not null. */
|
|
12
|
+
readonly projection: Float32Array;
|
|
13
|
+
readonly view: Float32Array;
|
|
14
|
+
readonly viewProjection: Float32Array;
|
|
15
|
+
/** Changes whenever the view-projection above changes. */
|
|
16
|
+
stamp: number;
|
|
17
|
+
/** Scene of the first canvas view, or null when no canvas view was drawn. */
|
|
18
|
+
scene: Nova3DScene | null;
|
|
19
|
+
exposure: number;
|
|
20
|
+
/** Index in `toneMappings3D`. */
|
|
21
|
+
toneMapping: number;
|
|
22
|
+
/** Uploads the mesh geometry if needed and draws it with a caster-layout program. */
|
|
23
|
+
readonly draw: (node: Nova3DMesh, program: WebGLProgram) => void;
|
|
24
|
+
/** Resident GL texture of an app texture, uploading it first. */
|
|
25
|
+
readonly texture: (texture: Nova3DTexture) => WebGLTexture;
|
|
26
|
+
}
|
|
27
|
+
/** Internal lifecycle bridge for the optional concrete /3d/effects addon. */
|
|
28
|
+
export interface EffectsProcessor3D {
|
|
29
|
+
readonly bytes: number;
|
|
30
|
+
/** The active plan samples scene depth; the renderer then keeps a depth texture. */
|
|
31
|
+
readonly depth: boolean;
|
|
32
|
+
/** `depthBytes` is the extra cost of the sampled depth texture over the default depth buffer. */
|
|
33
|
+
validateSize: (width: number, height: number, baseBytes: number, baseColors: number, depthBytes: number) => void;
|
|
34
|
+
present: (source: WebGLTexture, width: number, height: number, display: (source: WebGLTexture, output: WebGLFramebuffer | null) => void, frame: EffectsFrame3D) => number;
|
|
35
|
+
reset: (discardLostGeneration: boolean) => void;
|
|
36
|
+
/** Sub-pixel projection jitter (device pixels) for the coming frame, or null. */
|
|
37
|
+
jitter?: () => Float32Array | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split-sum DFG table of the GGX BRDF with height-correlated Smith visibility
|
|
3
|
+
* (Karis 2013; Filament, three.js and the Khronos sample viewer use the same
|
|
4
|
+
* integral): `scale` and `bias` such that the directional albedo for a
|
|
5
|
+
* Schlick Fresnel is `F0·scale + F90·bias`. `scale + bias` is the single-
|
|
6
|
+
* scattering energy Ess that the multiple-scattering compensation restores
|
|
7
|
+
* (Fdez-Agüera 2019 for image lighting, Turquin 2019 for direct lights).
|
|
8
|
+
*/
|
|
9
|
+
export declare const dfgTableSize3D = 32;
|
|
10
|
+
/** Scale and bias of the split-sum integral at one roughness (perceptual, α = r²) and N·V. */
|
|
11
|
+
export declare function integrateDFG3D(roughness: number, NoV: number, count?: number): [number, number];
|
|
12
|
+
/**
|
|
13
|
+
* The table computed from the integral: RG pairs, half-float exact, roughness along u (x)
|
|
14
|
+
* and N·V along v (y); entry (x, y) holds roughness x/31 and N·V y/31 (~10 ms).
|
|
15
|
+
* dfgTable3D returns the same values from encodedTable; the tests compare both.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeDFGTable3D(): Float32Array;
|
|
19
|
+
/** The DFG table of computeDFGTable3D, decoded once from encodedTable. */
|
|
20
|
+
export declare function dfgTable3D(): Float32Array;
|
|
21
|
+
/** Bilinear table lookup as the shaders do it (CPU mirror for tests and diagnostics). */
|
|
22
|
+
export declare function sampleDFG3D(roughness: number, NoV: number): [number, number];
|
|
23
|
+
/**
|
|
24
|
+
* Image-lighting reflectance of one channel with multiple scattering
|
|
25
|
+
* (Fdez-Agüera 2019, as three.js computeMultiscattering): `single` weighs the
|
|
26
|
+
* prefiltered radiance, `multi` the irradiance. Under a constant environment
|
|
27
|
+
* `single + multi` is the albedo of the layer; a white metal returns 1.
|
|
28
|
+
*/
|
|
29
|
+
export declare function multiScatter3D(F0: number, F90: number, roughness: number, NoV: number): {
|
|
30
|
+
single: number;
|
|
31
|
+
multi: number;
|
|
32
|
+
ess: number;
|
|
33
|
+
};
|
|
34
|
+
/** Direct-light specular gain restoring the energy single scattering loses (three.js, Turquin 2019 eq. 16). */
|
|
35
|
+
export declare function directCompensation3D(F0: number, roughness: number, NoV: number): number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Nova3DEnvironment } from '../model/Environment.js';
|
|
2
|
+
interface ResidentEnvironment3D {
|
|
3
|
+
diffuse: WebGLTexture;
|
|
4
|
+
specular: WebGLTexture;
|
|
5
|
+
version: number;
|
|
6
|
+
}
|
|
7
|
+
/** Face size of the intermediate radiance cube: about the equirect's resolution, 32–512. */
|
|
8
|
+
export declare function sourceCubeSize3D(width: number): number;
|
|
9
|
+
/** Owns bounded, reconstructible irradiance and roughness-filtered cube maps. */
|
|
10
|
+
export declare class EnvironmentMaps3D {
|
|
11
|
+
private readonly _gl;
|
|
12
|
+
private readonly _residents;
|
|
13
|
+
private _program?;
|
|
14
|
+
private _framebuffer?;
|
|
15
|
+
private _passes;
|
|
16
|
+
constructor(_gl: WebGL2RenderingContext);
|
|
17
|
+
get bytes(): number;
|
|
18
|
+
/** Prefilter passes issued since the last consume; nonzero means GL state was written directly. */
|
|
19
|
+
get pendingPasses(): number;
|
|
20
|
+
consumePasses(): number;
|
|
21
|
+
/** `width` is the equirect source width, which sizes the intermediate radiance cube. */
|
|
22
|
+
ensure(environment: Nova3DEnvironment, source: WebGLTexture, width: number): ResidentEnvironment3D;
|
|
23
|
+
private _ensureProgram;
|
|
24
|
+
/** Immutable RGBA16F cube storage with clamped, trilinear sampling. */
|
|
25
|
+
private _allocate;
|
|
26
|
+
/** Renders the equirect into level 0 of `cube` and builds its mip chain. */
|
|
27
|
+
private _convert;
|
|
28
|
+
/** Program, fixed-function state and the service framebuffer of every filter pass. */
|
|
29
|
+
private _begin;
|
|
30
|
+
/** Detaches the service framebuffer so no pass keeps a resource attached. */
|
|
31
|
+
private _end;
|
|
32
|
+
/**
|
|
33
|
+
* Rebuilds levels 1… of a `size`² cube from level 0 with the shader's mode 3, the
|
|
34
|
+
* same pass and kernel as the WebGPU CubeFilter3D (a driver generateMipmap may filter
|
|
35
|
+
* differently). Base and max level expose only the level above while one is drawn.
|
|
36
|
+
*/
|
|
37
|
+
private _mipmaps;
|
|
38
|
+
/**
|
|
39
|
+
* Fills irradiance (32²) and roughness-filtered (size², 8 levels) cubes from a
|
|
40
|
+
* `sourceSize`² radiance cube, first building its mip chain from level 0.
|
|
41
|
+
*/
|
|
42
|
+
private _prefilter;
|
|
43
|
+
/**
|
|
44
|
+
* Prefilters a `sourceSize`² reflection-probe capture (a cube with a full mip
|
|
45
|
+
* chain, rebuilt here from level 0) into its own irradiance and specular cubes
|
|
46
|
+
* (allocated on first use; `size` ≥ 128 keeps all 8 roughness levels). The caller owns them.
|
|
47
|
+
*/
|
|
48
|
+
prefilterCube(source: WebGLTexture, target: {
|
|
49
|
+
diffuse?: WebGLTexture;
|
|
50
|
+
specular?: WebGLTexture;
|
|
51
|
+
}, size: number, sourceSize: number): void;
|
|
52
|
+
release(environment: Nova3DEnvironment): void;
|
|
53
|
+
reset(discard?: boolean): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene fog shared by the basic and PBR programs. `FOG` is defined as 1 linear,
|
|
3
|
+
* 2 exp or 3 exp2, so each mode compiles without branches. Depth runs along the
|
|
4
|
+
* camera view direction; fog mixes in linear light before tone mapping.
|
|
5
|
+
*/
|
|
6
|
+
export declare const fogChunk3D = "\n#ifdef FOG\nuniform vec3 fogColor;\n\nuniform vec2 fogParameters;\nvec3 novaFog(vec3 color,float depth){\n float d=max(depth,0.0);\n#if FOG==1\n float f=clamp((d-fogParameters.x)/(fogParameters.y-fogParameters.x),0.0,1.0);\n#elif FOG==2\n float f=1.0-exp(-fogParameters.x*d);\n#else\n float k=fogParameters.x*d;\n float f=1.0-exp(-k*k);\n#endif\n return mix(color,fogColor,f);\n}\n#endif";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { mat4 as Matrix4 } from 'gl-matrix';
|
|
2
|
+
import { Bounds3D } from '../types.js';
|
|
3
|
+
/** Writes the six clip planes (left/right, bottom/top, near/far) of a view-projection into caller-owned storage. */
|
|
4
|
+
export declare function writeFrustumPlanes3D(matrix: Matrix4 | Float32Array, out: number[][]): number[][];
|
|
5
|
+
/** Conservative box test: false only when the box lies fully outside one plane. */
|
|
6
|
+
export declare function boundsInFrustum3D(bounds: Bounds3D, frustum: readonly number[][]): boolean;
|
|
7
|
+
export declare function createFrustum3D(): number[][];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer-owned cache of WebGL2 state written by the main and display passes.
|
|
3
|
+
* Writers that bypass it (uploads, shadows, PBR, environment, effects, deformation)
|
|
4
|
+
* are followed by `invalidate()`, so a cached value is never trusted after them.
|
|
5
|
+
* Uniform values belong to their program and survive `invalidate()`; locations of
|
|
6
|
+
* a lost generation are never reused, so their entries simply become unreachable.
|
|
7
|
+
*/
|
|
8
|
+
export declare class GLState3D {
|
|
9
|
+
private readonly _gl;
|
|
10
|
+
private _program;
|
|
11
|
+
private _vao;
|
|
12
|
+
private _framebuffer;
|
|
13
|
+
private readonly _viewport;
|
|
14
|
+
private readonly _scissor;
|
|
15
|
+
private readonly _caps;
|
|
16
|
+
/** Fast cache of the capabilities toggled per draw: −1 unknown, 0 off, 1 on. */
|
|
17
|
+
private readonly _commonCaps;
|
|
18
|
+
private _depthMask;
|
|
19
|
+
private _colorMask;
|
|
20
|
+
private _lastColorMask;
|
|
21
|
+
private _depthFunc;
|
|
22
|
+
private _cullFace;
|
|
23
|
+
private _frontFace;
|
|
24
|
+
private _blendSource;
|
|
25
|
+
private _blendTarget;
|
|
26
|
+
private _blendSourceAlpha;
|
|
27
|
+
private _blendTargetAlpha;
|
|
28
|
+
private readonly _clearColor;
|
|
29
|
+
private _clearDepth;
|
|
30
|
+
private _unit;
|
|
31
|
+
private readonly _textures;
|
|
32
|
+
private _uniforms;
|
|
33
|
+
constructor(_gl: WebGL2RenderingContext);
|
|
34
|
+
invalidate(): void;
|
|
35
|
+
/** Drops program-owned uniform values, e.g. after a context generation change. */
|
|
36
|
+
forgetUniforms(): void;
|
|
37
|
+
useProgram(program: WebGLProgram): void;
|
|
38
|
+
bindVertexArray(vao: WebGLVertexArrayObject | null): void;
|
|
39
|
+
/** Records a VAO binding made directly by a resource upload. */
|
|
40
|
+
boundVertexArray(vao: WebGLVertexArrayObject | null): void;
|
|
41
|
+
/** Records that FRAMEBUFFER was changed through READ/DRAW bindings. */
|
|
42
|
+
forgetFramebuffer(): void;
|
|
43
|
+
bindFramebuffer(framebuffer: WebGLFramebuffer | null): void;
|
|
44
|
+
viewport(x: number, y: number, width: number, height: number): void;
|
|
45
|
+
scissor(x: number, y: number, width: number, height: number): void;
|
|
46
|
+
capability(capability: number, enabled: boolean): void;
|
|
47
|
+
depthMask(enabled: boolean): void;
|
|
48
|
+
/** Writes all colour channels or none; cached passes use no partial masks. */
|
|
49
|
+
colorMask(enabled: boolean): void;
|
|
50
|
+
/**
|
|
51
|
+
* The colour mask in effect, without a synchronous query: the last one written through
|
|
52
|
+
* this cache, which invalidate() keeps. Direct writers (environment, effects and mip
|
|
53
|
+
* passes) only ever enable all channels outside the shadow pass, which writes `false`
|
|
54
|
+
* through the cache and re-enables it before returning.
|
|
55
|
+
*/
|
|
56
|
+
get lastColorMask(): boolean;
|
|
57
|
+
colorMaskAll(): void;
|
|
58
|
+
depthFunc(value: number): void;
|
|
59
|
+
cullFace(value: number): void;
|
|
60
|
+
frontFace(value: number): void;
|
|
61
|
+
blendFunc(source: number, target: number): void;
|
|
62
|
+
blendFuncSeparate(source: number, target: number, sourceAlpha: number, targetAlpha: number): void;
|
|
63
|
+
clearColor(red: number, green: number, blue: number, alpha: number): void;
|
|
64
|
+
clearDepth(value: number): void;
|
|
65
|
+
/** Binds a TEXTURE_2D on a unit; the active unit stays selected afterwards. */
|
|
66
|
+
texture2D(unit: number, texture: WebGLTexture | null): void;
|
|
67
|
+
/** Binds a TEXTURE_2D_ARRAY on a unit. */
|
|
68
|
+
textureArray(unit: number, texture: WebGLTexture | null): void;
|
|
69
|
+
/** Binds a TEXTURE_3D on a unit. */
|
|
70
|
+
texture3D(unit: number, texture: WebGLTexture | null): void;
|
|
71
|
+
/** Binds a TEXTURE_CUBE_MAP on a unit; tracked separately from TEXTURE_2D. */
|
|
72
|
+
textureCube(unit: number, texture: WebGLTexture | null): void;
|
|
73
|
+
/** Makes `unit` the active texture unit, for calls that act on the active unit's binding. */
|
|
74
|
+
selectUnit(unit: number): void;
|
|
75
|
+
private _bindTexture;
|
|
76
|
+
uniform1i(location: WebGLUniformLocation | null, value: number): void;
|
|
77
|
+
uniform1f(location: WebGLUniformLocation | null, value: number): void;
|
|
78
|
+
uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;
|
|
79
|
+
uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;
|
|
80
|
+
uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;
|
|
81
|
+
uniformMatrix3(location: WebGLUniformLocation | null, value: ArrayLike<number>): void;
|
|
82
|
+
uniformMatrix4(location: WebGLUniformLocation | null, value: ArrayLike<number>): void;
|
|
83
|
+
/** Records a 2-4 component value; returns true when it differs from the uploaded one. */
|
|
84
|
+
private _vector;
|
|
85
|
+
private _matrix;
|
|
86
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Nova3DMesh } from '../model/Mesh.js';
|
|
2
|
+
import { Nova3DTexture } from '../model/Texture.js';
|
|
3
|
+
import { GLState3D } from './GLState.js';
|
|
4
|
+
/** Raw GPU pick: candidate, instance and window depth of the nearest surface. */
|
|
5
|
+
export interface GPUPickSample3D {
|
|
6
|
+
readonly node: Nova3DMesh;
|
|
7
|
+
readonly instance: number;
|
|
8
|
+
readonly depth: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders candidates into a 1×1 integer target through a pick matrix and reads
|
|
12
|
+
* it back asynchronously through a pixel-pack buffer and a fence.
|
|
13
|
+
*/
|
|
14
|
+
export declare class GPUPicker3D {
|
|
15
|
+
private readonly _gl;
|
|
16
|
+
private readonly _state;
|
|
17
|
+
private _program?;
|
|
18
|
+
private _uniforms?;
|
|
19
|
+
private _framebuffer?;
|
|
20
|
+
private _color?;
|
|
21
|
+
private _depth?;
|
|
22
|
+
private readonly _matrix;
|
|
23
|
+
constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
|
|
24
|
+
/**
|
|
25
|
+
* Draws `candidates` with the view-projection narrowed to one pixel and returns a
|
|
26
|
+
* promise of the nearest hit. `pixel` is in device pixels from the view's top-left.
|
|
27
|
+
*/
|
|
28
|
+
pick(candidates: readonly Nova3DMesh[], viewProjection: Float32Array, pixel: readonly [number, number], size: readonly [number, number], texture: (value: Nova3DTexture) => WebGLTexture, draw: (node: Nova3DMesh, program: WebGLProgram) => void): Promise<GPUPickSample3D | null>;
|
|
29
|
+
destroy(discard?: boolean): void;
|
|
30
|
+
private _ensureTarget;
|
|
31
|
+
}
|