@babylonjs/core 7.40.3 → 7.41.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 (145) hide show
  1. package/Audio/sound.js +5 -10
  2. package/Audio/sound.js.map +1 -1
  3. package/Compute/computeEffect.js +6 -14
  4. package/Compute/computeEffect.js.map +1 -1
  5. package/Compute/computeShader.js +2 -9
  6. package/Compute/computeShader.js.map +1 -1
  7. package/Culling/Helper/computeShaderBoundingHelper.js +5 -6
  8. package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
  9. package/Engines/abstractEngine.d.ts +7 -0
  10. package/Engines/abstractEngine.js +7 -2
  11. package/Engines/abstractEngine.js.map +1 -1
  12. package/Engines/engine.js +6 -8
  13. package/Engines/engine.js.map +1 -1
  14. package/Engines/thinEngine.js +6 -1
  15. package/Engines/thinEngine.js.map +1 -1
  16. package/Engines/webgpuEngine.js +6 -1
  17. package/Engines/webgpuEngine.js.map +1 -1
  18. package/FrameGraph/frameGraph.js +4 -9
  19. package/FrameGraph/frameGraph.js.map +1 -1
  20. package/Layers/effectLayer.js +2 -0
  21. package/Layers/effectLayer.js.map +1 -1
  22. package/Layers/glowLayer.js +4 -0
  23. package/Layers/glowLayer.js.map +1 -1
  24. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +5 -0
  25. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +33 -0
  26. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -4
  28. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  29. package/Materials/Node/nodeMaterial.d.ts +4 -0
  30. package/Materials/Node/nodeMaterial.js +15 -1
  31. package/Materials/Node/nodeMaterial.js.map +1 -1
  32. package/Materials/PBR/pbrBaseMaterial.js +2 -4
  33. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  34. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +3 -2
  35. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  36. package/Materials/Textures/colorGradingTexture.js +5 -2
  37. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  38. package/Materials/effect.functions.d.ts +0 -1
  39. package/Materials/effect.functions.js +0 -19
  40. package/Materials/effect.functions.js.map +1 -1
  41. package/Materials/effect.js +3 -2
  42. package/Materials/effect.js.map +1 -1
  43. package/Materials/effect.webgl.functions.js +2 -1
  44. package/Materials/effect.webgl.functions.js.map +1 -1
  45. package/Materials/material.d.ts +4 -0
  46. package/Materials/material.js +8 -0
  47. package/Materials/material.js.map +1 -1
  48. package/Meshes/abstractMesh.d.ts +5 -0
  49. package/Meshes/abstractMesh.js +15 -0
  50. package/Meshes/abstractMesh.js.map +1 -1
  51. package/Meshes/index.d.ts +1 -0
  52. package/Meshes/index.js +1 -0
  53. package/Meshes/index.js.map +1 -1
  54. package/Meshes/mesh.vertexData.functions.d.ts +6 -0
  55. package/Meshes/mesh.vertexData.functions.js +65 -0
  56. package/Meshes/mesh.vertexData.functions.js.map +1 -0
  57. package/Misc/bitArray.d.ts +26 -0
  58. package/Misc/bitArray.js +53 -0
  59. package/Misc/bitArray.js.map +1 -0
  60. package/Misc/index.d.ts +1 -0
  61. package/Misc/index.js +1 -0
  62. package/Misc/index.js.map +1 -1
  63. package/Misc/screenshotTools.d.ts +18 -12
  64. package/Misc/screenshotTools.js +64 -56
  65. package/Misc/screenshotTools.js.map +1 -1
  66. package/Misc/timingTools.d.ts +4 -0
  67. package/Misc/timingTools.js +38 -0
  68. package/Misc/timingTools.js.map +1 -1
  69. package/Misc/webRequest.d.ts +1 -1
  70. package/Misc/webRequest.js +1 -1
  71. package/Misc/webRequest.js.map +1 -1
  72. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +7 -5
  73. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  74. package/Rendering/iblCdfGenerator.d.ts +14 -19
  75. package/Rendering/iblCdfGenerator.js +64 -57
  76. package/Rendering/iblCdfGenerator.js.map +1 -1
  77. package/Rendering/index.d.ts +6 -6
  78. package/Rendering/index.js +6 -6
  79. package/Rendering/index.js.map +1 -1
  80. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +6 -6
  81. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  82. package/Shaders/ShadersInclude/helperFunctions.js +7 -5
  83. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  84. package/Shaders/ShadersInclude/pbrBlockReflection.js +2 -3
  85. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  86. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +2 -3
  87. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  88. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -1
  89. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  90. package/Shaders/{iblIcdfx.fragment.d.ts → iblCdfDebug.fragment.d.ts} +1 -1
  91. package/Shaders/{importanceSamplingDebug.fragment.js → iblCdfDebug.fragment.js} +12 -11
  92. package/Shaders/iblCdfDebug.fragment.js.map +1 -0
  93. package/Shaders/iblCdfy.fragment.d.ts +1 -0
  94. package/Shaders/iblCdfy.fragment.js +4 -4
  95. package/Shaders/iblCdfy.fragment.js.map +1 -1
  96. package/Shaders/iblIcdf.fragment.d.ts +6 -0
  97. package/Shaders/iblIcdf.fragment.js +43 -0
  98. package/Shaders/iblIcdf.fragment.js.map +1 -0
  99. package/Shaders/iblScaledLuminance.fragment.d.ts +6 -0
  100. package/Shaders/iblScaledLuminance.fragment.js +25 -0
  101. package/Shaders/iblScaledLuminance.fragment.js.map +1 -0
  102. package/Shaders/iblShadowVoxelTracing.fragment.js +2 -2
  103. package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
  104. package/Shaders/pbr.fragment.js +2 -4
  105. package/Shaders/pbr.fragment.js.map +1 -1
  106. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +8 -6
  107. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  108. package/ShadersWGSL/ShadersInclude/helperFunctions.js +23 -20
  109. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  110. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +4 -8
  111. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  112. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +4 -8
  113. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  114. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -1
  115. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  116. package/ShadersWGSL/{iblIcdfy.fragment.d.ts → iblCdfDebug.fragment.d.ts} +1 -1
  117. package/ShadersWGSL/{importanceSamplingDebug.fragment.js → iblCdfDebug.fragment.js} +11 -10
  118. package/ShadersWGSL/iblCdfDebug.fragment.js.map +1 -0
  119. package/ShadersWGSL/iblCdfy.fragment.js +8 -7
  120. package/ShadersWGSL/iblCdfy.fragment.js.map +1 -1
  121. package/ShadersWGSL/iblIcdf.fragment.d.ts +6 -0
  122. package/ShadersWGSL/iblIcdf.fragment.js +43 -0
  123. package/ShadersWGSL/iblIcdf.fragment.js.map +1 -0
  124. package/ShadersWGSL/iblScaledLuminance.fragment.d.ts +6 -0
  125. package/ShadersWGSL/iblScaledLuminance.fragment.js +24 -0
  126. package/ShadersWGSL/iblScaledLuminance.fragment.js.map +1 -0
  127. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +3 -3
  128. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
  129. package/ShadersWGSL/pbr.fragment.js +4 -8
  130. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  131. package/package.json +1 -1
  132. package/Shaders/iblIcdfx.fragment.js +0 -19
  133. package/Shaders/iblIcdfx.fragment.js.map +0 -1
  134. package/Shaders/iblIcdfy.fragment.d.ts +0 -5
  135. package/Shaders/iblIcdfy.fragment.js +0 -19
  136. package/Shaders/iblIcdfy.fragment.js.map +0 -1
  137. package/Shaders/importanceSamplingDebug.fragment.d.ts +0 -5
  138. package/Shaders/importanceSamplingDebug.fragment.js.map +0 -1
  139. package/ShadersWGSL/iblIcdfx.fragment.d.ts +0 -5
  140. package/ShadersWGSL/iblIcdfx.fragment.js +0 -18
  141. package/ShadersWGSL/iblIcdfx.fragment.js.map +0 -1
  142. package/ShadersWGSL/iblIcdfy.fragment.js +0 -17
  143. package/ShadersWGSL/iblIcdfy.fragment.js.map +0 -1
  144. package/ShadersWGSL/importanceSamplingDebug.fragment.d.ts +0 -5
  145. package/ShadersWGSL/importanceSamplingDebug.fragment.js.map +0 -1
