@babylonjs/core 5.30.0 → 5.31.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.
- package/Animations/animatable.d.ts +1 -0
- package/Animations/animatable.js +7 -0
- package/Animations/animatable.js.map +1 -1
- package/Cameras/cameraInputsManager.d.ts +2 -2
- package/Cameras/cameraInputsManager.js +5 -4
- package/Cameras/cameraInputsManager.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +17 -0
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.views.js +2 -2
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +4 -0
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderCodeNode.js +11 -2
- package/Engines/Processors/shaderCodeNode.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +4 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +3 -0
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +6 -0
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +36 -8
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.js +6 -4
- package/Engines/thinEngine.js.map +1 -1
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.d.ts +3 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +19 -16
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +6 -2
- package/Lights/Shadows/shadowGenerator.js +40 -11
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGeneratorSceneComponent.js +16 -8
- package/Lights/Shadows/shadowGeneratorSceneComponent.js.map +1 -1
- package/Lights/light.d.ts +10 -3
- package/Lights/light.js +28 -6
- package/Lights/light.js.map +1 -1
- package/Lights/pointLight.js +6 -2
- package/Lights/pointLight.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +3 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +8 -2
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +4 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +11 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +7 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/materialHelper.js +2 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/uniformBuffer.js +1 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.d.ts +16 -0
- package/Maths/math.vector.js +16 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.js +11 -7
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +5 -3
- package/Meshes/mesh.js +30 -19
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +1 -1
- package/Meshes/transformNode.js +1 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/sceneRecorder.js +10 -4
- package/Misc/sceneRecorder.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +7 -5
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +3 -3
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +2 -2
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +3 -3
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
- package/Shaders/fxaa.fragment.js +1 -1
- package/Shaders/fxaa.fragment.js.map +1 -1
- package/Shaders/motionBlur.fragment.js +2 -2
- package/Shaders/motionBlur.fragment.js.map +1 -1
- package/Shaders/shadowMap.fragment.js +6 -4
- package/Shaders/shadowMap.fragment.js.map +1 -1
- package/Shaders/shadowMap.vertex.js +2 -2
- package/Shaders/shadowMap.vertex.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +1 -1
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/XR/webXRCamera.js +2 -0
- package/XR/webXRCamera.js.map +1 -1
- package/assetContainer.js +2 -2
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
package/Meshes/mesh.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ export declare class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
|
181
181
|
static _GetDefaultSideOrientation(orientation?: number): number;
|
|
182
182
|
private _internalMeshDataInfo;
|
|
183
183
|
/**
|
|
184
|
-
* Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance
|
|
184
|
+
* Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
|
|
185
185
|
*/
|
|
186
186
|
get useLODScreenCoverage(): boolean;
|
|
187
187
|
set useLODScreenCoverage(value: boolean);
|
|
@@ -221,7 +221,7 @@ export declare class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
|
221
221
|
get hasThinInstances(): boolean;
|
|
222
222
|
/**
|
|
223
223
|
* Gets the delay loading state of the mesh (when delay loading is turned on)
|
|
224
|
-
* @see https://doc.babylonjs.com/
|
|
224
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/importers/incrementalLoading
|
|
225
225
|
*/
|
|
226
226
|
delayLoadState: number;
|
|
227
227
|
/**
|
|
@@ -346,6 +346,8 @@ export declare class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
|
346
346
|
* @see https://doc.babylonjs.com/how_to/how_to_use_lod
|
|
347
347
|
* @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
|
|
348
348
|
* If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
|
|
349
|
+
* Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
|
|
350
|
+
* Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
|
|
349
351
|
* @param mesh The mesh to be added as LOD level (can be null)
|
|
350
352
|
* @returns This mesh (for chaining)
|
|
351
353
|
*/
|
|
@@ -366,7 +368,7 @@ export declare class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
|
366
368
|
removeLODLevel(mesh: Mesh): Mesh;
|
|
367
369
|
/**
|
|
368
370
|
* Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
|
|
369
|
-
* @see https://doc.babylonjs.com/
|
|
371
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
370
372
|
* @param camera defines the camera to use to compute distance
|
|
371
373
|
* @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
|
|
372
374
|
* @returns This mesh (for chaining)
|
package/Meshes/mesh.js
CHANGED
|
@@ -105,7 +105,7 @@ export class Mesh extends AbstractMesh {
|
|
|
105
105
|
// Members
|
|
106
106
|
/**
|
|
107
107
|
* Gets the delay loading state of the mesh (when delay loading is turned on)
|
|
108
|
-
* @see https://doc.babylonjs.com/
|
|
108
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/importers/incrementalLoading
|
|
109
109
|
*/
|
|
110
110
|
this.delayLoadState = 0;
|
|
111
111
|
/**
|
|
@@ -314,13 +314,14 @@ export class Mesh extends AbstractMesh {
|
|
|
314
314
|
return orientation || Mesh.FRONTSIDE; // works as Mesh.FRONTSIDE is 0
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
|
-
* Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance
|
|
317
|
+
* Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
|
|
318
318
|
*/
|
|
319
319
|
get useLODScreenCoverage() {
|
|
320
320
|
return this._internalMeshDataInfo._useLODScreenCoverage;
|
|
321
321
|
}
|
|
322
322
|
set useLODScreenCoverage(value) {
|
|
323
323
|
this._internalMeshDataInfo._useLODScreenCoverage = value;
|
|
324
|
+
this._sortLODLevels();
|
|
324
325
|
}
|
|
325
326
|
get computeBonesUsingShaders() {
|
|
326
327
|
return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
|
|
@@ -567,6 +568,8 @@ export class Mesh extends AbstractMesh {
|
|
|
567
568
|
* @see https://doc.babylonjs.com/how_to/how_to_use_lod
|
|
568
569
|
* @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
|
|
569
570
|
* If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
|
|
571
|
+
* Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
|
|
572
|
+
* Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
|
|
570
573
|
* @param mesh The mesh to be added as LOD level (can be null)
|
|
571
574
|
* @returns This mesh (for chaining)
|
|
572
575
|
*/
|
|
@@ -620,7 +623,7 @@ export class Mesh extends AbstractMesh {
|
|
|
620
623
|
}
|
|
621
624
|
/**
|
|
622
625
|
* Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
|
|
623
|
-
* @see https://doc.babylonjs.com/
|
|
626
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
|
|
624
627
|
* @param camera defines the camera to use to compute distance
|
|
625
628
|
* @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
|
|
626
629
|
* @returns This mesh (for chaining)
|
|
@@ -905,18 +908,25 @@ export class Mesh extends AbstractMesh {
|
|
|
905
908
|
// Shadows
|
|
906
909
|
const currentRenderPassId = engine.currentRenderPassId;
|
|
907
910
|
for (const light of this.lightSources) {
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
911
|
+
const generators = light.getShadowGenerators();
|
|
912
|
+
if (!generators) {
|
|
913
|
+
continue;
|
|
914
|
+
}
|
|
915
|
+
const iterator = generators.values();
|
|
916
|
+
for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
|
|
917
|
+
const generator = key.value;
|
|
918
|
+
if (generator && (!((_a = generator.getShadowMap()) === null || _a === void 0 ? void 0 : _a.renderList) || (((_b = generator.getShadowMap()) === null || _b === void 0 ? void 0 : _b.renderList) && ((_d = (_c = generator.getShadowMap()) === null || _c === void 0 ? void 0 : _c.renderList) === null || _d === void 0 ? void 0 : _d.indexOf(this)) !== -1))) {
|
|
919
|
+
if (generator.getShadowMap()) {
|
|
920
|
+
engine.currentRenderPassId = generator.getShadowMap().renderPassId;
|
|
921
|
+
}
|
|
922
|
+
for (const subMesh of this.subMeshes) {
|
|
923
|
+
if (!generator.isReady(subMesh, hardwareInstancedRendering, (_f = (_e = subMesh.getMaterial()) === null || _e === void 0 ? void 0 : _e.needAlphaBlendingForMesh(this)) !== null && _f !== void 0 ? _f : false)) {
|
|
924
|
+
engine.currentRenderPassId = currentRenderPassId;
|
|
925
|
+
return false;
|
|
926
|
+
}
|
|
917
927
|
}
|
|
928
|
+
engine.currentRenderPassId = currentRenderPassId;
|
|
918
929
|
}
|
|
919
|
-
engine.currentRenderPassId = currentRenderPassId;
|
|
920
930
|
}
|
|
921
931
|
}
|
|
922
932
|
// LOD
|
|
@@ -2148,20 +2158,21 @@ export class Mesh extends AbstractMesh {
|
|
|
2148
2158
|
const submeshes = this.subMeshes.splice(0);
|
|
2149
2159
|
this._resetPointsArrayCache();
|
|
2150
2160
|
let data = this.getVerticesData(VertexBuffer.PositionKind);
|
|
2151
|
-
|
|
2161
|
+
const temp = Vector3.Zero();
|
|
2152
2162
|
let index;
|
|
2153
2163
|
for (index = 0; index < data.length; index += 3) {
|
|
2154
|
-
Vector3.
|
|
2164
|
+
Vector3.TransformCoordinatesFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp).toArray(data, index);
|
|
2155
2165
|
}
|
|
2156
|
-
this.setVerticesData(VertexBuffer.PositionKind,
|
|
2166
|
+
this.setVerticesData(VertexBuffer.PositionKind, data, this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable());
|
|
2157
2167
|
// Normals
|
|
2158
2168
|
if (this.isVerticesDataPresent(VertexBuffer.NormalKind)) {
|
|
2159
2169
|
data = this.getVerticesData(VertexBuffer.NormalKind);
|
|
2160
|
-
temp = [];
|
|
2161
2170
|
for (index = 0; index < data.length; index += 3) {
|
|
2162
|
-
Vector3.
|
|
2171
|
+
Vector3.TransformNormalFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp)
|
|
2172
|
+
.normalize()
|
|
2173
|
+
.toArray(data, index);
|
|
2163
2174
|
}
|
|
2164
|
-
this.setVerticesData(VertexBuffer.NormalKind,
|
|
2175
|
+
this.setVerticesData(VertexBuffer.NormalKind, data, this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable());
|
|
2165
2176
|
}
|
|
2166
2177
|
// flip faces?
|
|
2167
2178
|
if (transform.determinant() < 0) {
|