@nova-lab/core 1.0.0-dev.19 → 1.1.1-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.
Files changed (501) hide show
  1. package/README.md +1035 -10
  2. package/THIRD_PARTY_NOTICES.md +26 -0
  3. package/dist/2d/accessibility.d.ts +2 -0
  4. package/dist/2d/accessibility.js +171 -0
  5. package/dist/2d/commands.d.ts +2 -0
  6. package/dist/2d/commands.js +80 -0
  7. package/dist/2d/effects.d.ts +10 -0
  8. package/dist/2d/effects.js +566 -0
  9. package/dist/2d/ktx2.d.ts +5 -0
  10. package/dist/2d/ktx2.js +542 -0
  11. package/dist/2d/lighting.d.ts +3 -0
  12. package/dist/2d/lighting.js +495 -0
  13. package/dist/2d/lottie.d.ts +3 -0
  14. package/dist/2d/lottie.js +254 -0
  15. package/dist/2d/meshes.d.ts +4 -0
  16. package/dist/2d/meshes.js +451 -0
  17. package/dist/2d/primitives.d.ts +3 -0
  18. package/dist/2d/primitives.js +85 -0
  19. package/dist/2d/render-textures.d.ts +3 -0
  20. package/dist/2d/render-textures.js +539 -0
  21. package/dist/2d/svg/documents.d.ts +5 -0
  22. package/dist/2d/svg/documents.js +7 -0
  23. package/dist/2d/svg/renderer.d.ts +3 -0
  24. package/dist/2d/svg/renderer.js +222 -0
  25. package/dist/2d/svg.d.ts +3 -0
  26. package/dist/2d/svg.js +4 -0
  27. package/dist/2d/tools.d.ts +2 -0
  28. package/dist/2d/tools.js +100 -0
  29. package/dist/2d/video.d.ts +5 -0
  30. package/dist/2d/video.js +90 -0
  31. package/dist/2d.d.ts +2 -0
  32. package/dist/2d.js +220 -0
  33. package/dist/3d/animation.d.ts +8 -0
  34. package/dist/3d/animation.js +1396 -0
  35. package/dist/3d/area-lights.d.ts +2 -0
  36. package/dist/3d/area-lights.js +19 -0
  37. package/dist/3d/audio.d.ts +4 -0
  38. package/dist/3d/audio.js +500 -0
  39. package/dist/3d/character.d.ts +2 -0
  40. package/dist/3d/character.js +136 -0
  41. package/dist/3d/collision.d.ts +3 -0
  42. package/dist/3d/collision.js +387 -0
  43. package/dist/3d/commands.d.ts +2 -0
  44. package/dist/3d/commands.js +108 -0
  45. package/dist/3d/controls.d.ts +8 -0
  46. package/dist/3d/controls.js +1041 -0
  47. package/dist/3d/documents.d.ts +5 -0
  48. package/dist/3d/documents.js +227 -0
  49. package/dist/3d/effects.d.ts +5 -0
  50. package/dist/3d/effects.js +1986 -0
  51. package/dist/3d/export.d.ts +4 -0
  52. package/dist/3d/export.js +347 -0
  53. package/dist/3d/fbx.d.ts +2 -0
  54. package/dist/3d/fbx.js +784 -0
  55. package/dist/3d/gltf.d.ts +2 -0
  56. package/dist/3d/gltf.js +5 -0
  57. package/dist/3d/helpers.d.ts +5 -0
  58. package/dist/3d/helpers.js +191 -0
  59. package/dist/3d/ik.d.ts +9 -0
  60. package/dist/3d/ik.js +777 -0
  61. package/dist/3d/loaders.d.ts +17 -0
  62. package/dist/3d/loaders.js +1406 -0
  63. package/dist/3d/nodes.d.ts +8 -0
  64. package/dist/3d/nodes.js +49 -0
  65. package/dist/3d/particles.d.ts +5 -0
  66. package/dist/3d/particles.js +1574 -0
  67. package/dist/3d/physics/backend.d.ts +7 -0
  68. package/dist/3d/physics/backend.js +1 -0
  69. package/dist/3d/physics/rapier.d.ts +3 -0
  70. package/dist/3d/physics/rapier.js +765 -0
  71. package/dist/3d/physics.d.ts +5 -0
  72. package/dist/3d/physics.js +3346 -0
  73. package/dist/3d/splats.d.ts +7 -0
  74. package/dist/3d/splats.js +862 -0
  75. package/dist/3d/text.d.ts +5 -0
  76. package/dist/3d/text.js +1043 -0
  77. package/dist/3d/tiles.d.ts +24 -0
  78. package/dist/3d/tiles.js +1705 -0
  79. package/dist/3d/tools.d.ts +12 -0
  80. package/dist/3d/tools.js +338 -0
  81. package/dist/3d/usdz.d.ts +2 -0
  82. package/dist/3d/usdz.js +634 -0
  83. package/dist/3d/xr.d.ts +2 -0
  84. package/dist/3d/xr.js +202 -0
  85. package/dist/3d-B4jWF8Qb.js +5591 -0
  86. package/dist/3d.d.ts +40 -0
  87. package/dist/3d.js +44 -0
  88. package/dist/Capsule-BFVpZfvc.js +44 -0
  89. package/dist/Clip-CAN7t03k.js +204 -0
  90. package/dist/Color-vuv9UnoY.js +34 -0
  91. package/dist/DeformedMesh-CPi0P_vc.js +280 -0
  92. package/dist/Document-DCVEZSvM.js +415 -0
  93. package/dist/Errors-B2ekO9bZ.js +30 -0
  94. package/dist/Features-BsjmePtc.js +557 -0
  95. package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
  96. package/dist/GPUParticleState-CQlNpoDa.js +545 -0
  97. package/dist/Geometry-DytO490z.js +227 -0
  98. package/dist/Inflate-DWw0V-Up.js +42 -0
  99. package/dist/InstancedMesh-DPrgrw5z.js +527 -0
  100. package/dist/Limits-Bw5XQdFr.js +20 -0
  101. package/dist/LineHelper-Ad0z9uDi.js +131 -0
  102. package/dist/LoaderIO-BwrM84OM.js +114 -0
  103. package/dist/Material-BpfLPmK9.js +777 -0
  104. package/dist/Mesh-BaRxAAJq.js +209 -0
  105. package/dist/Node-QfgAE2_v.js +877 -0
  106. package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
  107. package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
  108. package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
  109. package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
  110. package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
  111. package/dist/Options-CajE7LLJ.js +15 -0
  112. package/dist/PolygonMesh-D4PnnfIo.js +657 -0
  113. package/dist/Ready-BzyhRtjD.js +21 -0
  114. package/dist/Scene-CDfNgf9I.js +911 -0
  115. package/dist/Shader-b6_HDndT.js +48 -0
  116. package/dist/SplatShader-wJ6GJ3vo.js +130 -0
  117. package/dist/Texture-dTKMlTpK.js +267 -0
  118. package/dist/TextureLoader-CfDzdy2m.js +411 -0
  119. package/dist/Textures-CGL4Kf-8.js +651 -0
  120. package/dist/ToneMapping-D9IWvN0u.js +46 -0
  121. package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
  122. package/dist/ZipReader-C-MSEsSr.js +84 -0
  123. package/dist/core.js +218 -24024
  124. package/dist/domain/types/base.types.d.ts +18 -9
  125. package/dist/domain/types/component.types.d.ts +5 -5
  126. package/dist/domain/types/cursor.types.d.ts +1 -1
  127. package/dist/domain/types/diagnostics.types.d.ts +2 -0
  128. package/dist/domain/types/export.types.d.ts +2 -2
  129. package/dist/domain/types/hit-test.types.d.ts +1 -1
  130. package/dist/domain/types/motion.types.d.ts +2 -2
  131. package/dist/domain/types/renderer.types.d.ts +88 -4
  132. package/dist/domain/types/rendering/index.d.ts +29 -4
  133. package/dist/domain/types/sound.types.d.ts +1 -1
  134. package/dist/domain/types/theme.types.d.ts +1 -1
  135. package/dist/domain/utils/bounds.d.ts +1 -1
  136. package/dist/domain/utils/nova-text.d.ts +9 -0
  137. package/dist/domain/utils/schemaBounds.d.ts +2 -2
  138. package/dist/export-svg-document-ChaNXMaG.js +668 -0
  139. package/dist/features/3d/Errors.d.ts +57 -0
  140. package/dist/features/3d/Nova3DApp.d.ts +429 -0
  141. package/dist/features/3d/animation/Animator.d.ts +260 -0
  142. package/dist/features/3d/animation/Clip.d.ts +74 -0
  143. package/dist/features/3d/animation/Graph.d.ts +158 -0
  144. package/dist/features/3d/animation/Mask.d.ts +40 -0
  145. package/dist/features/3d/audio/Audio.d.ts +114 -0
  146. package/dist/features/3d/audio/Sound.d.ts +133 -0
  147. package/dist/features/3d/character/CharacterController.d.ts +61 -0
  148. package/dist/features/3d/collision/Capsule.d.ts +25 -0
  149. package/dist/features/3d/collision/Octree.d.ts +94 -0
  150. package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
  151. package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
  152. package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
  153. package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
  154. package/dist/features/3d/controls/PointerLock.d.ts +36 -0
  155. package/dist/features/3d/controls/Snapping.d.ts +32 -0
  156. package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
  157. package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
  158. package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
  159. package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
  160. package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
  161. package/dist/features/3d/documents/Document.d.ts +59 -0
  162. package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
  163. package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
  164. package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
  165. package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
  166. package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
  167. package/dist/features/3d/documents/Projection.d.ts +65 -0
  168. package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
  169. package/dist/features/3d/effects/Effects.d.ts +32 -0
  170. package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
  171. package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
  172. package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
  173. package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
  174. package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
  175. package/dist/features/3d/export/ZipWriter.d.ts +9 -0
  176. package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
  177. package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
  178. package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
  179. package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
  180. package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
  181. package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
  182. package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
  183. package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
  184. package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
  185. package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
  186. package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
  187. package/dist/features/3d/ik/ChainIK.d.ts +44 -0
  188. package/dist/features/3d/ik/IKChain.d.ts +92 -0
  189. package/dist/features/3d/ik/IKMath.d.ts +49 -0
  190. package/dist/features/3d/ik/IKSolver.d.ts +97 -0
  191. package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
  192. package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
  193. package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
  194. package/dist/features/3d/import/ImportMath.d.ts +42 -0
  195. package/dist/features/3d/import/ImportedModel.d.ts +135 -0
  196. package/dist/features/3d/import/Inflate.d.ts +5 -0
  197. package/dist/features/3d/import/ModelAsset.d.ts +149 -0
  198. package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
  199. package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
  200. package/dist/features/3d/lights/AreaLights.d.ts +11 -0
  201. package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
  202. package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
  203. package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
  204. package/dist/features/3d/loaders/Limits.d.ts +70 -0
  205. package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
  206. package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
  207. package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
  208. package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
  209. package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
  210. package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
  211. package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
  212. package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
  213. package/dist/features/3d/model/Camera.d.ts +33 -0
  214. package/dist/features/3d/model/Environment.d.ts +31 -0
  215. package/dist/features/3d/model/Geometry.d.ts +59 -0
  216. package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
  217. package/dist/features/3d/model/LOD.d.ts +31 -0
  218. package/dist/features/3d/model/Light.d.ts +200 -0
  219. package/dist/features/3d/model/Material.d.ts +308 -0
  220. package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
  221. package/dist/features/3d/model/Mesh.d.ts +92 -0
  222. package/dist/features/3d/model/Node.d.ts +87 -0
  223. package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
  224. package/dist/features/3d/model/RenderTarget.d.ts +41 -0
  225. package/dist/features/3d/model/Scene.d.ts +173 -0
  226. package/dist/features/3d/model/Texture.d.ts +143 -0
  227. package/dist/features/3d/nodes/Nodes.d.ts +8 -0
  228. package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
  229. package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
  230. package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
  231. package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
  232. package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
  233. package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
  234. package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
  235. package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
  236. package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
  237. package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
  238. package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
  239. package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
  240. package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
  241. package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
  242. package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
  243. package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
  244. package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
  245. package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
  246. package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
  247. package/dist/features/3d/services/Background.d.ts +22 -0
  248. package/dist/features/3d/services/BasicShader.d.ts +55 -0
  249. package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
  250. package/dist/features/3d/services/DrawOrder.d.ts +37 -0
  251. package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
  252. package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
  253. package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
  254. package/dist/features/3d/services/FogShader.d.ts +6 -0
  255. package/dist/features/3d/services/Frustum.d.ts +7 -0
  256. package/dist/features/3d/services/GLState.d.ts +86 -0
  257. package/dist/features/3d/services/GPUPicker.d.ts +31 -0
  258. package/dist/features/3d/services/InstanceShader.d.ts +3 -0
  259. package/dist/features/3d/services/LineProgram.d.ts +32 -0
  260. package/dist/features/3d/services/PBRProgram.d.ts +115 -0
  261. package/dist/features/3d/services/Renderer.d.ts +50 -0
  262. package/dist/features/3d/services/Shader.d.ts +22 -0
  263. package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
  264. package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
  265. package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
  266. package/dist/features/3d/services/TextureLoader.d.ts +40 -0
  267. package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
  268. package/dist/features/3d/services/ToneMapping.d.ts +12 -0
  269. package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
  270. package/dist/features/3d/splats/SplatData.d.ts +136 -0
  271. package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
  272. package/dist/features/3d/splats/SplatShader.d.ts +14 -0
  273. package/dist/features/3d/splats/SplatSort.d.ts +69 -0
  274. package/dist/features/3d/splats/Splats.d.ts +116 -0
  275. package/dist/features/3d/text/FontAtlas.d.ts +246 -0
  276. package/dist/features/3d/text/SDF.d.ts +28 -0
  277. package/dist/features/3d/text/Text.d.ts +179 -0
  278. package/dist/features/3d/text/TextLayout.d.ts +73 -0
  279. package/dist/features/3d/text/TextShader.d.ts +12 -0
  280. package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
  281. package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
  282. package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
  283. package/dist/features/3d/tiles/TileContent.d.ts +35 -0
  284. package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
  285. package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
  286. package/dist/features/3d/tiles/Tileset.d.ts +81 -0
  287. package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
  288. package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
  289. package/dist/features/3d/tools/Color.d.ts +11 -0
  290. package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
  291. package/dist/features/3d/tools/Options.d.ts +15 -0
  292. package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
  293. package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
  294. package/dist/features/3d/tools/Primitives.d.ts +164 -0
  295. package/dist/features/3d/tools/Ready.d.ts +12 -0
  296. package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
  297. package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
  298. package/dist/features/3d/tools/math/mat3.d.ts +7 -0
  299. package/dist/features/3d/tools/math/mat4.d.ts +19 -0
  300. package/dist/features/3d/tools/math/quat.d.ts +6 -0
  301. package/dist/features/3d/tools/math/vec3.d.ts +16 -0
  302. package/dist/features/3d/tools/math/vec4.d.ts +5 -0
  303. package/dist/features/3d/types.d.ts +359 -0
  304. package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
  305. package/dist/features/3d/usdz/USDScene.d.ts +20 -0
  306. package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
  307. package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
  308. package/dist/features/3d/webgpu/Backend.d.ts +40 -0
  309. package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
  310. package/dist/features/3d/webgpu/Constants.d.ts +32 -0
  311. package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
  312. package/dist/features/3d/webgpu/Environment.d.ts +66 -0
  313. package/dist/features/3d/webgpu/Features.d.ts +68 -0
  314. package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
  315. package/dist/features/3d/webgpu/Lines.d.ts +40 -0
  316. package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
  317. package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
  318. package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
  319. package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
  320. package/dist/features/3d/webgpu/Particles.d.ts +114 -0
  321. package/dist/features/3d/webgpu/Picking.d.ts +59 -0
  322. package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
  323. package/dist/features/3d/webgpu/Points.d.ts +41 -0
  324. package/dist/features/3d/webgpu/Probes.d.ts +45 -0
  325. package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
  326. package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
  327. package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
  328. package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
  329. package/dist/features/3d/webgpu/Splats.d.ts +47 -0
  330. package/dist/features/3d/webgpu/Textures.d.ts +52 -0
  331. package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
  332. package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
  333. package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
  334. package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
  335. package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
  336. package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
  337. package/dist/features/3d/xr/XR.d.ts +100 -0
  338. package/dist/gltf-By-n0qEg.js +960 -0
  339. package/dist/index.d.ts +86 -81
  340. package/dist/model/document-actions/document-commands.d.ts +18 -0
  341. package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
  342. package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
  343. package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
  344. package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
  345. package/dist/model/documents/svg/svg-values.d.ts +16 -0
  346. package/dist/model/documents/svg/svg-xml.d.ts +18 -0
  347. package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
  348. package/dist/model/input/NovaInputValidationController.d.ts +1 -1
  349. package/dist/model/input/NovaTextInputController.d.ts +1 -1
  350. package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
  351. package/dist/model/input/index.d.ts +7 -7
  352. package/dist/model/input/nova-input.types.d.ts +1 -1
  353. package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
  354. package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
  355. package/dist/model/lighting/lighting-shaders.d.ts +3 -0
  356. package/dist/model/lighting/lighting-state.d.ts +27 -0
  357. package/dist/model/lighting/lighting.types.d.ts +107 -0
  358. package/dist/model/lottie/LottieNode.d.ts +4 -0
  359. package/dist/model/lottie/lottie.types.d.ts +83 -0
  360. package/dist/model/lottie/prepare-lottie.d.ts +3 -0
  361. package/dist/model/lottie/sample-position.d.ts +9 -0
  362. package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
  363. package/dist/model/motion/nova-motion-easing.d.ts +1 -1
  364. package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
  365. package/dist/model/motion/nova-motion-presets.d.ts +2 -2
  366. package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
  367. package/dist/model/platform/NovaCanvas.d.ts +7 -6
  368. package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
  369. package/dist/model/primitives/definePrimitive.d.ts +5 -0
  370. package/dist/model/primitives/primitive.types.d.ts +28 -0
  371. package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
  372. package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
  373. package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
  374. package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
  375. package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
  376. package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
  377. package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
  378. package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
  379. package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
  380. package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
  381. package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
  382. package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
  383. package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
  384. package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
  385. package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
  386. package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
  387. package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
  388. package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
  389. package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
  390. package/dist/model/render/effects/blur.d.ts +8 -0
  391. package/dist/model/render/effects/color-matrix.d.ts +8 -0
  392. package/dist/model/render/effects/drop-shadow.d.ts +18 -0
  393. package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
  394. package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
  395. package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
  396. package/dist/model/render/effects/shader-effect.d.ts +64 -0
  397. package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
  398. package/dist/model/render/geometry/nova-composition.d.ts +9 -0
  399. package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
  400. package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
  401. package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
  402. package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
  403. package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
  404. package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
  405. package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
  406. package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
  407. package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
  408. package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
  409. package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
  410. package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
  411. package/dist/model/render/graph/nova-render-group.d.ts +1 -1
  412. package/dist/model/render/graph/nova-render-item.d.ts +2 -2
  413. package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
  414. package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
  415. package/dist/model/render/graph/nova-render-program.d.ts +5 -3
  416. package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
  417. package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
  418. package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
  419. package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
  420. package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
  421. package/dist/model/render/meshes/MeshNode.d.ts +13 -0
  422. package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
  423. package/dist/model/render/meshes/geometry.d.ts +7 -0
  424. package/dist/model/render/meshes/mesh.d.ts +3 -0
  425. package/dist/model/render/meshes/mesh.types.d.ts +116 -0
  426. package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
  427. package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
  428. package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
  429. package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
  430. package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
  431. package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
  432. package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
  433. package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
  434. package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
  435. package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
  436. package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
  437. package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
  438. package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
  439. package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
  440. package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
  441. package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
  442. package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
  443. package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
  444. package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
  445. package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
  446. package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
  447. package/dist/model/runtime/app/Nova.d.ts +35 -35
  448. package/dist/model/runtime/app/NovaApp.d.ts +58 -30
  449. package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
  450. package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
  451. package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
  452. package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
  453. package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
  454. package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
  455. package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
  456. package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
  457. package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
  458. package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
  459. package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
  460. package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
  461. package/dist/model/runtime/context/nova-context.d.ts +1 -1
  462. package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
  463. package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
  464. package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
  465. package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
  466. package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
  467. package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
  468. package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
  469. package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
  470. package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
  471. package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
  472. package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
  473. package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
  474. package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
  475. package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
  476. package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
  477. package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
  478. package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
  479. package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
  480. package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
  481. package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
  482. package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
  483. package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
  484. package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
  485. package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
  486. package/dist/model/text-selection/index.d.ts +2 -2
  487. package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
  488. package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
  489. package/dist/model/theme/NovaThemeService.d.ts +5 -3
  490. package/dist/model/theme/createTokenTheme.d.ts +15 -0
  491. package/dist/model/tools/transform-tools.d.ts +43 -0
  492. package/dist/nodes--Ds4IS2h.js +621 -0
  493. package/dist/nova-color-parser-BCN_rFRN.js +250 -0
  494. package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
  495. package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
  496. package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
  497. package/dist/nova-text-paint-CcntsRjI.js +48 -0
  498. package/dist/tokens.d.ts +2 -0
  499. package/dist/tokens.js +50 -0
  500. package/dist/vec4-BTNv1fUp.js +20 -0
  501. package/package.json +229 -4