package/Meshes/index.d.ts CHANGED
@@ -31,6 +31,7 @@ export * from "./GreasedLine/greasedLineMesh";
31
31
  export * from "./GreasedLine/greasedLineRibbonMesh";
32
32
  export * from "./GreasedLine/greasedLineBaseMesh";
33
33
  export * from "./csg2";
34
+ export * from "./mesh.vertexData.functions";
34
35
  import "./thinInstanceMesh";
35
36
  export * from "./thinInstanceMesh";
36
37
  export * from "./Node/index";
package/Meshes/index.js CHANGED
@@ -33,6 +33,7 @@ export * from "./GreasedLine/greasedLineMesh.js";
33
33
  export * from "./GreasedLine/greasedLineRibbonMesh.js";
34
34
  export * from "./GreasedLine/greasedLineBaseMesh.js";
35
35
  export * from "./csg2.js";
36
+ export * from "./mesh.vertexData.functions.js";
36
37
  import "./thinInstanceMesh.js";
37
38
  // eslint-disable-next-line no-duplicate-imports
38
39
  export * from "./thinInstanceMesh.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Meshes/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,c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c,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC","sourcesContent":["/* eslint-disable import/export */\r\n/* eslint-disable import/no-internal-modules */\r\nexport * from \"./abstractMesh\";\r\nimport \"./abstractMesh.decalMap\";\r\nexport * from \"./abstractMesh.hotSpot\";\r\nexport * from \"./Compression/index\";\r\nexport * from \"./csg\";\r\nexport * from \"./meshUVSpaceRenderer\";\r\nexport * from \"./geometry\";\r\nexport * from \"./groundMesh\";\r\nexport * from \"./goldbergMesh\";\r\nexport * from \"./trailMesh\";\r\nexport * from \"./instancedMesh\";\r\nexport * from \"./linesMesh\";\r\nexport * from \"./mesh\";\r\nexport * from \"./mesh.vertexData\";\r\nexport * from \"./meshBuilder\";\r\nexport * from \"./meshSimplification\";\r\nexport * from \"./meshSimplificationSceneComponent\";\r\nexport * from \"./meshUtils\";\r\nexport * from \"./polygonMesh\";\r\nexport * from \"./geodesicMesh\";\r\nexport * from \"./subMesh\";\r\nexport * from \"./subMesh.project\";\r\nexport * from \"./lattice\";\r\nexport * from \"./lattice.material\";\r\nexport * from \"./meshLODLevel\";\r\nexport * from \"./transformNode\";\r\nexport * from \"./Builders/index\";\r\nexport * from \"./WebGL/webGLDataBuffer\";\r\nexport * from \"./WebGPU/webgpuDataBuffer\";\r\nexport * from \"./GreasedLine/greasedLineMesh\";\r\nexport * from \"./GreasedLine/greasedLineRibbonMesh\";\r\nexport * from \"./GreasedLine/greasedLineBaseMesh\";\r\nexport * from \"./csg2\";\r\nimport \"./thinInstanceMesh\";\r\n// eslint-disable-next-line no-duplicate-imports\r\nexport * from \"./thinInstanceMesh\";\r\nexport * from \"./Node/index\";\r\nexport * from \"./GaussianSplatting/gaussianSplattingMesh\";\r\n\r\n// LineMesh\r\nexport * from \"../Shaders/color.fragment\";\r\nexport * from \"../Shaders/color.vertex\";\r\nexport * from \"../ShadersWGSL/color.fragment\";\r\nexport * from \"../ShadersWGSL/color.vertex\";\r\n\r\n// MeshUVSPaceRenderer\r\nexport * from \"../Shaders/meshUVSpaceRenderer.vertex\";\r\nexport * from \"../Shaders/meshUVSpaceRenderer.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererMasker.vertex\";\r\nexport * from \"../Shaders/meshUVSpaceRendererMasker.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererFinaliser.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererFinaliser.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRenderer.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRenderer.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererMasker.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererMasker.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererFinaliser.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererFinaliser.vertex\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Meshes/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,OAAO,oBAAoB,CAAC;AAC5B,gDAAgD;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,2CAA2C,CAAC;AAE1D,WAAW;AACX,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,sBAAsB;AACtB,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC","sourcesContent":["/* eslint-disable import/export */\r\n/* eslint-disable import/no-internal-modules */\r\nexport * from \"./abstractMesh\";\r\nimport \"./abstractMesh.decalMap\";\r\nexport * from \"./abstractMesh.hotSpot\";\r\nexport * from \"./Compression/index\";\r\nexport * from \"./csg\";\r\nexport * from \"./meshUVSpaceRenderer\";\r\nexport * from \"./geometry\";\r\nexport * from \"./groundMesh\";\r\nexport * from \"./goldbergMesh\";\r\nexport * from \"./trailMesh\";\r\nexport * from \"./instancedMesh\";\r\nexport * from \"./linesMesh\";\r\nexport * from \"./mesh\";\r\nexport * from \"./mesh.vertexData\";\r\nexport * from \"./meshBuilder\";\r\nexport * from \"./meshSimplification\";\r\nexport * from \"./meshSimplificationSceneComponent\";\r\nexport * from \"./meshUtils\";\r\nexport * from \"./polygonMesh\";\r\nexport * from \"./geodesicMesh\";\r\nexport * from \"./subMesh\";\r\nexport * from \"./subMesh.project\";\r\nexport * from \"./lattice\";\r\nexport * from \"./lattice.material\";\r\nexport * from \"./meshLODLevel\";\r\nexport * from \"./transformNode\";\r\nexport * from \"./Builders/index\";\r\nexport * from \"./WebGL/webGLDataBuffer\";\r\nexport * from \"./WebGPU/webgpuDataBuffer\";\r\nexport * from \"./GreasedLine/greasedLineMesh\";\r\nexport * from \"./GreasedLine/greasedLineRibbonMesh\";\r\nexport * from \"./GreasedLine/greasedLineBaseMesh\";\r\nexport * from \"./csg2\";\r\nexport * from \"./mesh.vertexData.functions\";\r\nimport \"./thinInstanceMesh\";\r\n// eslint-disable-next-line no-duplicate-imports\r\nexport * from \"./thinInstanceMesh\";\r\nexport * from \"./Node/index\";\r\nexport * from \"./GaussianSplatting/gaussianSplattingMesh\";\r\n\r\n// LineMesh\r\nexport * from \"../Shaders/color.fragment\";\r\nexport * from \"../Shaders/color.vertex\";\r\nexport * from \"../ShadersWGSL/color.fragment\";\r\nexport * from \"../ShadersWGSL/color.vertex\";\r\n\r\n// MeshUVSPaceRenderer\r\nexport * from \"../Shaders/meshUVSpaceRenderer.vertex\";\r\nexport * from \"../Shaders/meshUVSpaceRenderer.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererMasker.vertex\";\r\nexport * from \"../Shaders/meshUVSpaceRendererMasker.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererFinaliser.fragment\";\r\nexport * from \"../Shaders/meshUVSpaceRendererFinaliser.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRenderer.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRenderer.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererMasker.vertex\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererMasker.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererFinaliser.fragment\";\r\nexport * from \"../ShadersWGSL/meshUVSpaceRendererFinaliser.vertex\";\r\n"]}
