@babylonjs/core 9.8.0 → 9.9.1

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 (124) hide show
  1. package/Audio/audioSceneComponent.pure.js +17 -9
  2. package/Bones/bone.pure.js +39 -29
  3. package/Cameras/arcRotateCamera.pure.d.ts +0 -8
  4. package/Cameras/arcRotateCamera.pure.js +0 -12
  5. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  6. package/Cameras/inputMapper.d.ts +29 -8
  7. package/Cameras/inputMapper.js +63 -10
  8. package/Cameras/inputMapper.js.map +1 -1
  9. package/Cameras/targetCamera.pure.js +40 -27
  10. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +17 -23
  11. package/Engines/abstractEngine.pure.js +11 -4
  12. package/Engines/abstractEngine.pure.js.map +1 -1
  13. package/Engines/engine.pure.d.ts +23 -0
  14. package/Engines/engine.pure.js +96 -1
  15. package/Engines/engine.pure.js.map +1 -1
  16. package/Engines/nativeEngine.pure.d.ts +4 -0
  17. package/Engines/nativeEngine.pure.js +6 -0
  18. package/Engines/nativeEngine.pure.js.map +1 -1
  19. package/Engines/thinEngine.pure.js +234 -280
  20. package/Engines/thinNativeEngine.pure.d.ts +21 -0
  21. package/Engines/thinNativeEngine.pure.js +119 -4
  22. package/Engines/thinNativeEngine.pure.js.map +1 -1
  23. package/Engines/webgpuEngine.pure.d.ts +21 -0
  24. package/Engines/webgpuEngine.pure.js +46 -1
  25. package/Engines/webgpuEngine.pure.js.map +1 -1
  26. package/Materials/Background/backgroundMaterial.pure.js +5 -4
  27. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  28. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.d.ts +5 -0
  29. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js +8 -0
  30. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js.map +1 -0
  31. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +278 -0
  32. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +718 -0
  33. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -0
  34. package/Materials/GaussianSplatting/pure.d.ts +1 -0
  35. package/Materials/GaussianSplatting/pure.js +1 -0
  36. package/Materials/GaussianSplatting/pure.js.map +1 -1
  37. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +10 -14
  38. package/Materials/Node/Blocks/Dual/index.d.ts +0 -14
  39. package/Materials/Node/Blocks/Dual/index.js +0 -18
  40. package/Materials/Node/Blocks/Dual/index.js.map +1 -1
  41. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +660 -662
  42. package/Materials/Node/Blocks/Fragment/index.d.ts +0 -10
  43. package/Materials/Node/Blocks/Fragment/index.js +0 -13
  44. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  45. package/Materials/Node/Blocks/GaussianSplatting/index.d.ts +12 -0
  46. package/Materials/Node/Blocks/GaussianSplatting/index.js +14 -1
  47. package/Materials/Node/Blocks/GaussianSplatting/index.js.map +1 -1
  48. package/Materials/Node/Blocks/Vertex/index.d.ts +0 -8
  49. package/Materials/Node/Blocks/Vertex/index.js +0 -10
  50. package/Materials/Node/Blocks/Vertex/index.js.map +1 -1
  51. package/Materials/PBR/openpbrMaterial.pure.js +6 -5
  52. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  53. package/Materials/PBR/pbrBaseMaterial.pure.js +6 -5
  54. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  55. package/Materials/Textures/index.d.ts +1 -0
  56. package/Materials/Textures/index.js +1 -0
  57. package/Materials/Textures/index.js.map +1 -1
  58. package/Materials/Textures/internalTexture.d.ts +11 -1
  59. package/Materials/Textures/internalTexture.js +23 -0
  60. package/Materials/Textures/internalTexture.js.map +1 -1
  61. package/Materials/Textures/texture.pure.js +157 -255
  62. package/Materials/index.d.ts +30 -0
  63. package/Materials/index.js +31 -0
  64. package/Materials/index.js.map +1 -1
  65. package/Materials/material.pure.js +128 -69
  66. package/Materials/pure.d.ts +1 -0
  67. package/Materials/pure.js +1 -0
  68. package/Materials/pure.js.map +1 -1
  69. package/Materials/standardMaterial.pure.js +6 -5
  70. package/Materials/standardMaterial.pure.js.map +1 -1
  71. package/Maths/math.color.pure.js +55 -47
  72. package/Maths/math.vector.pure.js +118 -242
  73. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.d.ts +7 -0
  74. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js +8 -0
  75. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js.map +1 -0
  76. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.d.ts +147 -0
  77. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js +257 -0
  78. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js.map +1 -0
  79. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +11 -0
  80. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +31 -0
  81. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  82. package/Meshes/GaussianSplatting/pure.d.ts +1 -0
  83. package/Meshes/GaussianSplatting/pure.js +1 -0
  84. package/Meshes/GaussianSplatting/pure.js.map +1 -1
  85. package/Meshes/GreasedLine/greasedLineMesh.pure.js +9 -14
  86. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +26 -27
  87. package/Meshes/index.d.ts +1 -0
  88. package/Meshes/index.js +1 -0
  89. package/Meshes/index.js.map +1 -1
  90. package/Meshes/meshSimplification.common.d.ts +53 -0
  91. package/Meshes/meshSimplification.common.js +34 -0
  92. package/Meshes/meshSimplification.common.js.map +1 -0
  93. package/Meshes/meshSimplification.d.ts +3 -53
  94. package/Meshes/meshSimplification.js +1 -33
  95. package/Meshes/meshSimplification.js.map +1 -1
  96. package/Meshes/meshSimplificationSceneComponent.pure.js.map +1 -1
  97. package/Meshes/meshSimplificationSceneComponent.types.d.ts +2 -1
  98. package/Meshes/meshSimplificationSceneComponent.types.js.map +1 -1
  99. package/Meshes/pure.d.ts +1 -0
  100. package/Meshes/pure.js +1 -0
  101. package/Meshes/pure.js.map +1 -1
  102. package/Meshes/transformNode.pure.js +82 -44
  103. package/Misc/tools.pure.js +124 -186
  104. package/Misc/tools.pure.js.map +1 -1
  105. package/Physics/v1/physicsImpostor.pure.js +43 -37
  106. package/Shaders/ShadersInclude/gaussianSplatting.js +33 -10
  107. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  108. package/Shaders/gaussianSplatting.vertex.js +20 -1
  109. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  110. package/Shaders/picking.fragment.js +4 -1
  111. package/Shaders/picking.fragment.js.map +1 -1
  112. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +33 -10
  113. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  114. package/ShadersWGSL/gaussianSplatting.vertex.js +21 -2
  115. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  116. package/SmartAssets/index.d.ts +2 -2
  117. package/SmartAssets/index.js +2 -1
  118. package/SmartAssets/index.js.map +1 -1
  119. package/SmartAssets/pure.d.ts +1 -1
  120. package/SmartAssets/pure.js +2 -1
  121. package/SmartAssets/pure.js.map +1 -1
  122. package/SmartAssets/smartAssetManager.js +9 -0
  123. package/SmartAssets/smartAssetManager.js.map +1 -1
  124. package/package.json +3 -1