@@ -0,0 +1,3 @@
1
+ /** Shared instance vertex attributes used by basic, PBR and shadow programs. */
2
+ export declare const instanceDeclarations3D = "\nlayout(location=4) in vec4 instanceColumn0;\nlayout(location=5) in vec4 instanceColumn1;\nlayout(location=6) in vec4 instanceColumn2;\nlayout(location=7) in vec4 instanceColumn3;\nuniform bool instanced;\nflat out float instanceParity;\n#ifdef NOVA_NO_INSTANCE\nmat4 localInstance(){return mat4(1.0);}\n#else\nmat4 localInstance(){return instanced?mat4(instanceColumn0,instanceColumn1,instanceColumn2,instanceColumn3):mat4(1.0);}\n#endif\n";
3
+ export declare const instanceFragment3D = "\nflat in float instanceParity;\nuniform int surfaceSide;\nuniform bool instanced;\nuniform bool hasSkin;\nbool logicalFront(){return gl_FrontFacing==(instanceParity>=0.0);}\nvoid cullInstance(){if(!instanced&&!hasSkin)return;if((surfaceSide==0&&!logicalFront())||(surfaceSide==1&&logicalFront()))discard;}\n";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Wide lines as one instanced quad per segment. Instance data per segment:
3
+ * start xyz, end xyz, cumulative distance at start and end (8 floats), plus
4
+ * linear RGBA at start and end when the geometry has colours (8 floats).
5
+ */
6
+ export declare const lineSegmentFloats3D = 8;
7
+ export interface LineVariant3D {
8
+ colors: boolean;
9
+ dashed: boolean;
10
+ worldUnits: boolean;
11
+ /** 0 opaque, 1 mask, 2 blend. */
12
+ mode: 0 | 1 | 2;
13
+ direct: boolean;
14
+ fog: 0 | 1 | 2 | 3;
15
+ }
16
+ export declare function lineVariantKey3D(variant: LineVariant3D): number;
17
+ /**
18
+ * Six vertices per segment (two triangles) expand the segment by half the width
19
+ * on every side; the fragment stage rounds both ends, so consecutive segments
20
+ * join without gaps.
21
+ */
22
+ export declare function lineVertexSource3D(variant: LineVariant3D): string;
23
+ export declare function lineFragmentSource3D(variant: LineVariant3D): string;
24
+ /**
25
+ * Packs the segments of a 'lines' geometry (pairs, optionally indexed) into
26
+ * instance data with cumulative distances along the drawing order.
27
+ */
28
+ export declare function packLineSegments3D(positions: Float32Array, indices: Uint16Array | Uint32Array | undefined, colors: Float32Array | undefined, start: number, count: number): {
29
+ segments: Float32Array;
30
+ colors: Float32Array | null;
31
+ count: number;
32
+ };
@@ -0,0 +1,115 @@
1
+ import { mat4 as Matrix4 } from 'gl-matrix';
2
+ import { Nova3DEnvironment } from '../model/Environment.js';
3
+ import { Nova3DLight } from '../model/Light.js';
4
+ import { Nova3DMesh } from '../model/Mesh.js';
5
+ import { SceneFog3D } from '../model/Scene.js';
6
+ import { Nova3DTexture } from '../model/Texture.js';
7
+ import { ClusterBinding3D } from './ClusteredLights.js';
8
+ import { GLState3D } from './GLState.js';
9
+ import { ShadowBinding3D } from './ShadowMaps.js';
10
+ /** A captured reflection probe and its world influence box. */
11
+ export interface ProbeBinding3D {
12
+ readonly probe: {
13
+ readonly intensity: number;
14
+ readonly boxProjection: boolean;
15
+ };
16
+ diffuse: WebGLTexture | null;
17
+ specular: WebGLTexture | null;
18
+ readonly center: Float32Array;
19
+ readonly min: Float32Array;
20
+ readonly max: Float32Array;
21
+ }
22
+ /** Folded ambient and hemisphere irradiance of one scene. */
23
+ export interface SceneAmbient3D {
24
+ readonly constant: Float32Array;
25
+ readonly linear: Float32Array;
26
+ /** Five RGB quadratic SH terms (15 numbers). */
27
+ readonly quadratic: Float32Array;
28
+ }
29
+ /**
30
+ * Owns the metallic-roughness program variants for one device generation.
31
+ * Light count, shadow count, environment and material maps are compiled in.
32
+ */
33
+ export declare class PBRProgram3D {
34
+ private readonly _gl;
35
+ private readonly _state;
36
+ /** Keyed by the numeric variant id, or `id:vertexMode` for instanced and deformed meshes. */
37
+ private readonly _variants;
38
+ /** Node-material variants: numeric key and interned surface id. */
39
+ private readonly _nodeVariants;
40
+ private _frame?;
41
+ private _frameStamp;
42
+ private _frameKey;
43
+ private _frameExtra;
44
+ private _cascadeSlot;
45
+ private _pcf;
46
+ private _pcss;
47
+ private _rect;
48
+ private _shadowPoisson;
49
+ private _shadowCube;
50
+ private _pointLights;
51
+ private _spotLights;
52
+ /** Frame feature combinations interned to small ids for the variant key (2^30 to 2^36). */
53
+ private readonly _frameClasses;
54
+ /** LTC tables as a 64×64×2 RGBA16F array (unit 14), created with the first area light. */
55
+ private _areaTexture?;
56
+ /** Split-sum DFG table (32² RG16F, unit 19), created with the first frame. */
57
+ private _dfgTexture?;
58
+ private _compiled;
59
+ /** Extension layout of the node that _variantFor keyed last. */
60
+ private _extensions;
61
+ /** Sampler object last bound at unit 15. */
62
+ private _sampler;
63
+ /** Copy of the current view behind transmissive meshes, set by the renderer. */
64
+ private readonly _transmission;
65
+ /** Sets the opaque copy that transmissive meshes of the current view refract. */
66
+ setTransmission(texture: WebGLTexture | null, viewProjection: ArrayLike<number>, x: number, y: number, width: number, height: number, lod: number): void;
67
+ constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
68
+ /** True once after a new variant was linked; the renderer then verifies the frame. */
69
+ takeCompiled(): boolean;
70
+ prepare(projection: Matrix4, camera: Matrix4, lights: readonly Nova3DLight[], shadows: readonly ShadowBinding3D[], environment?: {
71
+ environment: Nova3DEnvironment;
72
+ diffuse: WebGLTexture;
73
+ specular: WebGLTexture;
74
+ }, direct?: boolean, exposure?: number, toneMapping?: number, fog?: SceneFog3D | null, eye?: Float32Array, forward?: Float32Array, ambient?: SceneAmbient3D | null, probes?: readonly ProbeBinding3D[], clusters?: ClusterBinding3D | null): void;
75
+ /** True until the first variant of this device generation was submitted. */
76
+ get empty(): boolean;
77
+ /**
78
+ * Submits, without waiting for the driver, the variants that `nodes` will need in a
79
+ * frame with these lights, of which `shadowed` cast shadow maps (the same keys prepare
80
+ * and bind compute), so the first frame compiles them while it uploads and renders
81
+ * shadows. Variants are checked at their first bind, as compiled ones are.
82
+ */
83
+ precompile(nodes: readonly Nova3DMesh[], lights: readonly Nova3DLight[], shadowed: readonly Nova3DLight[], environment: boolean, ambient: boolean, fog: SceneFog3D | null): void;
84
+ /** Frame-level bits of the variant key: lights, shadows, environment, ambient and the frame class. */
85
+ private _keyFrame;
86
+ /** Selects and prepares the variant for `node`; returns the program to draw with. */
87
+ bind(node: Nova3DMesh, texture: (source: Nova3DTexture) => WebGLTexture): WebGLProgram;
88
+ /**
89
+ * The variant for `node` in `frame` (submitted when new), keyed by the frame bits and
90
+ * the node's material, geometry and instancing. Leaves the extension layout in _extensions.
91
+ */
92
+ private _variantFor;
93
+ /** Binds the smallest probe box holding the mesh origin, or the scene environment. */
94
+ private _bindProbe;
95
+ private _uploadExtensions;
96
+ /** Uploads node uniforms and binds node textures after the extension units. */
97
+ private _uploadNodes;
98
+ private _areaTables;
99
+ /** Split-sum DFG table of EnvironmentBRDF.ts; node textures end at unit 17 and clusters use 18. */
100
+ private _dfgTable;
101
+ destroy(): void;
102
+ private _dropVariants;
103
+ /**
104
+ * Submits the variant for `key` (`id` is its numeric key, see bind) without waiting for
105
+ * the driver; bind resolves it at first use.
106
+ */
107
+ private _compile;
108
+ /**
109
+ * Checks a submitted variant and locates its uniforms. CPU work that the first frame
110
+ * needs anyway (the DFG table) runs before the check, while the driver compiles.
111
+ */
112
+ private _resolve;
113
+ private _uploadFrame;
114
+ private _map;
115
+ }
@@ -0,0 +1,50 @@
1
+ import { Nova3DEnvironment } from '../model/Environment.js';
2
+ import { Nova3DGeometry } from '../model/Geometry.js';
3
+ import { Nova3DMesh } from '../model/Mesh.js';
4
+ import { Nova3DNode } from '../model/Node.js';
5
+ import { Nova3DRenderTarget } from '../model/RenderTarget.js';
6
+ import { Nova3DTexture } from '../model/Texture.js';
7
+ import { FrameMetrics3D } from '../types.js';
8
+ import { Backend3D } from '../webgpu/Features.js';
9
+ import { ToneMapping3D } from './ToneMapping.js';
10
+ import { Color3DTuple, RenderView3D } from './WebGLRenderer.js';
11
+ /**
12
+ * What an app needs from its rendering backend. WebGL2 and WebGPU renderers
13
+ * implement it; backend-only services (effects, XR) narrow to the WebGL renderer.
14
+ */
15
+ export interface Renderer3D {
16
+ readonly backend: Backend3D;
17
+ /** Advances whenever GPU resources were dropped and recreated (context or device loss). */
18
+ readonly generation: number;
19
+ /** Largest canvas or render-target side in device pixels. */
20
+ readonly maxSize: number;
21
+ readonly estimatedGpuBytes: number;
22
+ readonly environmentBytes: number;
23
+ readonly shadowBytes: number;
24
+ readonly targetBytes: number;
25
+ readonly geometryCount: number;
26
+ readonly textureCount: number;
27
+ configureDisplay: (options: {
28
+ exposure?: number;
29
+ toneMapping?: ToneMapping3D;
30
+ blending?: 'linear' | 'display';
31
+ }) => void;
32
+ validateSize: (width: number, height: number) => void;
33
+ /** Re-reads the canvas size after a resize; `pixelRatio` scales pixel-sized features. */
34
+ syncDrawingBuffer: (pixelRatio?: number) => void;
35
+ /** Renders render-target views first, then canvas views; null when the frame was skipped (lost device). */
36
+ render: (views: readonly RenderView3D[], clearColor: Color3DTuple) => FrameMetrics3D | null;
37
+ /** Clears the canvas when the app has no views. */
38
+ clear: (color: Color3DTuple) => void;
39
+ pickGPU: (view: RenderView3D, pixel: readonly [number, number], size: readonly [number, number]) => Promise<{
40
+ node: Nova3DMesh;
41
+ instance: number;
42
+ point: [number, number, number];
43
+ } | null>;
44
+ releaseNode: (node: Nova3DNode) => void;
45
+ releaseGeometry: (geometry: Nova3DGeometry) => void;
46
+ releaseTexture: (texture: Nova3DTexture) => void;
47
+ releaseEnvironment: (environment: Nova3DEnvironment) => void;
48
+ releaseRenderTarget: (target: Nova3DRenderTarget) => void;
49
+ destroy: () => void;
50
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A program whose shaders were compiled and linked without any status query: the
3
+ * driver (ANGLE, KHR_parallel_shader_compile) works on it while the caller goes on.
4
+ * finishProgram3D checks it at first use; discardProgram3D drops an unused one.
5
+ */
6
+ export interface PendingProgram3D {
7
+ readonly program: WebGLProgram;
8
+ readonly vertex: WebGLShader;
9
+ readonly fragment: WebGLShader;
10
+ }
11
+ /** Submits `vertex` and `fragment`, attaches and links them; no call waits for the driver. */
12
+ export declare function beginProgram3D(gl: WebGL2RenderingContext, vertex: string, fragment: string): PendingProgram3D;
13
+ /**
14
+ * Waits for a begun program once (the link status) and returns it. A failure reports
15
+ * the vertex, then the fragment compile log, then the link log, as a sequential
16
+ * compile would, and deletes the program.
17
+ */
18
+ export declare function finishProgram3D(gl: WebGL2RenderingContext, pending: PendingProgram3D): WebGLProgram;
19
+ /** Deletes a begun program that was never finished. */
20
+ export declare function discardProgram3D(gl: WebGL2RenderingContext, pending: PendingProgram3D): void;
21
+ /** Compiles and links a program, checking it with a single status query. */
22
+ export declare function linkProgram3D(gl: WebGL2RenderingContext, vertex: string, fragment: string): WebGLProgram;
@@ -0,0 +1,38 @@
1
+ import { ShaderMaterialState3D, ShaderUniformValue3D } from '../model/Material.js';
2
+ import { Nova3DTexture } from '../model/Texture.js';
3
+ import { GLState3D } from './GLState.js';
4
+ /** Frame-level inputs of shader materials. */
5
+ export interface ShaderFrame3D {
6
+ readonly viewProjection: Float32Array;
7
+ readonly view: Float32Array;
8
+ readonly projection: Float32Array;
9
+ readonly cameraPosition: Float32Array;
10
+ readonly stamp: number;
11
+ }
12
+ /** Variant bits that change the generated prelude. */
13
+ export interface ShaderVariant3D {
14
+ instanced: boolean;
15
+ /** 0 opaque, 1 mask, 2 blend. */
16
+ mode: 0 | 1 | 2;
17
+ direct: boolean;
18
+ coverage: boolean;
19
+ }
20
+ /** Default vertex stage: world position, normal and UVs for the fragment stage. */
21
+ export declare const defaultShaderVertex3D = "out vec3 vWorldPosition;\nout vec3 vWorldNormal;\nout vec2 vUv;\nvoid main(){\n vec4 world=novaWorldPosition(position);\n vWorldPosition=world.xyz;\n vWorldNormal=novaWorldNormal(normal);\n vUv=uv;\n gl_Position=viewProjectionMatrix*world;\n}";
22
+ /**
23
+ * Compiles and caches shader-material programs per source and variant, and
24
+ * uploads uniforms only when the frame, the node or the material values change.
25
+ */
26
+ export declare class ShaderPrograms3D {
27
+ private readonly _gl;
28
+ private readonly _state;
29
+ private readonly _programs;
30
+ private _compiled;
31
+ constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
32
+ /** True once after a new program was linked; the renderer then verifies the frame. */
33
+ takeCompiled(): boolean;
34
+ bind(material: object, options: Readonly<ShaderMaterialState3D>, values: ReadonlyMap<string, ShaderUniformValue3D>, uniformVersion: number, variant: ShaderVariant3D, frame: ShaderFrame3D, world: Float32Array, normal: Float32Array, texture: (source: Nova3DTexture) => WebGLTexture, exposure: number, toneMapping: number): WebGLProgram;
35
+ destroy(): void;
36
+ private _compile;
37
+ private _uploadValue;
38
+ }
@@ -0,0 +1,97 @@
1
+ import { mat4 as Matrix4 } from 'gl-matrix';
2
+ import { Nova3DCamera } from '../model/Camera.js';
3
+ import { Nova3DLight } from '../model/Light.js';
4
+ import { Nova3DMesh } from '../model/Mesh.js';
5
+ import { Nova3DTexture } from '../model/Texture.js';
6
+ import { GLState3D } from './GLState.js';
7
+ export interface ShadowAtlas3D {
8
+ texture: WebGLTexture | null;
9
+ /** Sampler without depth comparison, for PCSS blocker searches. */
10
+ sampler: WebGLSampler | null;
11
+ /** Side in texels (0 without residents). */
12
+ size: number;
13
+ }
14
+ export interface ShadowBinding3D {
15
+ light: Nova3DLight;
16
+ atlas: ShadowAtlas3D;
17
+ cube: boolean;
18
+ /** View-projection per face or cascade; reused across frames. */
19
+ matrices: Matrix4[];
20
+ bytes: number;
21
+ resolution: number;
22
+ /** Cascades of a directional light (1 otherwise); the tile holds 2×1 or 2×2 cells. */
23
+ cascades: number;
24
+ /** Tile size in texels: one cell, 2×1 or 2×2 cascades, or 3×2 cube faces. */
25
+ width: number;
26
+ height: number;
27
+ /** Tile origin in the atlas, texels. */
28
+ x: number;
29
+ y: number;
30
+ /** Far view depth of each cascade from the fitted camera. */
31
+ readonly splits: Float32Array;
32
+ /** Per cascade: near, far and texels per world unit, for PCSS. */
33
+ readonly frustums: Float32Array;
34
+ }
35
+ /** Camera the cascades of a scene are fitted to. */
36
+ export interface ShadowCamera3D {
37
+ readonly camera: Nova3DCamera;
38
+ readonly aspect: number;
39
+ }
40
+ export declare const casterVertexSource3D = "#version 300 es\n\nlayout(location=4) in vec4 instanceColumn0;\nlayout(location=5) in vec4 instanceColumn1;\nlayout(location=6) in vec4 instanceColumn2;\nlayout(location=7) in vec4 instanceColumn3;\nuniform bool instanced;\nflat out float instanceParity;\n#ifdef NOVA_NO_INSTANCE\nmat4 localInstance(){return mat4(1.0);}\n#else\nmat4 localInstance(){return instanced?mat4(instanceColumn0,instanceColumn1,instanceColumn2,instanceColumn3):mat4(1.0);}\n#endif\n\n\nprecision highp sampler2D;\nprecision highp sampler2DArray;\nlayout(location=8) in vec4 jointIndices;\nlayout(location=9) in vec4 jointWeights;\nuniform bool hasSkin;\n\nuniform sampler2D skinMatrices;\nuniform int skinOffset;\nuniform sampler2DArray morphAtlas;\nuniform int morphCount;\nuniform int morphWidth;\nuniform float morphWeights[8];\nmat4 jointMatrix(int joint){int entry=skinOffset+joint;ivec2 at=ivec2((entry&255)<<2,entry>>8);return mat4(texelFetch(skinMatrices,at,0),texelFetch(skinMatrices,at+ivec2(1,0),0),texelFetch(skinMatrices,at+ivec2(2,0),0),texelFetch(skinMatrices,at+ivec2(3,0),0));}\n\n#ifdef NOVA_NO_SKIN\nmat4 skinTransform(){return mat4(1.0);}\n#else\nmat4 skinTransform(){if(!hasSkin)return mat4(1.0);return jointMatrix(int(jointIndices.x))*jointWeights.x+jointMatrix(int(jointIndices.y))*jointWeights.y+jointMatrix(int(jointIndices.z))*jointWeights.z+jointMatrix(int(jointIndices.w))*jointWeights.w;}\n#endif\n#ifdef NOVA_NO_MORPH\nvec3 morphDelta(int normalOffset){return vec3(0.0);}\n#else\nvec3 morphDelta(int normalOffset){\n vec3 result=vec3(0.0);if(morphCount==0)return result;\n ivec2 texel=ivec2(gl_VertexID%morphWidth,gl_VertexID/morphWidth);\n for(int target=0;target<8;target++){if(target>=morphCount)break;result+=texelFetch(morphAtlas,ivec3(texel,target*2+normalOffset),0).xyz*morphWeights[target];}\n return result;\n}\n#endif\n\nlayout(location=0) in vec3 position;\nlayout(location=2) in vec2 uv;\nlayout(location=10) in vec2 uv1;\nuniform mat4 world;\nuniform mat4 viewProjection;\n\nuniform mat3 mapTransform;\nuniform bool mapSet;\nout vec2 texCoord;\nvoid main(){\n#if defined(NOVA_NO_INSTANCE)&&defined(NOVA_NO_SKIN)\ninstanceParity=1.0;texCoord=(mapTransform*vec3(mapSet?uv1:uv,1.0)).xy;gl_Position=viewProjection*(world*vec4(position+morphDelta(0),1.0));\n#else\nmat4 instance=localInstance()*skinTransform();instanceParity=determinant(mat3(instance))<0.0?-1.0:1.0;texCoord=(mapTransform*vec3(mapSet?uv1:uv,1.0)).xy;gl_Position=viewProjection*(world*(instance*vec4(position+morphDelta(0),1.0)));\n#endif\n}";
41
+ /**
42
+ * Four opt-in shadow sources per scene in one depth atlas of at most 4096² (64 MiB):
43
+ * spot and directional maps take one cell, cascades 2×1 or 2×2 cells, point lights
44
+ * six faces in 3×2 cells. Tiles are packed once per change of the shadowed set.
45
+ */
46
+ export declare class ShadowMaps3D {
47
+ private readonly _gl;
48
+ private readonly _state;
49
+ private readonly _residents;
50
+ private readonly _atlas;
51
+ private _verified;
52
+ /** The atlas is cleared once per frame, by the first scene that renders shadows. */
53
+ private _clearPending;
54
+ private _program?;
55
+ private _uniforms?;
56
+ private _plainProgram?;
57
+ private _plainUniforms?;
58
+ /** The depth-only program, submitted ahead (prepareProgram) and checked at the first pass. */
59
+ private _pendingPlain?;
60
+ /** Service framebuffer; attachments live only for the duration of a pass. */
61
+ private _framebuffer?;
62
+ private readonly _selected;
63
+ /** Per-scene binding lists reused across frames. */
64
+ private _bindings;
65
+ private _drawCalls;
66
+ constructor(_gl: WebGL2RenderingContext, _state: GLState3D);
67
+ get bytes(): number;
68
+ /**
69
+ * Keeps tiles for exactly the enabled shadows of `lights` (all scenes of the frame)
70
+ * and repacks the atlas when that set changed, before any scene draws its maps.
71
+ */
72
+ reserve(lights: readonly Nova3DLight[]): void;
73
+ /** Submits the depth-only caster program, so the driver compiles it while the frame uploads. */
74
+ prepareProgram(): void;
75
+ /** True while any light owns a shadow map. */
76
+ get active(): boolean;
77
+ /** True while a light of `scene` owns a shadow map. */
78
+ activeFor(scene: object): boolean;
79
+ consumeDrawCalls(): number;
80
+ render(scene: object, lights: readonly Nova3DLight[], meshes: readonly Nova3DMesh[], texture: (value: Nova3DTexture) => WebGLTexture, draw: (node: Nova3DMesh, program: WebGLProgram) => void, camera?: ShadowCamera3D): readonly ShadowBinding3D[];
81
+ private _renderFaces;
82
+ /** Links the discarding caster program (masks, instance and skin culling). */
83
+ private _linkFull;
84
+ /** Shelf-packs every tile, tallest first, into the smallest fitting power-of-two atlas. */
85
+ private _pack;
86
+ private _allocate;
87
+ private _freeAtlas;
88
+ release(light: Nova3DLight): void;
89
+ reset(discard?: boolean): void;
90
+ /** Writes face, slice or cascade matrices into the resident's reused matrices. */
91
+ private _matrices;
92
+ /**
93
+ * Splits the camera frustum (practical scheme) and fits each slice in a stable,
94
+ * texel-snapped orthographic box along the light direction (fitDirection/fitUp).
95
+ */
96
+ private _fitCascades;
97
+ }
@@ -0,0 +1,16 @@
1
+ import { Nova3DMesh } from '../model/Mesh.js';
2
+ import { Bounds3D, Ray3D } from '../types.js';
3
+ /** A derived scene-owned median BVH. Structural edits rebuild lazily, bounds refit. */
4
+ export declare class SpatialIndex3D {
5
+ private readonly _leaves;
6
+ private _root?;
7
+ private _structure;
8
+ private _sequence;
9
+ set(node: Nova3DMesh, bounds: Bounds3D | null): void;
10
+ remove(node: Nova3DMesh): void;
11
+ clear(): void;
12
+ ray(ray: Ray3D, maximum: number): readonly Nova3DMesh[];
13
+ frustum(planes: readonly (readonly number[])[]): readonly Nova3DMesh[];
14
+ private _query;
15
+ private _build;
16
+ }
@@ -0,0 +1,40 @@
1
+ import { Limits3D } from '../loaders/Limits.js';
2
+ import { TextureOptions3D } from '../model/Texture.js';
3
+ /**
4
+ * Options of `app.loadTexture`.
5
+ * @experimental
6
+ */
7
+ export interface TextureLoadOptions3D {
8
+ signal?: AbortSignal;
9
+ /** Colour space of the pixels: 'srgb' (default) for colour, 'linear' for data maps. */
10
+ colorSpace?: 'srgb' | 'linear';
11
+ /** Reads `maxEncodedImageBytes`, `maxDecodedImageBytes` and `maxImageDimension`. */
12
+ limits?: Limits3D;
13
+ }
14
+ /** Internal decode budgets of one image. */
15
+ export interface TextureDecodeOptions3D {
16
+ readonly signal: AbortSignal;
17
+ readonly colorSpace?: 'srgb' | 'linear';
18
+ readonly maxEncodedBytes?: number;
19
+ readonly maxDecodedBytes?: number;
20
+ readonly maxDimension?: number;
21
+ }
22
+ /** Decode budgets of `loadTexture` from its public options, after key and value checks. */
23
+ export declare function textureDecodeOptions3D(options: TextureLoadOptions3D, signal: AbortSignal): TextureDecodeOptions3D;
24
+ /**
25
+ * Reads a bounded stream and checks the image size before the browser decodes it;
26
+ * the app creates the texture from the result.
27
+ */
28
+ export declare function loadTextureSource(document: Document, url: string | URL, options: TextureDecodeOptions3D): Promise<TextureOptions3D>;
29
+ /**
30
+ * Decodes a PNG or JPEG into an ImageBitmap after validating its header, without a
31
+ * canvas round trip: the renderer uploads the bitmap directly, as three.js does.
32
+ * @internal
33
+ */
34
+ export declare function decodeTextureBitmap(encoded: Uint8Array, options: TextureDecodeOptions3D): Promise<{
35
+ image: ImageBitmap;
36
+ width: number;
37
+ height: number;
38
+ }>;
39
+ /** @internal */
40
+ export declare function decodeTextureSource(document: Document, encoded: Uint8Array, options: TextureDecodeOptions3D): Promise<TextureOptions3D>;
@@ -0,0 +1,42 @@
1
+ /** Levels of a full mip chain of `width`×`height`, as both backends allocate it. */
2
+ export declare function mipLevelCount3D(width: number, height: number): number;
3
+ /** Size of `level` along one axis of `size` texels (never below 1). */
4
+ export declare function mipLevelSize3D(size: number, level: number): number;
5
+ /**
6
+ * Builds 2D and 2D-array mip chains with one explicit pass per level, the same pass
7
+ * as the WebGPU backend, instead of gl.generateMipmap, whose filter is driver-defined
8
+ * (ANGLE on Vulkan blits). The pass saves and restores the GL state it touches.
9
+ */
10
+ export declare class TextureMipmaps3D {
11
+ private readonly _gl;
12
+ private readonly _programs;
13
+ /** Submitted programs, checked at their first pass. */
14
+ private readonly _pending;
15
+ /** Internal formats (per target) whose level-1 framebuffer was found complete. */
16
+ private readonly _complete;
17
+ private _framebuffer?;
18
+ private _sampler?;
19
+ /** Capabilities that would clip, discard, blend or dither a level pass. */
20
+ private readonly _capabilities;
21
+ constructor(_gl: WebGL2RenderingContext);
22
+ /**
23
+ * Submits the level-pass program of `target` before a texture of `internal` uploads, so
24
+ * the driver compiles it meanwhile; generate checks it at its first pass.
25
+ */
26
+ prepare(target: number, internal: number): void;
27
+ /** Whether levels of `internal` are renderable; RGBA16F needs a colour-buffer extension. */
28
+ renderable(internal: number): boolean;
29
+ /**
30
+ * Rebuilds levels 1…`levels`−1 of an immutable TEXTURE_2D or TEXTURE_2D_ARRAY of
31
+ * `width`×`height` (`layers` array layers) from level 0, falling back to
32
+ * gl.generateMipmap when its format cannot be rendered. `colorMask`, when the caller
33
+ * knows it, spares the synchronous COLOR_WRITEMASK query.
34
+ */
35
+ generate(texture: WebGLTexture, target: number, internal: number, width: number, height: number, layers: number, levels: number, colorMask?: boolean): void;
36
+ private _program;
37
+ /** Bilinear, clamped and single-level: it overrides the texture's own sampling state. */
38
+ private _ensureSampler;
39
+ private _ensureFramebuffer;
40
+ /** Releases the GL objects; `discard` drops handles of a lost context without deleting them. */
41
+ reset(discard?: boolean): void;
42
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tone mapping operators shared by every encoding path; formulas follow three.js r186.
3
+ * @experimental
4
+ */
5
+ export type ToneMapping3D = 'none' | 'reinhard' | 'cineon' | 'aces' | 'agx' | 'neutral';
6
+ export declare const toneMappings3D: readonly ToneMapping3D[];
7
+ export declare function toneMappingIndex3D(mode: ToneMapping3D): number;
8
+ /**
9
+ * `novaToneMap(color, exposure, mode)` returns display-referred linear RGB in [0,1];
10
+ * mode is the index in `toneMappings3D`.
11
+ */
12
+ export declare const toneMappingChunk3D = "\nvec3 novaRRTAndODTFit(vec3 v){vec3 a=v*(v+0.0245786)-0.000090537;vec3 b=v*(0.983729*v+0.4329510)+0.238081;return a/b;}\nvec3 novaAgXContrast(vec3 x){vec3 x2=x*x;vec3 x4=x2*x2;return 15.5*x4*x2-40.14*x4*x+31.96*x4-6.868*x2*x+0.4298*x2+0.1191*x-0.00232;}\nvec3 novaToneMap(vec3 color,float exposure,int mode){\n color=max(color,vec3(0.0))*exposure;\n if(mode==1)color=color/(vec3(1.0)+color);\n else if(mode==2){color=max(vec3(0.0),color-0.004);color=pow((color*(6.2*color+0.5))/(color*(6.2*color+1.7)+0.06),vec3(2.2));}\n else if(mode==3){\n const mat3 inputMat=mat3(vec3(0.59719,0.07600,0.02840),vec3(0.35458,0.90834,0.13383),vec3(0.04823,0.01566,0.83777));\n const mat3 outputMat=mat3(vec3(1.60475,-0.10208,-0.00327),vec3(-0.53108,1.10813,-0.07276),vec3(-0.07367,-0.00605,1.07602));\n color=outputMat*novaRRTAndODTFit(inputMat*(color/0.6));\n }\n else if(mode==4){\n const mat3 toRec2020=mat3(vec3(0.6274,0.0691,0.0164),vec3(0.3293,0.9195,0.0880),vec3(0.0433,0.0113,0.8956));\n const mat3 fromRec2020=mat3(vec3(1.6605,-0.1246,-0.0182),vec3(-0.5876,1.1329,-0.1006),vec3(-0.0728,-0.0083,1.1187));\n const mat3 inset=mat3(vec3(0.856627153315983,0.137318972929847,0.11189821299995),vec3(0.0951212405381588,0.761241990602591,0.0767994186031903),vec3(0.0482516061458583,0.101439036467562,0.811302368396859));\n const mat3 outset=mat3(vec3(1.1271005818144368,-0.1413297634984383,-0.14132976349843826),vec3(-0.11060664309660323,1.157823702216272,-0.11060664309660294),vec3(-0.016493938717834573,-0.016493938717834257,1.2519364065950405));\n color=inset*(toRec2020*color);\n color=clamp((log2(max(color,1e-10))+12.47393)/(4.026069+12.47393),0.0,1.0);\n color=outset*novaAgXContrast(color);\n color=fromRec2020*pow(max(vec3(0.0),color),vec3(2.2));\n }\n else if(mode==5){\n float x=min(color.r,min(color.g,color.b));\n color-=x<0.08?x-6.25*x*x:0.04;\n float peak=max(color.r,max(color.g,color.b));\n if(peak>=0.76){\n float d=0.24;\n float newPeak=1.0-d*d/(peak+d-0.76);\n color*=newPeak/peak;\n color=mix(color,vec3(newPeak),1.0-1.0/(0.15*(peak-newPeak)+1.0));\n }\n }\n return clamp(color,0.0,1.0);\n}\nvec3 novaEncodeSRGB(vec3 linear){return mix(12.92*linear,1.055*pow(linear,vec3(1.0/2.4))-0.055,step(vec3(0.0031308),linear));}\n";