@@ -0,0 +1,6 @@
1
+ import type { IndicesArray } from "../types.js";
2
+ /**
3
+ * Sort (in place) the index array so that faces with common indices are close
4
+ * @param indices the array of indices to sort
5
+ */
6
+ export declare function OptimizeIndices(indices: IndicesArray): void;
@@ -0,0 +1,65 @@
1
+ import { BitArray } from "../Misc/bitArray.js";
2
+ /**
3
+ * Sort (in place) the index array so that faces with common indices are close
4
+ * @param indices the array of indices to sort
5
+ */
6
+ export function OptimizeIndices(indices) {
7
+ const faces = [];
8
+ const faceCount = indices.length / 3;
9
+ // Step 1: Break the indices array into faces
10
+ for (let i = 0; i < faceCount; i++) {
11
+ faces.push([indices[i * 3], indices[i * 3 + 1], indices[i * 3 + 2]]);
12
+ }
13
+ // Step 2: Build a graph connecting faces sharing a vertex
14
+ const vertexToFaceMap = new Map();
15
+ faces.forEach((face, faceIndex) => {
16
+ face.forEach((vertex) => {
17
+ let face = vertexToFaceMap.get(vertex);
18
+ if (!face) {
19
+ vertexToFaceMap.set(vertex, (face = []));
20
+ }
21
+ face.push(faceIndex);
22
+ });
23
+ });
24
+ // Step 3: Traverse faces using DFS to ensure connected faces are close
25
+ const visited = new BitArray(faceCount);
26
+ const sortedFaces = [];
27
+ // Using a stack and not a recursive version to avoid call stack overflow
28
+ const deepFirstSearchStack = (startFaceIndex) => {
29
+ const stack = [startFaceIndex];
30
+ while (stack.length > 0) {
31
+ const currentFaceIndex = stack.pop();
32
+ if (visited.get(currentFaceIndex)) {
33
+ continue;
34
+ }
35
+ visited.set(currentFaceIndex, true);
36
+ sortedFaces.push(faces[currentFaceIndex]);
37
+ // Push unvisited neighbors (faces sharing a vertex) onto the stack
38
+ faces[currentFaceIndex].forEach((vertex) => {
39
+ const neighbors = vertexToFaceMap.get(vertex);
40
+ if (!neighbors) {
41
+ return;
42
+ }
43
+ neighbors.forEach((neighborFaceIndex) => {
44
+ if (!visited.get(neighborFaceIndex)) {
45
+ stack.push(neighborFaceIndex);
46
+ }
47
+ });
48
+ });
49
+ }
50
+ };
51
+ // Start DFS from the first face
52
+ for (let i = 0; i < faceCount; i++) {
53
+ if (!visited.get(i)) {
54
+ deepFirstSearchStack(i);
55
+ }
56
+ }
57
+ // Step 4: Flatten the sorted faces back into an array
58
+ let index = 0;
59
+ sortedFaces.forEach((face) => {
60
+ indices[index++] = face[0];
61
+ indices[index++] = face[1];
62
+ indices[index++] = face[2];
63
+ });
64
+ }
65
+ //# sourceMappingURL=mesh.vertexData.functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh.vertexData.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Meshes/mesh.vertexData.functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,4BAA2B;AAE9C;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAqB;IACjD,MAAM,KAAK,GAAyB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAErC,6CAA6C;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,0DAA0D;IAC1D,MAAM,eAAe,GAAG,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AAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE;oBACpC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;wBAClC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;oBAClC,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,gCAAgC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,sDAAsD;IACtD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { IndicesArray } from \"core/types\";\r\nimport { BitArray } from \"core/Misc/bitArray\";\r\n\r\n/**\r\n * Sort (in place) the index array so that faces with common indices are close\r\n * @param indices the array of indices to sort\r\n */\r\nexport function OptimizeIndices(indices: IndicesArray) {\r\n const faces: Array<Array<number>> = [];\r\n const faceCount = indices.length / 3;\r\n\r\n // Step 1: Break the indices array into faces\r\n for (let i = 0; i < faceCount; i++) {\r\n faces.push([indices[i * 3], indices[i * 3 + 1], indices[i * 3 + 2]]);\r\n }\r\n\r\n // Step 2: Build a graph connecting faces sharing a vertex\r\n const vertexToFaceMap = new Map<number, number[]>();\r\n faces.forEach((face, faceIndex) => {\r\n face.forEach((vertex) => {\r\n let face = vertexToFaceMap.get(vertex);\r\n if (!face) {\r\n vertexToFaceMap.set(vertex, (face = []));\r\n }\r\n face.push(faceIndex);\r\n });\r\n });\r\n\r\n // Step 3: Traverse faces using DFS to ensure connected faces are close\r\n const visited = new BitArray(faceCount);\r\n const sortedFaces: Array<number[]> = [];\r\n\r\n // Using a stack and not a recursive version to avoid call stack overflow\r\n const deepFirstSearchStack = (startFaceIndex: number) => {\r\n const stack: Array<number> = [startFaceIndex];\r\n\r\n while (stack.length > 0) {\r\n const currentFaceIndex = stack.pop()!;\r\n\r\n if (visited.get(currentFaceIndex)) {\r\n continue;\r\n }\r\n visited.set(currentFaceIndex, true);\r\n sortedFaces.push(faces[currentFaceIndex]);\r\n\r\n // Push unvisited neighbors (faces sharing a vertex) onto the stack\r\n faces[currentFaceIndex].forEach((vertex) => {\r\n const neighbors = vertexToFaceMap.get(vertex);\r\n\r\n if (!neighbors) {\r\n return;\r\n }\r\n\r\n neighbors.forEach((neighborFaceIndex) => {\r\n if (!visited.get(neighborFaceIndex)) {\r\n stack.push(neighborFaceIndex);\r\n }\r\n });\r\n });\r\n }\r\n };\r\n\r\n // Start DFS from the first face\r\n for (let i = 0; i < faceCount; i++) {\r\n if (!visited.get(i)) {\r\n deepFirstSearchStack(i);\r\n }\r\n }\r\n\r\n // Step 4: Flatten the sorted faces back into an array\r\n let index = 0;\r\n sortedFaces.forEach((face) => {\r\n indices[index++] = face[0];\r\n indices[index++] = face[1];\r\n indices[index++] = face[2];\r\n });\r\n}\r\n"]}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * An fixed size array that effectively stores boolean values where each value is a single bit of backing data.
3
+ * @remarks
4
+ * All bits are initialized to false.
5
+ */
6
+ export declare class BitArray {
7
+ readonly size: number;
8
+ private readonly _byteArray;
9
+ /**
10
+ * Creates a new bit array with a fixed size.
11
+ * @param size The number of bits to store.
12
+ */
13
+ constructor(size: number);
14
+ /**
15
+ * Gets the current value at the specified index.
16
+ * @param bitIndex The index to get the value from.
17
+ * @returns The value at the specified index.
18
+ */
19
+ get(bitIndex: number): boolean;
20
+ /**
21
+ * Sets the value at the specified index.
22
+ * @param bitIndex The index to set the value at.
23
+ * @param value The value to set.
24
+ */
25
+ set(bitIndex: number, value: boolean): void;
26
+ }
@@ -0,0 +1,53 @@
1
+ function getByteIndex(bitIndex) {
2
+ return Math.floor(bitIndex / 8);
3
+ }
4
+ function getBitMask(bitIndex) {
5
+ return 1 << bitIndex % 8;
6
+ }
7
+ /**
8
+ * An fixed size array that effectively stores boolean values where each value is a single bit of backing data.
9
+ * @remarks
10
+ * All bits are initialized to false.
11
+ */
12
+ export class BitArray {
13
+ /**
14
+ * Creates a new bit array with a fixed size.
15
+ * @param size The number of bits to store.
16
+ */
17
+ constructor(size) {
18
+ this.size = size;
19
+ this._byteArray = new Uint8Array(Math.ceil(this.size / 8));
20
+ }
21
+ /**
22
+ * Gets the current value at the specified index.
23
+ * @param bitIndex The index to get the value from.
24
+ * @returns The value at the specified index.
25
+ */
26
+ get(bitIndex) {
27
+ if (bitIndex >= this.size) {
28
+ throw new RangeError("Bit index out of range");
29
+ }
30
+ const byteIndex = getByteIndex(bitIndex);
31
+ const bitMask = getBitMask(bitIndex);
32
+ return (this._byteArray[byteIndex] & bitMask) !== 0;
33
+ }
34
+ /**
35
+ * Sets the value at the specified index.
36
+ * @param bitIndex The index to set the value at.
37
+ * @param value The value to set.
38
+ */
39
+ set(bitIndex, value) {
40
+ if (bitIndex >= this.size) {
41
+ throw new RangeError("Bit index out of range");
42
+ }
43
+ const byteIndex = getByteIndex(bitIndex);
44
+ const bitMask = getBitMask(bitIndex);
45
+ if (value) {
46
+ this._byteArray[byteIndex] |= bitMask;
47
+ }
48
+ else {
49
+ this._byteArray[byteIndex] &= ~bitMask;
50
+ }
51
+ }
52
+ }
53
+ //# sourceMappingURL=bitArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitArray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O,CAAC;QAC1C,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QAC3C,CAAC;IACL,CAAC;CACJ","sourcesContent":["function getByteIndex(bitIndex: number): number {\r\n return Math.floor(bitIndex / 8);\r\n}\r\n\r\nfunction getBitMask(bitIndex: number): number {\r\n return 1 << bitIndex % 8;\r\n}\r\n\r\n/**\r\n * An fixed size array that effectively stores boolean values where each value is a single bit of backing data.\r\n * @remarks\r\n * All bits are initialized to false.\r\n */\r\nexport class BitArray {\r\n private readonly _byteArray: Uint8Array;\r\n\r\n /**\r\n * Creates a new bit array with a fixed size.\r\n * @param size The number of bits to store.\r\n */\r\n public constructor(public readonly size: number) {\r\n this._byteArray = new Uint8Array(Math.ceil(this.size / 8));\r\n }\r\n\r\n /**\r\n * Gets the current value at the specified index.\r\n * @param bitIndex The index to get the value from.\r\n * @returns The value at the specified index.\r\n */\r\n public get(bitIndex: number): boolean {\r\n if (bitIndex >= this.size) {\r\n throw new RangeError(\"Bit index out of range\");\r\n }\r\n const byteIndex = getByteIndex(bitIndex);\r\n const bitMask = getBitMask(bitIndex);\r\n return (this._byteArray[byteIndex] & bitMask) !== 0;\r\n }\r\n\r\n /**\r\n * Sets the value at the specified index.\r\n * @param bitIndex The index to set the value at.\r\n * @param value The value to set.\r\n */\r\n public set(bitIndex: number, value: boolean): void {\r\n if (bitIndex >= this.size) {\r\n throw new RangeError(\"Bit index out of range\");\r\n }\r\n const byteIndex = getByteIndex(bitIndex);\r\n const bitMask = getBitMask(bitIndex);\r\n if (value) {\r\n this._byteArray[byteIndex] |= bitMask;\r\n } else {\r\n this._byteArray[byteIndex] &= ~bitMask;\r\n }\r\n }\r\n}\r\n"]}
package/Misc/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export * from "./greasedLineTools";
73
73
  export * from "./equirectangularCapture";