@@ -70,22 +70,7 @@ export class Texture extends BaseTexture {
70
70
  * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
71
71
  * @param forcedExtension defines the extension to use to pick the right loader
72
72
  */
73
- constructor(
74
- url,
75
- sceneOrEngine,
76
- noMipmapOrOptions,
77
- invertY,
78
- samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
79
- onLoad = null,
80
- onError = null,
81
- buffer = null,
82
- deleteBuffer = false,
83
- format,
84
- mimeType,
85
- loaderOptions,
86
- creationFlags,
87
- forcedExtension
88
- ) {
73
+ constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {
89
74
  super(sceneOrEngine);
90
75
  /**
91
76
  * Define the url of the texture.
@@ -212,7 +197,8 @@ export class Texture extends BaseTexture {
212
197
  internalTexture = noMipmapOrOptions.internalTexture ?? null;
213
198
  gammaSpace = noMipmapOrOptions.gammaSpace ?? gammaSpace;
214
199
  forcedExtension = noMipmapOrOptions.forcedExtension ?? forcedExtension;
215
- } else {
200
+ }
201
+ else {
216
202
  noMipmap = !!noMipmapOrOptions;
217
203
  }
218
204
  this._gammaSpace = gammaSpace;
@@ -282,39 +268,27 @@ export class Texture extends BaseTexture {
282
268
  if (!this._texture) {
283
269
  if (!scene || !scene.useDelayedTextureLoading) {
284
270
  try {
285
- this._texture = engine.createTexture(
286
- this.url,
287
- noMipmap,
288
- this._invertY,
289
- scene,
290
- samplingMode,
291
- load,
292
- errorHandler,
293
- this._buffer,
294
- undefined,
295
- this._format,
296
- this._forcedExtension,
297
- mimeType,
298
- loaderOptions,
299
- creationFlags,
300
- useSRGBBuffer
301
- );
302
- } catch (e) {
271
+ this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);
272
+ }
273
+ catch (e) {
303
274
  errorHandler("error loading", e);
304
275
  throw e;
305
276
  }
306
277
  if (deleteBuffer) {
307
278
  this._buffer = null;
308
279
  }
309
- } else {
280
+ }
281
+ else {
310
282
  this.delayLoadState = 4;
311
283
  this._delayedOnLoad = load;
312
284
  this._delayedOnError = errorHandler;
313
285
  }
314
- } else {
286
+ }
287
+ else {
315
288
  if (this._texture.isReady) {
316
289
  TimingTools.SetImmediate(() => load());
317
- } else {
290
+ }
291
+ else {
318
292
  const loadObserver = this._texture.onLoadedObservable.add(load);
319
293
  this._texture.onErrorObservable.add((e) => {
320
294
  errorHandler(e.message, e.exception);
@@ -348,7 +322,8 @@ export class Texture extends BaseTexture {
348
322
  const load = () => {
349
323
  if (existingOnLoad) {
350
324
  existingOnLoad();
351
- } else if (this.onLoadObservable.hasObservers()) {
325
+ }
326
+ else if (this.onLoadObservable.hasObservers()) {
352
327
  this.onLoadObservable.notifyObservers(this);
353
328
  }
354
329
  if (onLoad) {
@@ -382,31 +357,17 @@ export class Texture extends BaseTexture {
382
357
  if (!this._texture) {
383
358
  this._texture = scene
384
359
  .getEngine()
385
- .createTexture(
386
- url,
387
- this._noMipmap,
388
- this._invertY,
389
- scene,
390
- this.samplingMode,
391
- this._delayedOnLoad,
392
- this._delayedOnError,
393
- this._buffer,
394
- null,
395
- this._format,
396
- this._forcedExtension,
397
- this._mimeType,
398
- this._loaderOptions,
399
- this._creationFlags,
400
- this._useSRGBBuffer
401
- );
360
+ .createTexture(url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);
402
361
  if (this._deleteBuffer) {
403
362
  this._buffer = null;
404
363
  }
405
- } else {
364
+ }
365
+ else {
406
366
  if (this._delayedOnLoad) {
407
367
  if (this._texture.isReady) {
408
368
  TimingTools.SetImmediate(this._delayedOnLoad);
409
- } else {
369
+ }
370
+ else {
410
371
  this._texture.onLoadedObservable.add(this._delayedOnLoad);
411
372
  }
412
373
  }
@@ -431,8 +392,7 @@ export class Texture extends BaseTexture {
431
392
  * @returns the transform matrix of the texture.
432
393
  */
433
394
  getTextureMatrix(uBase = 1) {
434
- if (
435
- this.uOffset === this._cachedUOffset &&
395
+ if (this.uOffset === this._cachedUOffset &&
436
396
  this.vOffset === this._cachedVOffset &&
437
397
  this.uScale * uBase === this._cachedUScale &&
438
398
  this.vScale === this._cachedVScale &&
@@ -442,8 +402,7 @@ export class Texture extends BaseTexture {
442
402
  this.uRotationCenter === this._cachedURotationCenter &&
443
403
  this.vRotationCenter === this._cachedVRotationCenter &&
444
404
  this.wRotationCenter === this._cachedWRotationCenter &&
445
- this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform
446
- ) {
405
+ this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {
447
406
  return this._cachedTextureMatrix;
448
407
  }
449
408
  this._cachedUOffset = this.uOffset;
@@ -476,31 +435,14 @@ export class Texture extends BaseTexture {
476
435
  this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);
477
436
  // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)
478
437
  this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);
479
- } else {
438
+ }
439
+ else {
480
440
  this._prepareRowForTextureGeneration(0, 0, 0, this._t0);
481
441
  this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);
482
442
  this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);
483
443
  this._t1.subtractInPlace(this._t0);
484
444
  this._t2.subtractInPlace(this._t0);
485
- Matrix.FromValuesToRef(
486
- this._t1.x,
487
- this._t1.y,
488
- this._t1.z,
489
- 0.0,
490
- this._t2.x,
491
- this._t2.y,
492
- this._t2.z,
493
- 0.0,
494
- this._t0.x,
495
- this._t0.y,
496
- this._t0.z,
497
- 0.0,
498
- 0.0,
499
- 0.0,
500
- 0.0,
501
- 1.0,
502
- this._cachedTextureMatrix
503
- );
445
+ Matrix.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);
504
446
  }
505
447
  const scene = this.getScene();
506
448
  if (!scene) {
@@ -526,18 +468,17 @@ export class Texture extends BaseTexture {
526
468
  if (!scene) {
527
469
  return this._cachedReflectionTextureMatrix;
528
470
  }
529
- if (
530
- this.uOffset === this._cachedReflectionUOffset &&
471
+ if (this.uOffset === this._cachedReflectionUOffset &&
531
472
  this.vOffset === this._cachedReflectionVOffset &&
532
473
  this.uScale === this._cachedReflectionUScale &&
533
474
  this.vScale === this._cachedReflectionVScale &&
534
- this.coordinatesMode === this._cachedReflectionCoordinatesMode
535
- ) {
475
+ this.coordinatesMode === this._cachedReflectionCoordinatesMode) {
536
476
  if (this.coordinatesMode === Texture.PROJECTION_MODE) {
537
477
  if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
538
478
  return this._cachedReflectionTextureMatrix;
539
479
  }
540
- } else {
480
+ }
481
+ else {
541
482
  return this._cachedReflectionTextureMatrix;
542
483
  }
543
484
  }
@@ -627,10 +568,12 @@ export class Texture extends BaseTexture {
627
568
  if (typeof this._buffer === "string" && this._buffer.startsWith("data:")) {
628
569
  serializationObject.base64String = this._buffer;
629
570
  serializationObject.name = serializationObject.name.replace("data:", "");
630
- } else if (this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array) {
571
+ }
572
+ else if (this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array) {
631
573
  const mimeType = this.mimeType || "image/png";
632
574
  serializationObject.base64String = `data:${mimeType};base64,${EncodeArrayBufferToBase64(this._buffer)}`;
633
- } else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith("blob:")) || this._forceSerialize) {
575
+ }
576
+ else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith("blob:")) || this._forceSerialize) {
634
577
  serializationObject.base64String =
635
578
  !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);
636
579
  }
