@babylonjs/core 7.15.1 → 7.15.2

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 (45) hide show
  1. package/Cameras/Inputs/BaseCameraPointersInput.js +1 -1
  2. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  3. package/Collisions/gpuPicker.d.ts +6 -0
  4. package/Collisions/gpuPicker.js +47 -20
  5. package/Collisions/gpuPicker.js.map +1 -1
  6. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +3 -0
  7. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +19 -1
  8. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  9. package/Engines/abstractEngine.js +2 -2
  10. package/Engines/abstractEngine.js.map +1 -1
  11. package/Engines/thinEngine.js +4 -3
  12. package/Engines/thinEngine.js.map +1 -1
  13. package/Layers/effectLayer.js +9 -1
  14. package/Layers/effectLayer.js.map +1 -1
  15. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +13 -5
  16. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  17. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.d.ts +2 -0
  18. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js +36 -8
  19. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
  20. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +15 -9
  21. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
  22. package/Materials/Node/Blocks/Teleport/teleportInBlock.js +2 -0
  23. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  24. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +6 -2
  25. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  26. package/Materials/PBR/pbrSubSurfaceConfiguration.js +27 -3
  27. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  28. package/Materials/Textures/renderTargetTexture.js +1 -0
  29. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  30. package/Meshes/Node/Blocks/randomBlock.d.ts +3 -1
  31. package/Meshes/Node/Blocks/randomBlock.js +6 -0
  32. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  33. package/Meshes/abstractMesh.d.ts +13 -1
  34. package/Meshes/abstractMesh.js +37 -4
  35. package/Meshes/abstractMesh.js.map +1 -1
  36. package/ShadersWGSL/ShadersInclude/packingFunctions.d.ts +5 -0
  37. package/ShadersWGSL/ShadersInclude/packingFunctions.js +12 -0
  38. package/ShadersWGSL/ShadersInclude/packingFunctions.js.map +1 -0
  39. package/ShadersWGSL/ShadersInclude/shadowMapFragment.d.ts +5 -0
  40. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js +36 -0
  41. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js.map +1 -0
  42. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.d.ts +5 -0
  43. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js +33 -0
  44. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js.map +1 -0
  45. package/package.json +1 -1
@@ -145,6 +145,11 @@ class _InternalAbstractMeshDataInfo {
145
145
  * We use that as a clue to force the material to sideOrientation = null
146
146
  */
147
147
  this._sideOrientationHint = false;
148
+ /**
149
+ * @internal
150
+ * if this is set to true, the mesh will be visible only if its parent(s) are also visible
151
+ */
152
+ this._inheritVisibility = false;
148
153
  }
149
154
  }
150
155
  /**
@@ -326,6 +331,37 @@ export class AbstractMesh extends TransformNode {
326
331
  });
327
332
  }
328
333
  }
334
+ /**
335
+ * If set to true, a mesh will only be visible only if its parent(s) are also visible (default is false)
336
+ */
337
+ get inheritVisibility() {
338
+ return this._internalAbstractMeshDataInfo._inheritVisibility;
339
+ }
340
+ set inheritVisibility(value) {
341
+ this._internalAbstractMeshDataInfo._inheritVisibility = value;
342
+ }
343
+ /**
344
+ * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true
345
+ */
346
+ get isVisible() {
347
+ if (!this._isVisible || !this.inheritVisibility || !this._parentNode) {
348
+ return this._isVisible;
349
+ }
350
+ if (this._isVisible) {
351
+ let parent = this._parentNode;
352
+ while (parent) {
353
+ const parentVisible = parent.isVisible;
354
+ if (typeof parentVisible !== "undefined") {
355
+ return parentVisible;
356
+ }
357
+ parent = parent.parent;
358
+ }
359
+ }
360
+ return this._isVisible;
361
+ }
362
+ set isVisible(value) {
363
+ this._isVisible = value;
364
+ }
329
365
  /**
330
366
  * Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false).
331
367
  * Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh.
@@ -615,10 +651,7 @@ export class AbstractMesh extends TransformNode {
615
651
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#alpha-index
616
652
  */
617
653
  this.alphaIndex = Number.MAX_VALUE;
618
- /**
619
- * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true
620
- */
621
- this.isVisible = true;
654
+ this._isVisible = true;
622
655
  /**
623
656
  * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
624
657
  */