74
74
  export * from "./decorators.serialization";
75
75
  export * from "./asyncLock";
76
+ export * from "./bitArray";
76
77
  export * from "../Shaders/rgbdDecode.fragment";
77
78
  export * from "../Shaders/rgbdEncode.fragment";
78
79
  export * from "../ShadersWGSL/rgbdDecode.fragment";
package/Misc/index.js CHANGED
@@ -76,6 +76,7 @@ export * from "./greasedLineTools.js";
76
76
  export * from "./equirectangularCapture.js";
77
77
  export * from "./decorators.serialization.js";
78
78
  export * from "./asyncLock.js";
79
+ export * from "./bitArray.js";
79
80
  // RGBDTextureTools
80
81
  export * from "../Shaders/rgbdDecode.fragment.js";
81
82
  export * from "../Shaders/rgbdEncode.fragment.js";
package/Misc/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,4BAA4B;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,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AC;AAE5B,mBAAmB;AACnB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AAEnD,uBAAuB;AACvB,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./andOrNotEvaluator\";\r\nexport * from \"./assetsManager\";\r\nexport * from \"./basis\";\r\nexport * from \"./dds\";\r\nexport * from \"./decorators\";\r\nexport * from \"./deferred\";\r\nexport * from \"./environmentTextureTools\";\r\nexport * from \"./meshExploder\";\r\nexport * from \"./filesInput\";\r\nexport * from \"./HighDynamicRange/index\";\r\nexport * from \"./khronosTextureContainer\";\r\nexport * from \"./observable\";\r\nexport * from \"./observable.extensions\";\r\nexport * from \"./performanceMonitor\";\r\nexport * from \"./sceneOptimizer\";\r\nexport * from \"./sceneSerializer\";\r\nexport * from \"./smartArray\";\r\nexport * from \"./stringDictionary\";\r\nexport * from \"./tags\";\r\nexport * from \"./textureTools\";\r\n// loaded from texture tools\r\nexport * from \"../Shaders/lodCube.fragment\";\r\nexport * from \"../Shaders/lod.fragment\";\r\nexport * from \"../ShadersWGSL/lodCube.fragment\";\r\nexport * from \"../ShadersWGSL/lod.fragment\";\r\nexport * from \"./tga\";\r\nexport * from \"./tools\";\r\nexport * from \"./videoRecorder\";\r\nexport * from \"./virtualJoystick\";\r\nexport * from \"./workerPool\";\r\nexport * from \"./logger\";\r\nexport * from \"./typeStore\";\r\nexport * from \"./filesInputStore\";\r\nexport * from \"./deepCopier\";\r\nexport * from \"./deepMerger\";\r\nexport * from \"./pivotTools\";\r\nexport * from \"./precisionDate\";\r\nexport * from \"./screenshotTools\";\r\nexport * from \"./webRequest\";\r\nexport * from \"./iInspectable\";\r\nexport * from \"./brdfTextureTools\";\r\nexport * from \"./rgbdTextureTools\";\r\nexport * from \"./gradients\";\r\nexport * from \"./perfCounter\";\r\nexport * from \"./fileRequest\";\r\nexport * from \"./customAnimationFrameRequester\";\r\nexport * from \"./retryStrategy\";\r\nexport * from \"./interfaces/screenshotSize\";\r\nexport * from \"./interfaces/iPerfViewer\";\r\nexport * from \"./fileTools\";\r\nexport * from \"./stringTools\";\r\nexport * from \"./dataReader\";\r\nexport * from \"./minMaxReducer\";\r\nexport * from \"./depthReducer\";\r\nexport * from \"./dataStorage\";\r\nexport * from \"./sceneRecorder\";\r\nexport * from \"./khronosTextureContainer2\";\r\nexport * from \"./trajectoryClassifier\";\r\nexport * from \"./timer\";\r\nexport * from \"./copyTools\";\r\nexport * from \"./reflector\";\r\nexport * from \"./domManagement\";\r\nexport * from \"./pressureObserverWrapper\";\r\nexport * from \"./PerformanceViewer/index\";\r\nexport * from \"./coroutine\";\r\nexport * from \"./guid\";\r\nexport * from \"./error\";\r\nexport * from \"./snapshotRenderingHelper\";\r\n// eslint-disable-next-line import/export\r\nexport * from \"./observableCoroutine\";\r\nexport * from \"./copyTextureToTexture\";\r\n/** @deprecated Use individual exports */\r\nexport { DumpTools } from \"./dumpTools\";\r\nexport * from \"./greasedLineTools\";\r\nexport * from \"./equirectangularCapture\";\r\nexport * from \"./decorators.serialization\";\r\nexport * from \"./asyncLock\";\r\n\r\n// RGBDTextureTools\r\nexport * from \"../Shaders/rgbdDecode.fragment\";\r\nexport * from \"../Shaders/rgbdEncode.fragment\";\r\nexport * from \"../ShadersWGSL/rgbdDecode.fragment\";\r\nexport * from \"../ShadersWGSL/rgbdEncode.fragment\";\r\n\r\n// CopyTextureToTexture\r\nexport * from \"../Shaders/copyTextureToTexture.fragment\";\r\nexport * from \"../ShadersWGSL/copyTextureToTexture.fragment\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,OA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AAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,yCAAyC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,yCAAyC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAE3B,mBAAmB;AACnB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AAEnD,uBAAuB;AACvB,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./andOrNotEvaluator\";\r\nexport * from \"./assetsManager\";\r\nexport * from \"./basis\";\r\nexport * from \"./dds\";\r\nexport * from \"./decorators\";\r\nexport * from \"./deferred\";\r\nexport * from \"./environmentTextureTools\";\r\nexport * from \"./meshExploder\";\r\nexport * from \"./filesInput\";\r\nexport * from \"./HighDynamicRange/index\";\r\nexport * from \"./khronosTextureContainer\";\r\nexport * from \"./observable\";\r\nexport * from \"./observable.extensions\";\r\nexport * from \"./performanceMonitor\";\r\nexport * from \"./sceneOptimizer\";\r\nexport * from \"./sceneSerializer\";\r\nexport * from \"./smartArray\";\r\nexport * from \"./stringDictionary\";\r\nexport * from \"./tags\";\r\nexport * from \"./textureTools\";\r\n// loaded from texture tools\r\nexport * from \"../Shaders/lodCube.fragment\";\r\nexport * from \"../Shaders/lod.fragment\";\r\nexport * from \"../ShadersWGSL/lodCube.fragment\";\r\nexport * from \"../ShadersWGSL/lod.fragment\";\r\nexport * from \"./tga\";\r\nexport * from \"./tools\";\r\nexport * from \"./videoRecorder\";\r\nexport * from \"./virtualJoystick\";\r\nexport * from \"./workerPool\";\r\nexport * from \"./logger\";\r\nexport * from \"./typeStore\";\r\nexport * from \"./filesInputStore\";\r\nexport * from \"./deepCopier\";\r\nexport * from \"./deepMerger\";\r\nexport * from \"./pivotTools\";\r\nexport * from \"./precisionDate\";\r\nexport * from \"./screenshotTools\";\r\nexport * from \"./webRequest\";\r\nexport * from \"./iInspectable\";\r\nexport * from \"./brdfTextureTools\";\r\nexport * from \"./rgbdTextureTools\";\r\nexport * from \"./gradients\";\r\nexport * from \"./perfCounter\";\r\nexport * from \"./fileRequest\";\r\nexport * from \"./customAnimationFrameRequester\";\r\nexport * from \"./retryStrategy\";\r\nexport * from \"./interfaces/screenshotSize\";\r\nexport * from \"./interfaces/iPerfViewer\";\r\nexport * from \"./fileTools\";\r\nexport * from \"./stringTools\";\r\nexport * from \"./dataReader\";\r\nexport * from \"./minMaxReducer\";\r\nexport * from \"./depthReducer\";\r\nexport * from \"./dataStorage\";\r\nexport * from \"./sceneRecorder\";\r\nexport * from \"./khronosTextureContainer2\";\r\nexport * from \"./trajectoryClassifier\";\r\nexport * from \"./timer\";\r\nexport * from \"./copyTools\";\r\nexport * from \"./reflector\";\r\nexport * from \"./domManagement\";\r\nexport * from \"./pressureObserverWrapper\";\r\nexport * from \"./PerformanceViewer/index\";\r\nexport * from \"./coroutine\";\r\nexport * from \"./guid\";\r\nexport * from \"./error\";\r\nexport * from \"./snapshotRenderingHelper\";\r\n// eslint-disable-next-line import/export\r\nexport * from \"./observableCoroutine\";\r\nexport * from \"./copyTextureToTexture\";\r\n/** @deprecated Use individual exports */\r\nexport { DumpTools } from \"./dumpTools\";\r\nexport * from \"./greasedLineTools\";\r\nexport * from \"./equirectangularCapture\";\r\nexport * from \"./decorators.serialization\";\r\nexport * from \"./asyncLock\";\r\nexport * from \"./bitArray\";\r\n\r\n// RGBDTextureTools\r\nexport * from \"../Shaders/rgbdDecode.fragment\";\r\nexport * from \"../Shaders/rgbdEncode.fragment\";\r\nexport * from \"../ShadersWGSL/rgbdDecode.fragment\";\r\nexport * from \"../ShadersWGSL/rgbdEncode.fragment\";\r\n\r\n// CopyTextureToTexture\r\nexport * from \"../Shaders/copyTextureToTexture.fragment\";\r\nexport * from \"../ShadersWGSL/copyTextureToTexture.fragment\";\r\n"]}
@@ -6,7 +6,7 @@ import type { AbstractEngine } from "../Engines/abstractEngine";
6
6
  * Captures a screenshot of the current rendering
