@babylonjs/core 7.10.2 → 7.10.3
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/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +3 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -2
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +3 -1
- package/Engines/nativeEngine.js +2 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +2 -1
- package/Engines/thinEngine.js +2 -4
- package/Engines/thinEngine.js.map +1 -1
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +1 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/sceneLoader.d.ts +20 -11
- package/Loading/sceneLoader.js +10 -19
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +5 -3
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +3 -0
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +2 -3
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +6 -11
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +9 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -1
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/material.d.ts +3 -1
- package/Materials/material.js +8 -6
- package/Materials/material.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +1 -2
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +10 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +73 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -2
- package/Meshes/mesh.js +18 -20
- package/Meshes/mesh.js.map +1 -1
- package/Misc/filesInput.js +13 -0
- package/Misc/filesInput.js.map +1 -1
- package/Particles/particleSystemComponent.d.ts +3 -1
- package/Particles/particleSystemComponent.js +3 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +7 -2
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +1 -0
- package/Physics/v2/Plugins/havokPlugin.js +43 -0
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +1 -0
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsShape.d.ts +27 -0
- package/Physics/v2/physicsShape.js +39 -0
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -5
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/fogVertex.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/fogVertex.js +12 -0
- package/ShadersWGSL/ShadersInclude/fogVertex.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js +12 -0
- package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +35 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +70 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/logDepthDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js +12 -0
- package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/logDepthVertex.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/logDepthVertex.js +12 -0
- package/ShadersWGSL/ShadersInclude/logDepthVertex.js.map +1 -0
- package/ShadersWGSL/particles.vertex.d.ts +11 -0
- package/ShadersWGSL/particles.vertex.js +89 -0
- package/ShadersWGSL/particles.vertex.js.map +1 -0
- package/package.json +1 -1
package/Meshes/mesh.js
CHANGED
|
@@ -262,7 +262,7 @@ export class Mesh extends AbstractMesh {
|
|
|
262
262
|
this._instanceDataStorage.forceMatrixUpdates = value;
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
|
-
*
|
|
265
|
+
* Constructor
|
|
266
266
|
* @param name The value used by scene.getMeshByName() to do a lookup.
|
|
267
267
|
* @param scene The scene to add this mesh to.
|
|
268
268
|
* @param parent The parent of this mesh, if it has one
|
|
@@ -303,10 +303,6 @@ export class Mesh extends AbstractMesh {
|
|
|
303
303
|
// Use by builder only to know what orientation were the mesh build in.
|
|
304
304
|
/** @internal */
|
|
305
305
|
this._originalBuilderSideOrientation = Mesh.DEFAULTSIDE;
|
|
306
|
-
/**
|
|
307
|
-
* Use this property to change the original side orientation defined at construction time
|
|
308
|
-
*/
|
|
309
|
-
this.overrideMaterialSideOrientation = null;
|
|
310
306
|
/**
|
|
311
307
|
* Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default)
|
|
312
308
|
* You should not mix meshes that have this property set to true with meshes that have it set to false if they all write
|
|
@@ -316,6 +312,12 @@ export class Mesh extends AbstractMesh {
|
|
|
316
312
|
*/
|
|
317
313
|
this.ignoreCameraMaxZ = false;
|
|
318
314
|
scene = this.getScene();
|
|
315
|
+
if (this._scene.useRightHandedSystem) {
|
|
316
|
+
this.sideOrientation = 0;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.sideOrientation = 1;
|
|
320
|
+
}
|
|
319
321
|
this._onBeforeDraw = (isInstance, world, effectiveMaterial) => {
|
|
320
322
|
if (isInstance && effectiveMaterial) {
|
|
321
323
|
if (this._uniformBuffer) {
|
|
@@ -1906,14 +1908,11 @@ export class Mesh extends AbstractMesh {
|
|
|
1906
1908
|
let sideOrientation;
|
|
1907
1909
|
if (!instanceDataStorage.isFrozen &&
|
|
1908
1910
|
(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling ||
|
|
1909
|
-
this.
|
|
1911
|
+
this._internalMeshDataInfo._effectiveMaterial.sideOrientation !== null ||
|
|
1910
1912
|
this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)) {
|
|
1911
1913
|
// Note: if two sided lighting is enabled, we need to ensure that the normal will point in the right direction even if the determinant of the world matrix is negative
|
|
1912
1914
|
const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();
|
|
1913
|
-
sideOrientation = this.
|
|
1914
|
-
if (sideOrientation == null) {
|
|
1915
|
-
sideOrientation = this._internalMeshDataInfo._effectiveMaterial.sideOrientation;
|
|
1916
|
-
}
|
|
1915
|
+
sideOrientation = this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this);
|
|
1917
1916
|
if (mainDeterminant < 0) {
|
|
1918
1917
|
sideOrientation = sideOrientation === Material.ClockWiseSideOrientation ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;
|
|
1919
1918
|
}
|
|
@@ -2493,8 +2492,7 @@ export class Mesh extends AbstractMesh {
|
|
|
2493
2492
|
const normals = new Float32Array(indices.length * 3);
|
|
2494
2493
|
let normalsCount = 0;
|
|
2495
2494
|
// Decide if normals should be flipped
|
|
2496
|
-
const flipNormalGeneration = this.
|
|
2497
|
-
(this._scene.useRightHandedSystem ? 1 : 0);
|
|
2495
|
+
const flipNormalGeneration = this.sideOrientation === (this._scene.useRightHandedSystem ? 1 : 0);
|
|
2498
2496
|
// Generate new normals
|
|
2499
2497
|
for (let index = 0; index < indices.length; index += 3) {
|
|
2500
2498
|
const p1 = Vector3.FromArray(positions, indices[index] * 3);
|
|
@@ -3027,7 +3025,7 @@ export class Mesh extends AbstractMesh {
|
|
|
3027
3025
|
serializationObject.ellipsoidOffset = this.ellipsoidOffset.asArray();
|
|
3028
3026
|
serializationObject.doNotSyncBoundingInfo = this.doNotSyncBoundingInfo;
|
|
3029
3027
|
serializationObject.isBlocker = this.isBlocker;
|
|
3030
|
-
serializationObject.
|
|
3028
|
+
serializationObject.sideOrientation = this.sideOrientation;
|
|
3031
3029
|
// Parent
|
|
3032
3030
|
if (this.parent) {
|
|
3033
3031
|
this.parent._serializeAsParent(serializationObject);
|
|
@@ -3314,8 +3312,8 @@ export class Mesh extends AbstractMesh {
|
|
|
3314
3312
|
if (parsedMesh.ellipsoidOffset) {
|
|
3315
3313
|
mesh.ellipsoidOffset = Vector3.FromArray(parsedMesh.ellipsoidOffset);
|
|
3316
3314
|
}
|
|
3317
|
-
if (parsedMesh.
|
|
3318
|
-
mesh.
|
|
3315
|
+
if (parsedMesh.sideOrientation !== undefined) {
|
|
3316
|
+
mesh.sideOrientation = parsedMesh.sideOrientation;
|
|
3319
3317
|
}
|
|
3320
3318
|
if (parsedMesh.isBlocker !== undefined) {
|
|
3321
3319
|
mesh.isBlocker = parsedMesh.isBlocker;
|
|
@@ -3771,15 +3769,15 @@ export class Mesh extends AbstractMesh {
|
|
|
3771
3769
|
const materialIndexArray = new Array();
|
|
3772
3770
|
// Merge
|
|
3773
3771
|
const indiceArray = new Array();
|
|
3774
|
-
const
|
|
3772
|
+
const currentsideOrientation = meshes[0].sideOrientation;
|
|
3775
3773
|
for (index = 0; index < meshes.length; index++) {
|
|
3776
3774
|
const mesh = meshes[index];
|
|
3777
3775
|
if (mesh.isAnInstance) {
|
|
3778
3776
|
Logger.Warn("Cannot merge instance meshes.");
|
|
3779
3777
|
return null;
|
|
3780
3778
|
}
|
|
3781
|
-
if (
|
|
3782
|
-
Logger.Warn("Cannot merge meshes with different
|
|
3779
|
+
if (currentsideOrientation !== mesh.sideOrientation) {
|
|
3780
|
+
Logger.Warn("Cannot merge meshes with different sideOrientation values.");
|
|
3783
3781
|
return null;
|
|
3784
3782
|
}
|
|
3785
3783
|
if (subdivideWithSubMeshes) {
|
|
@@ -3856,7 +3854,7 @@ export class Mesh extends AbstractMesh {
|
|
|
3856
3854
|
}
|
|
3857
3855
|
// Setting properties
|
|
3858
3856
|
meshSubclass.checkCollisions = source.checkCollisions;
|
|
3859
|
-
meshSubclass.
|
|
3857
|
+
meshSubclass.sideOrientation = source.sideOrientation;
|
|
3860
3858
|
// Cleaning
|
|
3861
3859
|
if (disposeSource) {
|
|
3862
3860
|
for (index = 0; index < meshes.length; index++) {
|
|
@@ -3918,7 +3916,7 @@ export class Mesh extends AbstractMesh {
|
|
|
3918
3916
|
}
|
|
3919
3917
|
/** @internal */
|
|
3920
3918
|
_shouldConvertRHS() {
|
|
3921
|
-
return this.
|
|
3919
|
+
return this._scene.useRightHandedSystem && this.sideOrientation === Material.CounterClockWiseSideOrientation;
|
|
3922
3920
|
}
|
|
3923
3921
|
/** @internal */
|
|
3924
3922
|
_getRenderingFillMode(fillMode) {
|