@babylonjs/lite 1.7.0 → 1.8.0

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 (78) hide show
  1. package/CHANGELOG.md +735 -0
  2. package/README.md +26 -1
  3. package/THIRD_PARTY_NOTICES.txt +139 -0
  4. package/dist/index.js +292 -277
  5. package/dist/index.js.map +1 -1
  6. package/index.d.ts +277 -11
  7. package/lib/_chunks/vendor/{manifold-Sh8xE2da.js → manifold-DtI3BJoR.js} +2 -2
  8. package/lib/_chunks/vendor/{manifold-Sh8xE2da.js.map → manifold-DtI3BJoR.js.map} +1 -1
  9. package/lib/animation/animation-group-task.js +1 -1
  10. package/lib/animation/animation-group-task.js.map +1 -1
  11. package/lib/animation/animation-group.js +20 -15
  12. package/lib/animation/animation-group.js.map +1 -1
  13. package/lib/animation/animation-tick.js +10 -0
  14. package/lib/animation/animation-tick.js.map +1 -0
  15. package/lib/animation/property-animation.js +2 -1
  16. package/lib/animation/property-animation.js.map +1 -1
  17. package/lib/animation/weighted-gltf-mixer.js +1 -1
  18. package/lib/animation/weighted-gltf-mixer.js.map +1 -1
  19. package/lib/animation/weighted-pointer-mixer.js +1 -1
  20. package/lib/animation/weighted-pointer-mixer.js.map +1 -1
  21. package/lib/engine/device-lost-recovery.js +1 -0
  22. package/lib/engine/device-lost-recovery.js.map +1 -1
  23. package/lib/engine/engine.js +1 -1
  24. package/lib/engine/null-engine.js +29 -0
  25. package/lib/engine/null-engine.js.map +1 -0
  26. package/lib/frame-graph/depth-pyramid.js +158 -0
  27. package/lib/frame-graph/depth-pyramid.js.map +1 -0
  28. package/lib/frame-graph/frame-graph-actions.js +10 -1
  29. package/lib/frame-graph/frame-graph-actions.js.map +1 -1
  30. package/lib/frame-graph/render-task.js +7 -0
  31. package/lib/frame-graph/render-task.js.map +1 -1
  32. package/lib/frame-graph/transmission-depth-grab.js +88 -0
  33. package/lib/frame-graph/transmission-depth-grab.js.map +1 -0
  34. package/lib/frame-graph/transmission.js +30 -1
  35. package/lib/frame-graph/transmission.js.map +1 -1
  36. package/lib/gizmo/bounding-box-gizmo.js +1 -1
  37. package/lib/index.js +8 -6
  38. package/lib/index.js.map +1 -1
  39. package/lib/loader-gltf/gltf-feature-gpu-instancing.js +1 -1
  40. package/lib/loader-gltf/gltf-interleave.js +1 -1
  41. package/lib/loader-gltf/load-gltf.js +1 -1
  42. package/lib/material/shader/shader-pipeline.js +1 -1
  43. package/lib/material/shader/shader-pipeline.js.map +1 -1
  44. package/lib/material/shader/shader-renderable.js +23 -8
  45. package/lib/material/shader/shader-renderable.js.map +1 -1
  46. package/lib/math/aabb.js +1 -1
  47. package/lib/math/compute-aabb.js +63 -1
  48. package/lib/math/compute-aabb.js.map +1 -1
  49. package/lib/math/index.js +1 -1
  50. package/lib/mesh/csg2.js +3 -2
  51. package/lib/mesh/csg2.js.map +1 -1
  52. package/lib/mesh/mesh-factories.js +1 -1
  53. package/lib/mesh/thin-instance-gpu-culling.js +4 -2
  54. package/lib/mesh/thin-instance-gpu-culling.js.map +1 -1
  55. package/lib/mesh/thin-instance.js +8 -1
  56. package/lib/mesh/thin-instance.js.map +1 -1
  57. package/lib/navigation/index.js +1 -1
  58. package/lib/navigation/navigation.js +9 -1
  59. package/lib/navigation/navigation.js.map +1 -1
  60. package/lib/physics/character-controller.js +2 -2
  61. package/lib/physics/character-controller.js.map +1 -1
  62. package/lib/physics/havok-floating-origin.js +2 -2
  63. package/lib/physics/havok-floating-origin.js.map +1 -1
  64. package/lib/physics/havok.js +40 -13
  65. package/lib/physics/havok.js.map +1 -1
  66. package/lib/picking/gpu-picker.js +16 -2
  67. package/lib/picking/gpu-picker.js.map +1 -1
  68. package/lib/scene/scene-core.js +9 -3
  69. package/lib/scene/scene-core.js.map +1 -1
  70. package/lib/scene/scene-remove.js +8 -0
  71. package/lib/scene/scene-remove.js.map +1 -1
  72. package/lib/texture/pixels-texture.js +31 -1
  73. package/lib/texture/pixels-texture.js.map +1 -1
  74. package/lib/vat/vat-baker.js +41 -2
  75. package/lib/vat/vat-baker.js.map +1 -1
  76. package/package.json +15 -3
  77. package/lib/_chunks/__vite-browser-external-BFTKbDcV.js +0 -68
  78. package/lib/_chunks/__vite-browser-external-BFTKbDcV.js.map +0 -1