7
7
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
8
8
  * @param engine defines the rendering engine
9
- * @param camera defines the source camera
9
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
10
10
  * @param size This parameter can be set to a single number or to an object with the
11
11
  * following (optional) properties: precision, width, height. If a single number is passed,
12
12
  * it will be used for both width and height. If an object is passed, the screenshot size
@@ -19,13 +19,14 @@ import type { AbstractEngine } from "../Engines/abstractEngine";
19
19
  * Check your browser for supported MIME types
20
20
  * @param forceDownload force the system to download the image even if a successCallback is provided
21
21
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
22
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
22
23
  */
23
- export declare function CreateScreenshot(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, successCallback?: (data: string) => void, mimeType?: string, forceDownload?: boolean, quality?: number): void;
24
+ export declare function CreateScreenshot(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, successCallback?: (data: string) => void, mimeType?: string, forceDownload?: boolean, quality?: number, useFill?: boolean): void;
24
25
  /**
25
26
  * Captures a screenshot of the current rendering
26
27
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
27
28
  * @param engine defines the rendering engine
28
- * @param camera defines the source camera
29
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
29
30
  * @param size This parameter can be set to a single number or to an object with the
30
31
  * following (optional) properties: precision, width, height. If a single number is passed,
31
32
  * it will be used for both width and height. If an object is passed, the screenshot size
@@ -34,24 +35,26 @@ export declare function CreateScreenshot(engine: AbstractEngine, camera: Camera,
34
35
  * @param mimeType defines the MIME type of the screenshot image (default: image/png).
35
36
  * Check your browser for supported MIME types
36
37
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
38
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
37
39
  * @returns screenshot as a string of base64-encoded characters. This string can be assigned
38
40
  * to the src parameter of an <img> to display it
39
41
  */