@@ -731,104 +674,92 @@ export class Texture extends BaseTexture {
731
674
  texture._texture.label = parsedTexture.internalTextureLabel;
732
675
  }
733
676
  };
734
- const texture = SerializationHelper.Parse(
735
- () => {
736
- let generateMipMaps = true;
737
- if (parsedTexture.noMipmap) {
738
- generateMipMaps = false;
739
- }
740
- if (parsedTexture.mirrorPlane) {
741
- const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
742
- mirrorTexture._waitingRenderList = parsedTexture.renderList;
743
- mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
744
- onLoaded(mirrorTexture);
745
- return mirrorTexture;
746
- } else if (parsedTexture.isRenderTarget && !parsedTexture.base64String) {
747
- // if base64string is set it means the original RTT was baked
748
- let renderTargetTexture = null;
749
- if (parsedTexture.isCube) {
750
- // Search for an existing reflection probe (which contains a cube render target texture)
751
- if (scene.reflectionProbes) {
752
- for (let index = 0; index < scene.reflectionProbes.length; index++) {
753
- const probe = scene.reflectionProbes[index];
754
- if (probe.name === parsedTexture.name) {
755
- return probe.cubeTexture;
756
- }
677
+ const texture = SerializationHelper.Parse(() => {
678
+ let generateMipMaps = true;
679
+ if (parsedTexture.noMipmap) {
680
+ generateMipMaps = false;
681
+ }
682
+ if (parsedTexture.mirrorPlane) {
683
+ const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
684
+ mirrorTexture._waitingRenderList = parsedTexture.renderList;
685
+ mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
686
+ onLoaded(mirrorTexture);
687
+ return mirrorTexture;
688
+ }
689
+ else if (parsedTexture.isRenderTarget && !parsedTexture.base64String) {
690
+ // if base64string is set it means the original RTT was baked
691
+ let renderTargetTexture = null;
692
+ if (parsedTexture.isCube) {
693
+ // Search for an existing reflection probe (which contains a cube render target texture)
694
+ if (scene.reflectionProbes) {
695
+ for (let index = 0; index < scene.reflectionProbes.length; index++) {
696
+ const probe = scene.reflectionProbes[index];
697
+ if (probe.name === parsedTexture.name) {
698
+ return probe.cubeTexture;
757
699
  }
758
700
  }
759
- } else {
760
- renderTargetTexture = Texture._CreateRenderTargetTexture(
761
- parsedTexture.name,
762
- parsedTexture.renderTargetSize,
763
- scene,
764
- generateMipMaps,
765
- parsedTexture._creationFlags ?? 0
766
- );
767
- renderTargetTexture._waitingRenderList = parsedTexture.renderList;
768
701
  }
769
- onLoaded(renderTargetTexture);
770
- return renderTargetTexture;
771
- } else if (parsedTexture.isVideo) {
772
- const texture = Texture._CreateVideoTexture(
773
- rootUrl + (parsedTexture.url || parsedTexture.name),
774
- rootUrl + (parsedTexture.src || parsedTexture.url),
775
- scene,
776
- generateMipMaps,
777
- parsedTexture.invertY,
778
- parsedTexture.samplingMode,
779
- parsedTexture.settings || {}
780
- );
781
- onLoaded(texture);
782
- return texture;
783
- } else {
784
- let texture;
785
- if (typeof parsedTexture.base64String === "string" && parsedTexture.base64String && !internalTexture) {
786
- const options = {
787
- buffer: parsedTexture.base64String,
788
- noMipmap: !generateMipMaps,
789
- invertY: parsedTexture.invertY,
790
- samplingMode: parsedTexture.samplingMode,
791
- useSRGBBuffer: parsedTexture._useSRGBBuffer ?? false,
792
- creationFlags: parsedTexture._creationFlags ?? 0,
793
- onLoad: () => {
794
- onLoaded(texture);
795
- },
796
- };
797
- // use the base64 string as the texture name for caching; the actual payload comes from options.buffer
798
- const base64String = parsedTexture.base64String;
799
- const noPrefixBase64String = base64String.startsWith("data:") ? base64String.substring(5) : base64String;
800
- texture = Texture.CreateFromBase64String("", noPrefixBase64String, scene, options);
801
- // prettier name to fit with the loaded data
802
- texture.name = parsedTexture.name;
803
- } else {
804
- let url;
805
- if (parsedTexture.name && (parsedTexture.name.indexOf("://") > 0 || parsedTexture.name.startsWith("data:"))) {
806
- url = parsedTexture.name;
807
- } else {
808
- url = rootUrl + parsedTexture.name;
809
- }
810
- if (parsedTexture.url && (parsedTexture.url.startsWith("data:") || Texture.UseSerializedUrlIfAny)) {
811
- url = parsedTexture.url;
812
- }
813
- const options = {
814
- noMipmap: !generateMipMaps,
815
- invertY: parsedTexture.invertY,
816
- samplingMode: parsedTexture.samplingMode,
817
- useSRGBBuffer: parsedTexture._useSRGBBuffer ?? false,
818
- creationFlags: parsedTexture._creationFlags ?? 0,
819
- onLoad: () => {
820
- onLoaded(texture);
821
- },
822
- internalTexture,
823
- };
824
- texture = new Texture(url, scene, options);
702
+ }
703
+ else {
704
+ renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, parsedTexture._creationFlags ?? 0);
705
+ renderTargetTexture._waitingRenderList = parsedTexture.renderList;
706
+ }
707
+ onLoaded(renderTargetTexture);
708
+ return renderTargetTexture;
709
+ }
710
+ else if (parsedTexture.isVideo) {
711
+ const texture = Texture._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});
712
+ onLoaded(texture);
713
+ return texture;
714
+ }
715
+ else {
716
+ let texture;
717
+ if (typeof parsedTexture.base64String === "string" && parsedTexture.base64String && !internalTexture) {
718
+ const options = {
719
+ buffer: parsedTexture.base64String,
720
+ noMipmap: !generateMipMaps,
721
+ invertY: parsedTexture.invertY,
722
+ samplingMode: parsedTexture.samplingMode,
723
+ useSRGBBuffer: parsedTexture._useSRGBBuffer ?? false,
724
+ creationFlags: parsedTexture._creationFlags ?? 0,
725
+ onLoad: () => {
726
+ onLoaded(texture);
727
+ },
728
+ };
729
+ // use the base64 string as the texture name for caching; the actual payload comes from options.buffer
730
+ const base64String = parsedTexture.base64String;
731
+ const noPrefixBase64String = base64String.startsWith("data:") ? base64String.substring(5) : base64String;
732
+ texture = Texture.CreateFromBase64String("", noPrefixBase64String, scene, options);
733
+ // prettier name to fit with the loaded data
734
+ texture.name = parsedTexture.name;
735
+ }
736
+ else {
737
+ let url;
738
+ if (parsedTexture.name && (parsedTexture.name.indexOf("://") > 0 || parsedTexture.name.startsWith("data:"))) {
739
+ url = parsedTexture.name;
825
740
  }
826
- return texture;
741
+ else {
742
+ url = rootUrl + parsedTexture.name;
743
+ }
744
+ if (parsedTexture.url && (parsedTexture.url.startsWith("data:") || Texture.UseSerializedUrlIfAny)) {
745
+ url = parsedTexture.url;
746
+ }
747
+ const options = {
748
+ noMipmap: !generateMipMaps,
749
+ invertY: parsedTexture.invertY,
750
+ samplingMode: parsedTexture.samplingMode,
751
+ useSRGBBuffer: parsedTexture._useSRGBBuffer ?? false,
752
+ creationFlags: parsedTexture._creationFlags ?? 0,
753
+ onLoad: () => {
754
+ onLoaded(texture);
755
+ },
756
+ internalTexture,
757
+ };
758
+ texture = new Texture(url, scene, options);
827
759
  }
828
- },
829
- parsedTexture,
830
- scene
831
- );
760
+ return texture;
761
+ }
762
+ }, parsedTexture, scene);
832
763
  return texture;
833
764
  }
834
765
  /**
@@ -846,35 +777,8 @@ export class Texture extends BaseTexture {
846
777
  * @param forcedExtension defines the extension to use to pick the right loader
847
778
  * @returns the created texture
848
779
  */
849
- static CreateFromBase64String(
850
- data,
851
- name,
852
- scene,
853
- noMipmapOrOptions,
854
- invertY,
855
- samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
856
- onLoad = null,
857
- onError = null,
858
- format = 5,
859
- creationFlags,
860
- forcedExtension
861
- ) {
862
- return new Texture(
863
- "data:" + name,
864
- scene,
865
- noMipmapOrOptions,
866
- invertY,
867
- samplingMode,
868
- onLoad,
869
- onError,
870
- data,
871
- false,
872
- format,
873
- undefined,
874
- undefined,
875
- creationFlags,
876
- forcedExtension
877
- );
780
+ static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
781
+ return new Texture("data:" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);
878
782
  }
879
783
  /**
880
784
  * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)
@@ -892,39 +796,11 @@ export class Texture extends BaseTexture {
892
796
  * @param forcedExtension defines the extension to use to pick the right loader
893
797
  * @returns the created texture
894
798
  */
895
- static LoadFromDataString(
896
- name,
897
- buffer,
898
- scene,
899
- deleteBuffer = false,
900
- noMipmapOrOptions,
901
- invertY = true,
902
- samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
903
- onLoad = null,
904
- onError = null,
905
- format = 5,
906
- creationFlags,
907
- forcedExtension
908
- ) {
799
+ static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
909
800
  if (name.substring(0, 5) !== "data:") {
910
801
  name = "data:" + name;
911
802
  }
912
- return new Texture(
913
- name,
914
- scene,
915
- noMipmapOrOptions,
916
- invertY,
917
- samplingMode,
918
- onLoad,
919
- onError,
920
- buffer,
921
- deleteBuffer,
922
- format,
923
- undefined,
924
- undefined,
925
- creationFlags,
926
- forcedExtension
927
- );
803
+ return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);
928
804
  }