package/README.md CHANGED
@@ -37,6 +37,29 @@ main().catch(console.error);
37
37
  Full documentation is available at
38
38
  [https://doc.babylonjs.com/lite/](https://doc.babylonjs.com/lite/).
39
39
 
40
+ ## Headless simulation (null engine)
41
+
42
+ Babylon Lite can run **without a GPU or canvas** for server-side physics,
43
+ deterministic simulation, or CI — the Lite analogue of Babylon.js `NullEngine`.
44
+ Use `createNullEngine()` instead of `createEngine()`, and drive the loop
45
+ yourself with `stepScene()`:
46
+
47
+ ```ts
48
+ import { createNullEngine, stepScene, createSceneContext } from "@babylonjs/lite";
49
+
50
+ const engine = createNullEngine(); // no device, no canvas — synchronous
51
+ const scene = createSceneContext(engine, { defaultRenderTask: false });
52
+
53
+ // ...add physics bodies / onBeforeRender callbacks...
54
+
55
+ for (let i = 0; i < 180; i++) stepScene(engine, scene, 1000 / 60); // simulate 3s
56
+ ```
57
+
58
+ It needs no WebGPU and runs on plain Node (recommended), Deno, Web Workers, or
59
+ CI. Rendering is out of scope. See the
60
+ [Headless (Null Engine) guide](https://doc.babylonjs.com/lite/05-headless-null-engine) for details,
61
+ supported runtimes, and limitations.
62
+
40
63
  ## License
41
64
 
42
65
  [Apache-2.0](./LICENSE)
@@ -44,7 +67,9 @@ Full documentation is available at
44
67
  `@babylonjs/lite` is a derivative of [Babylon.js](https://www.babylonjs.com/)
45
68
  (Apache-2.0). It bundles a small number of third-party runtime libraries
46
69
  (`manifold-3d`, `@recast-navigation/*`, `text-shaper`) whose code ships inside
47
- the published package. Their license texts are reproduced in
70
+ the published package. Their license texts — together with those of the
71
+ upstream native components embedded in their WebAssembly (Recast &amp; Detour and
72
+ the Emscripten runtime) — are reproduced in
48
73
  [THIRD_PARTY_NOTICES.txt](./THIRD_PARTY_NOTICES.txt).
49
74
 
50
75
  Development-only tooling (build, test, and lint frameworks) is **not** part of
@@ -316,3 +316,142 @@ SOFTWARE.
316
316
 
317
317
  Portions of the rasterizer are based on FreeType (https://freetype.org).
318
318
  FreeType is copyright (c) 1996-2024 The FreeType Project.
319
+
320
+ ==============================================================================
321
+ Bundled upstream components
322
+ ==============================================================================
323
+
324
+ The following native/runtime components are compiled into the WebAssembly
325
+ artifacts of the packages above. Their upstream licenses are reproduced here.
326
+
327
+ ==============================================================================
328
+ Recast & Detour (recastnavigation)
329
+ Embedded by: @recast-navigation/wasm
330
+ Source: https://github.com/recastnavigation/recastnavigation
331
+ ==============================================================================
332
+
333
+ Copyright (c) 2009 Mikko Mononen memon@inside.org
334
+
335
+ This software is provided 'as-is', without any express or implied
336
+ warranty. In no event will the authors be held liable for any damages
337
+ arising from the use of this software.
338
+
339
+ Permission is granted to anyone to use this software for any purpose,
340
+ including commercial applications, and to alter it and redistribute it
341
+ freely, subject to the following restrictions:
342
+
343
+ 1. The origin of this software must not be misrepresented; you must not
344
+ claim that you wrote the original software. If you use this software
345
+ in a product, an acknowledgment in the product documentation would be
346
+ appreciated but is not required.
347
+ 2. Altered source versions must be plainly marked as such, and must not be
348
+ misrepresented as being the original software.
349
+ 3. This notice may not be removed or altered from any source distribution.
350
+
351
+ ==============================================================================
352
+ Emscripten runtime
353
+ Embedded by: @recast-navigation/wasm, manifold-3d
354
+ Source: https://github.com/emscripten-core/emscripten
355
+ ==============================================================================
356
+
357
+ Emscripten is available under 2 licenses, the MIT license and the
358
+ University of Illinois/NCSA Open Source License.
359
+
360
+ Both are permissive open source licenses, with little if any
361
+ practical difference between them.
362
+
363
+ The reason for offering both is that (1) the MIT license is
364
+ well-known, while (2) the University of Illinois/NCSA Open Source
365
+ License allows Emscripten's code to be integrated upstream into
366
+ LLVM, which uses that license, should the opportunity arise.
367
+
368
+ The full text of both licenses follows.
369
+
370
+ ==============================================================================
371
+
372
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
373
+
374
+ Permission is hereby granted, free of charge, to any person obtaining a copy
375
+ of this software and associated documentation files (the "Software"), to deal
376
+ in the Software without restriction, including without limitation the rights
377
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
378
+ copies of the Software, and to permit persons to whom the Software is
379
+ furnished to do so, subject to the following conditions:
380
+
381
+ The above copyright notice and this permission notice shall be included in
382
+ all copies or substantial portions of the Software.
383
+
384
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
385
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
386
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
387
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
388
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
389
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
390
+ THE SOFTWARE.
391
+
392
+ ==============================================================================
393
+
394
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
395
+ All rights reserved.
396
+
397
+ Permission is hereby granted, free of charge, to any person obtaining a
398
+ copy of this software and associated documentation files (the
399
+ "Software"), to deal with the Software without restriction, including
400
+ without limitation the rights to use, copy, modify, merge, publish,
401
+ distribute, sublicense, and/or sell copies of the Software, and to
402
+ permit persons to whom the Software is furnished to do so, subject to
403
+ the following conditions:
404
+
405
+ Redistributions of source code must retain the above copyright
406
+ notice, this list of conditions and the following disclaimers.
407
+
408
+ Redistributions in binary form must reproduce the above
409
+ copyright notice, this list of conditions and the following disclaimers
410
+ in the documentation and/or other materials provided with the
411
+ distribution.
412
+
413
+ Neither the names of Mozilla,
414
+ nor the names of its contributors may be used to endorse
415
+ or promote products derived from this Software without specific prior
416
+ written permission.
417
+
418
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
419
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
420
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
421
+ IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
422
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
423
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
424
+ SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
425
+
426
+ ==============================================================================
427
+
428
+ This program uses portions of Node.js source code located in src/library_path.js,
429
+ in accordance with the terms of the MIT license. Node's license follows:
430
+
431
+ """
432
+ Copyright Joyent, Inc. and other Node contributors. All rights reserved.
433
+ Permission is hereby granted, free of charge, to any person obtaining a copy
434
+ of this software and associated documentation files (the "Software"), to
435
+ deal in the Software without restriction, including without limitation the
436
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
437
+ sell copies of the Software, and to permit persons to whom the Software is
438
+ furnished to do so, subject to the following conditions:
439
+
440
+ The above copyright notice and this permission notice shall be included in
441
+ all copies or substantial portions of the Software.
442
+
443
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
444
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
445
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
446
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
447
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
448
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
449
+ IN THE SOFTWARE.
450
+ """
451
+
452
+ The musl libc project is bundled in this repo, and it has the MIT license, see
453
+ system/lib/libc/musl/COPYRIGHT
454
+
455
+ The third_party/ subdirectory contains code with other licenses. None of it is
456
+ used by default, but certain options use it (e.g., the optional closure compiler
457
+ flag will run closure compiler from third_party/).