40
- export declare function CreateScreenshotAsync(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, mimeType?: string, quality?: number): Promise<string>;
42
+ export declare function CreateScreenshotAsync(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, mimeType?: string, quality?: number, useFill?: boolean): Promise<string>;
41
43
  /**
42
44
  * Captures and automatically downloads a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
43
45
  * If screenshot image data is needed, use {@link CreateScreenshotAsync} instead.
44
46
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
45
47
  * @param engine defines the rendering engine
46
- * @param camera defines the source camera
48
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
47
49
  * @param width defines the expected width
48
50
  * @param height defines the expected height
49
51
  * @param mimeType defines the MIME type of the screenshot image (default: image/png).
50
52
  * Check your browser for supported MIME types
51
53
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
54
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
52
55
  * @returns promise that resolves once the screenshot is taken
53
56
  */
54
- export declare function CreateScreenshotWithResizeAsync(engine: AbstractEngine, camera: Camera, width: number, height: number, mimeType?: string, quality?: number): Promise<void>;
57
+ export declare function CreateScreenshotWithResizeAsync(engine: AbstractEngine, camera: Camera, width: number, height: number, mimeType?: string, quality?: number, useFill?: boolean): Promise<void>;
55
58
  /**
56
59
  * Generates an image screenshot from the specified camera.
57
60
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
@@ -109,7 +112,7 @@ export declare const ScreenshotTools: {
109
112
  * Captures a screenshot of the current rendering
110
113
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
111
114
  * @param engine defines the rendering engine
112
- * @param camera defines the source camera
115
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
113
116
  * @param size This parameter can be set to a single number or to an object with the
114
117
  * following (optional) properties: precision, width, height. If a single number is passed,
115
118
  * it will be used for both width and height. If an object is passed, the screenshot size
@@ -122,13 +125,14 @@ export declare const ScreenshotTools: {
122
125
  * Check your browser for supported MIME types
123
126
  * @param forceDownload force the system to download the image even if a successCallback is provided
124
127
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
128
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
125
129
  */