929
805
  }
930
806
  /**
@@ -1023,19 +899,45 @@ Texture.MIRROR_ADDRESSMODE = 2;
1023
899
  * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
1024
900
  */
1025
901
  Texture.UseSerializedUrlIfAny = false;
1026
- __decorate([serialize()], Texture.prototype, "url", void 0);
1027
- __decorate([serialize()], Texture.prototype, "uOffset", void 0);
1028
- __decorate([serialize()], Texture.prototype, "vOffset", void 0);
1029
- __decorate([serialize()], Texture.prototype, "uScale", void 0);
1030
- __decorate([serialize()], Texture.prototype, "vScale", void 0);
1031
- __decorate([serialize()], Texture.prototype, "uAng", void 0);
1032
- __decorate([serialize()], Texture.prototype, "vAng", void 0);
1033
- __decorate([serialize()], Texture.prototype, "wAng", void 0);
1034
- __decorate([serialize()], Texture.prototype, "uRotationCenter", void 0);
1035
- __decorate([serialize()], Texture.prototype, "vRotationCenter", void 0);
1036
- __decorate([serialize()], Texture.prototype, "wRotationCenter", void 0);
1037
- __decorate([serialize()], Texture.prototype, "homogeneousRotationInUVTransform", void 0);
1038
- __decorate([serialize()], Texture.prototype, "isBlocking", null);
902
+ __decorate([
903
+ serialize()
904
+ ], Texture.prototype, "url", void 0);
905
+ __decorate([
906
+ serialize()
907
+ ], Texture.prototype, "uOffset", void 0);
908
+ __decorate([
909
+ serialize()
910
+ ], Texture.prototype, "vOffset", void 0);
911
+ __decorate([
912
+ serialize()
913
+ ], Texture.prototype, "uScale", void 0);
914
+ __decorate([
915
+ serialize()
916
+ ], Texture.prototype, "vScale", void 0);
917
+ __decorate([
918
+ serialize()
919
+ ], Texture.prototype, "uAng", void 0);
920
+ __decorate([
921
+ serialize()
922
+ ], Texture.prototype, "vAng", void 0);
923
+ __decorate([
924
+ serialize()
925
+ ], Texture.prototype, "wAng", void 0);
926
+ __decorate([
927
+ serialize()
928
+ ], Texture.prototype, "uRotationCenter", void 0);
929
+ __decorate([
930
+ serialize()
931
+ ], Texture.prototype, "vRotationCenter", void 0);
932
+ __decorate([
933
+ serialize()
934
+ ], Texture.prototype, "wRotationCenter", void 0);
935
+ __decorate([
936
+ serialize()
937
+ ], Texture.prototype, "homogeneousRotationInUVTransform", void 0);
938
+ __decorate([
939
+ serialize()
940
+ ], Texture.prototype, "isBlocking", null);
1039
941
  let _Registered = false;
