@babylonjs/core 5.3.0 → 5.4.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 (50) hide show
  1. package/Behaviors/Cameras/autoRotationBehavior.d.ts +7 -0
  2. package/Behaviors/Cameras/autoRotationBehavior.js +15 -0
  3. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  4. package/Cameras/camera.d.ts +2 -1
  5. package/Cameras/camera.js +4 -1
  6. package/Cameras/camera.js.map +1 -1
  7. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -2
  8. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  9. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +1 -1
  10. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  11. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
  12. package/Engines/WebGPU/webgpuTextureHelper.js +16 -3
  13. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  14. package/Engines/constants.d.ts +4 -0
  15. package/Engines/constants.js +4 -0
  16. package/Engines/constants.js.map +1 -1
  17. package/Engines/engine.d.ts +2 -2
  18. package/Engines/thinEngine.js +2 -2
  19. package/Engines/thinEngine.js.map +1 -1
  20. package/Engines/webgpuEngine.js +14 -5
  21. package/Engines/webgpuEngine.js.map +1 -1
  22. package/Layers/effectLayer.js +1 -1
  23. package/Layers/effectLayer.js.map +1 -1
  24. package/Materials/Background/backgroundMaterial.js +1 -1
  25. package/Materials/Background/backgroundMaterial.js.map +1 -1
  26. package/Materials/Textures/cubeTexture.js +3 -0
  27. package/Materials/Textures/cubeTexture.js.map +1 -1
  28. package/Materials/materialHelper.js +1 -1
  29. package/Materials/materialHelper.js.map +1 -1
  30. package/Materials/shaderMaterial.js +1 -0
  31. package/Materials/shaderMaterial.js.map +1 -1
  32. package/Maths/math.vector.d.ts +4 -0
  33. package/Maths/math.vector.js +10 -0
  34. package/Maths/math.vector.js.map +1 -1
  35. package/Meshes/subMesh.js +1 -1
  36. package/Meshes/subMesh.js.map +1 -1
  37. package/Meshes/thinInstanceMesh.js +2 -1
  38. package/Meshes/thinInstanceMesh.js.map +1 -1
  39. package/Physics/Plugins/oimoJSPlugin.js +1 -1
  40. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  41. package/Rendering/renderingGroup.js +8 -0
  42. package/Rendering/renderingGroup.js.map +1 -1
  43. package/Shaders/pbr.vertex.js +1 -1
  44. package/Shaders/pbr.vertex.js.map +1 -1
  45. package/XR/features/WebXRControllerPointerSelection.js +1 -0
  46. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  47. package/package.json +1 -1
  48. package/scene.d.ts +3 -1
  49. package/scene.js +7 -3
  50. package/scene.js.map +1 -1
@@ -675,8 +675,8 @@ var WebGPUEngine = /** @class */ (function (_super) {
675
675
  depthLoadOp: WebGPUConstants.LoadOp.Clear,
676
676
  depthStoreOp: WebGPUConstants.StoreOp.Store,
677
677
  stencilClearValue: this._clearStencilValue,
678
- stencilLoadOp: WebGPUConstants.LoadOp.Clear,
679
- stencilStoreOp: WebGPUConstants.StoreOp.Store,
678
+ stencilLoadOp: !this.isStencilEnable ? undefined : WebGPUConstants.LoadOp.Clear,
679
+ stencilStoreOp: !this.isStencilEnable ? undefined : WebGPUConstants.StoreOp.Store,
680
680
  };
681
681
  this._mainRenderPassWrapper.renderPassDescriptor = {
682
682
  colorAttachments: mainColorAttachments,
@@ -2089,6 +2089,7 @@ var WebGPUEngine = /** @class */ (function (_super) {
2089
2089
  var gpuDepthStencilMSAATexture = gpuDepthStencilWrapper === null || gpuDepthStencilWrapper === void 0 ? void 0 : gpuDepthStencilWrapper.msaaTexture;
2090
2090
  var depthTextureView = gpuDepthStencilTexture === null || gpuDepthStencilTexture === void 0 ? void 0 : gpuDepthStencilTexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
2091
2091
  var depthMSAATextureView = gpuDepthStencilMSAATexture === null || gpuDepthStencilMSAATexture === void 0 ? void 0 : gpuDepthStencilMSAATexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
2092
+ var depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) : false;
2092
2093
  var colorAttachments = [];
2093
2094
  if (this.useReverseDepthBuffer) {
2094
2095
  this.setDepthFunctionToGreaterOrEqual();
@@ -2149,8 +2150,12 @@ var WebGPUEngine = /** @class */ (function (_super) {
2149
2150
  depthLoadOp: mustClearDepth ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load,
2150
2151
  depthStoreOp: WebGPUConstants.StoreOp.Store,
2151
2152
  stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : undefined,
2152
- stencilLoadOp: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load,
2153
- stencilStoreOp: WebGPUConstants.StoreOp.Store,
2153
+ stencilLoadOp: !depthTextureHasStencil
2154
+ ? undefined
2155
+ : rtWrapper._depthStencilTextureWithStencil && mustClearStencil
2156
+ ? WebGPUConstants.LoadOp.Clear
2157
+ : WebGPUConstants.LoadOp.Load,
2158
+ stencilStoreOp: !depthTextureHasStencil ? undefined : WebGPUConstants.StoreOp.Store,
2154
2159
  }
2155
2160
  : undefined,
2156
2161
  occlusionQuerySet: ((_b = this._occlusionQuery) === null || _b === void 0 ? void 0 : _b.hasQueries) ? this._occlusionQuery.querySet : undefined,
@@ -2236,7 +2241,11 @@ var WebGPUEngine = /** @class */ (function (_super) {
2236
2241
  : undefined;
2237
2242
  this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = mustClearDepth ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load;
2238
2243
  this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = mustClearStencil ? this._clearStencilValue : undefined;
2239
- this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = mustClearStencil ? WebGPUConstants.LoadOp.Clear : WebGPUConstants.LoadOp.Load;
2244
+ this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = !this.isStencilEnable
2245
+ ? undefined
2246
+ : mustClearStencil
2247
+ ? WebGPUConstants.LoadOp.Clear
2248
+ : WebGPUConstants.LoadOp.Load;
2240
2249
  this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = ((_a = this._occlusionQuery) === null || _a === void 0 ? void 0 : _a.hasQueries) ? this._occlusionQuery.querySet : undefined;
2241
2250
  this._swapChainTexture = this._context.getCurrentTexture();
2242
2251
  this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(this._swapChainTexture);