126
130
  CreateScreenshot: typeof CreateScreenshot;
127
131
  /**
128
132
  * Captures a screenshot of the current rendering
129
133
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
130
134
  * @param engine defines the rendering engine
131
- * @param camera defines the source camera
135
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
132
136
  * @param size This parameter can be set to a single number or to an object with the
133
137
  * following (optional) properties: precision, width, height. If a single number is passed,
134
138
  * it will be used for both width and height. If an object is passed, the screenshot size
@@ -137,22 +141,24 @@ export declare const ScreenshotTools: {
137
141
  * @param mimeType defines the MIME type of the screenshot image (default: image/png).
138
142
  * Check your browser for supported MIME types
139
143
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
144
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
140
145
  * @returns screenshot as a string of base64-encoded characters. This string can be assigned
141
146
  * to the src parameter of an <img> to display it
142
147
  */
143
148
  CreateScreenshotAsync: typeof CreateScreenshotAsync;
144
149
  /**
145
- * Captures a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
150
+ * Captures and automatically downloads a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
151
+ * If screenshot image data is needed, use {@link CreateScreenshotAsync} instead.
146
152
  * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
147
153
  * @param engine defines the rendering engine
148
- * @param camera defines the source camera
154
+ * @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
149
155
  * @param width defines the expected width
150
156
  * @param height defines the expected height
151
157
  * @param mimeType defines the MIME type of the screenshot image (default: image/png).
152
158
  * Check your browser for supported MIME types
153
159
  * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
154
- * @returns screenshot as a string of base64-encoded characters. This string can be assigned
155
- * to the src parameter of an <img> to display it
160
+ * @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
161
+ * @returns promise that resolves once the screenshot is taken
156
162
  */
157
163
  CreateScreenshotWithResizeAsync: typeof CreateScreenshotWithResizeAsync;
158
164
  /**