1040
942
  /**
1041
943
  * Register side effects for texture.
@@ -1050,4 +952,4 @@ export function RegisterTexture() {
1050
952
  RegisterClass("BABYLON.Texture", Texture);
1051
953
  SerializationHelper._TextureParser = Texture.Parse;
1052
954
  }
1053
- //# sourceMappingURL=texture.pure.js.map
955
+ //# sourceMappingURL=texture.pure.js.map
@@ -39,6 +39,7 @@ export * from "./meshDebugPluginMaterial.js";
39
39
  export * from "./GaussianSplatting/gaussianSplattingMaterial.js";
40
40
  export * from "./GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js";
41
41
  export * from "./GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js";
42
+ export * from "./GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js";
42
43
  export * from "./materialHelper.functions.js";
43
44
  export * from "./materialHelper.geometryrendering.js";
44
45
  export * from "./materialStencilState.js";
@@ -53,4 +54,33 @@ export * from "../Shaders/greasedLine.fragment.js";
53
54
  export * from "../Shaders/greasedLine.vertex.js";
54
55
  export * from "../ShadersWGSL/greasedLine.fragment.js";
55
56
  export * from "../ShadersWGSL/greasedLine.vertex.js";
57
+ export * from "../Shaders/ShadersInclude/bakedVertexAnimation.js";
58
+ export * from "../Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
59
+ export * from "../Shaders/ShadersInclude/depthPrePass.js";
60
+ export * from "../Shaders/ShadersInclude/fogFragment.js";
61
+ export * from "../Shaders/ShadersInclude/fogVertex.js";
62
+ export * from "../Shaders/ShadersInclude/fogVertexDeclaration.js";
63
+ export * from "../Shaders/ShadersInclude/imageProcessingCompatibility.js";
64
+ export * from "../Shaders/ShadersInclude/instancesDeclaration.js";
65
+ export * from "../Shaders/ShadersInclude/instancesVertex.js";
66
+ export * from "../Shaders/ShadersInclude/logDepthFragment.js";
67
+ export * from "../Shaders/ShadersInclude/logDepthVertex.js";
68
+ export * from "../Shaders/ShadersInclude/sceneFragmentDeclaration.js";
69
+ export * from "../Shaders/ShadersInclude/sceneUboDeclaration.js";
70
+ export * from "../Shaders/ShadersInclude/sceneVertexDeclaration.js";
71
+ export * from "../Shaders/ShadersInclude/vertexColorMixing.js";
72
+ export * from "../ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
73
+ export * from "../ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
74
+ export * from "../ShadersWGSL/ShadersInclude/depthPrePass.js";
75
+ export * from "../ShadersWGSL/ShadersInclude/fogFragment.js";
76
+ export * from "../ShadersWGSL/ShadersInclude/fogVertex.js";
77
+ export * from "../ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
78
+ export * from "../ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
79
+ export * from "../ShadersWGSL/ShadersInclude/instancesDeclaration.js";
80
+ export * from "../ShadersWGSL/ShadersInclude/instancesVertex.js";
81
+ export * from "../ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
82
+ export * from "../ShadersWGSL/ShadersInclude/logDepthFragment.js";
83
+ export * from "../ShadersWGSL/ShadersInclude/logDepthVertex.js";
84
+ export * from "../ShadersWGSL/ShadersInclude/sceneUboDeclaration.js";
85
+ export * from "../ShadersWGSL/ShadersInclude/vertexColorMixing.js";
56
86
  import "./material.decalMap.js";
@@ -40,6 +40,7 @@ export * from "./meshDebugPluginMaterial.js";
40
40
  export * from "./GaussianSplatting/gaussianSplattingMaterial.js";
41
41
  export * from "./GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js";
42
42
  export * from "./GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js";
43
+ export * from "./GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js";
43
44
  export * from "./materialHelper.functions.js";
44
45
  export * from "./materialHelper.geometryrendering.js";
45
46
  export * from "./materialStencilState.js";
@@ -57,5 +58,35 @@ export * from "../Shaders/greasedLine.fragment.js";
57
58
  export * from "../Shaders/greasedLine.vertex.js";
58
59
  export * from "../ShadersWGSL/greasedLine.fragment.js";
59
60
  export * from "../ShadersWGSL/greasedLine.vertex.js";
61
+ // Shared shader includes used by external material packages in UMD builds
62
+ export * from "../Shaders/ShadersInclude/bakedVertexAnimation.js";
63
+ export * from "../Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
64
+ export * from "../Shaders/ShadersInclude/depthPrePass.js";
65
+ export * from "../Shaders/ShadersInclude/fogFragment.js";
66
+ export * from "../Shaders/ShadersInclude/fogVertex.js";
67
+ export * from "../Shaders/ShadersInclude/fogVertexDeclaration.js";
68
+ export * from "../Shaders/ShadersInclude/imageProcessingCompatibility.js";
69
+ export * from "../Shaders/ShadersInclude/instancesDeclaration.js";
70
+ export * from "../Shaders/ShadersInclude/instancesVertex.js";
71
+ export * from "../Shaders/ShadersInclude/logDepthFragment.js";
72
+ export * from "../Shaders/ShadersInclude/logDepthVertex.js";
73
+ export * from "../Shaders/ShadersInclude/sceneFragmentDeclaration.js";
74
+ export * from "../Shaders/ShadersInclude/sceneUboDeclaration.js";
75
+ export * from "../Shaders/ShadersInclude/sceneVertexDeclaration.js";
76
+ export * from "../Shaders/ShadersInclude/vertexColorMixing.js";
77
+ export * from "../ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
78
+ export * from "../ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
79
+ export * from "../ShadersWGSL/ShadersInclude/depthPrePass.js";
80
+ export * from "../ShadersWGSL/ShadersInclude/fogFragment.js";
81
+ export * from "../ShadersWGSL/ShadersInclude/fogVertex.js";
82
+ export * from "../ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
83
+ export * from "../ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
84
+ export * from "../ShadersWGSL/ShadersInclude/instancesDeclaration.js";
85
+ export * from "../ShadersWGSL/ShadersInclude/instancesVertex.js";
86
+ export * from "../ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
87
+ export * from "../ShadersWGSL/ShadersInclude/logDepthFragment.js";
88
+ export * from "../ShadersWGSL/ShadersInclude/logDepthVertex.js";
89
+ export * from "../ShadersWGSL/ShadersInclude/sceneUboDeclaration.js";
90
+ export * from "../ShadersWGSL/ShadersInclude/vertexColorMixing.js";
60
91
  import "./material.decalMap.js";
61
92
  //# sourceMappingURL=index.js.map