@babylonjs/core 8.2.2 → 8.3.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.
Files changed (48) hide show
  1. package/AudioV2/webAudio/webAudioEngine.d.ts +1 -0
  2. package/AudioV2/webAudio/webAudioEngine.js +12 -3
  3. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  4. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +14 -2
  5. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  6. package/Engines/Native/nativeInterfaces.d.ts +6 -6
  7. package/Engines/Native/nativeInterfaces.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/nativeEngine.js +13 -15
  11. package/Engines/nativeEngine.js.map +1 -1
  12. package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.d.ts +25 -0
  13. package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.js +35 -0
  14. package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.js.map +1 -0
  15. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.d.ts +34 -0
  16. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.js +74 -0
  17. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.js.map +1 -0
  18. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  19. package/FrameGraph/Node/Blocks/index.js +2 -0
  20. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  21. package/FrameGraph/Tasks/PostProcesses/fxaaTask.d.ts +17 -0
  22. package/FrameGraph/Tasks/PostProcesses/fxaaTask.js +23 -0
  23. package/FrameGraph/Tasks/PostProcesses/fxaaTask.js.map +1 -0
  24. package/FrameGraph/Tasks/PostProcesses/grainTask.d.ts +16 -0
  25. package/FrameGraph/Tasks/PostProcesses/grainTask.js +17 -0
  26. package/FrameGraph/Tasks/PostProcesses/grainTask.js.map +1 -0
  27. package/FrameGraph/index.d.ts +2 -0
  28. package/FrameGraph/index.js +2 -0
  29. package/FrameGraph/index.js.map +1 -1
  30. package/Meshes/meshUtils.d.ts +11 -1
  31. package/Meshes/meshUtils.js +22 -0
  32. package/Meshes/meshUtils.js.map +1 -1
  33. package/PostProcesses/fxaaPostProcess.d.ts +2 -2
  34. package/PostProcesses/fxaaPostProcess.js +17 -27
  35. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  36. package/PostProcesses/grainPostProcess.d.ts +6 -3
  37. package/PostProcesses/grainPostProcess.js +35 -24
  38. package/PostProcesses/grainPostProcess.js.map +1 -1
  39. package/PostProcesses/index.d.ts +2 -0
  40. package/PostProcesses/index.js +2 -0
  41. package/PostProcesses/index.js.map +1 -1
  42. package/PostProcesses/thinFXAAPostProcess.d.ts +34 -0
  43. package/PostProcesses/thinFXAAPostProcess.js +70 -0
  44. package/PostProcesses/thinFXAAPostProcess.js.map +1 -0
  45. package/PostProcesses/thinGrainPostProcess.d.ts +32 -0
  46. package/PostProcesses/thinGrainPostProcess.js +55 -0
  47. package/PostProcesses/thinGrainPostProcess.js.map +1 -0
  48. package/package.json +1 -1
@@ -505,7 +505,7 @@ export class NativeEngine extends Engine {
505
505
  }
506
506
  // Apply states
507
507
  this._drawCalls.addCount(1, false);
508
- if (instancesCount && _native.Engine.COMMAND_DRAWINDEXEDINSTANCED) {
508
+ if (instancesCount) {
509
509
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXEDINSTANCED);
510
510
  this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
511
511
  this._commandBufferEncoder.encodeCommandArgAsUInt32(indexStart);
@@ -519,7 +519,6 @@ export class NativeEngine extends Engine {
519
519
  this._commandBufferEncoder.encodeCommandArgAsUInt32(indexCount);
520
520
  }
521
521
  this._commandBufferEncoder.finishEncodingCommand();
522
- // }
523
522
  }
524
523
  /**
525
524
  * Draw a list of unindexed primitives
@@ -534,7 +533,7 @@ export class NativeEngine extends Engine {
534
533
  }
535
534
  // Apply states
536
535
  this._drawCalls.addCount(1, false);
537
- if (instancesCount && _native.Engine.COMMAND_DRAWINSTANCED) {
536
+ if (instancesCount) {
538
537
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINSTANCED);
539
538
  this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
540
539
  this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesStart);
@@ -548,10 +547,9 @@ export class NativeEngine extends Engine {
548
547
  this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesCount);
549
548
  }
550
549
  this._commandBufferEncoder.finishEncodingCommand();
551
- // }
552
550
  }
553
551
  createPipelineContext(shaderProcessingContext) {
554
- const isAsync = !!(this._caps.parallelShaderCompile && this._engine.createProgramAsync);
552
+ const isAsync = !!this._caps.parallelShaderCompile;
555
553
  return new NativePipelineContext(this, isAsync, shaderProcessingContext);
556
554
  }
557
555
  createMaterialContext() {
@@ -1297,9 +1295,15 @@ export class NativeEngine extends Engine {
1297
1295
  premulAlpha = false;
1298
1296
  }
1299
1297
  if (!!texture && !!texture._hardwareTexture) {
1300
- const source = canvas.getCanvasTexture();
1301
1298
  const destination = texture._hardwareTexture.underlyingResource;
1302
- this._engine.copyTexture(destination, source);
1299
+ const context = canvas.getContext();
1300
+ // flush need to happen before getCanvasTexture: flush will create the render target synchronously (if it's not been created before)
1301
+ context.flush();
1302
+ const source = canvas.getCanvasTexture();
1303
+ this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_COPYTEXTURE);
1304
+ this._commandBufferEncoder.encodeCommandArgAsNativeData(source);
1305
+ this._commandBufferEncoder.encodeCommandArgAsNativeData(destination);
1306
+ this._commandBufferEncoder.finishEncodingCommand();
1303
1307
  texture.isReady = true;
1304
1308
  }
1305
1309
  }
@@ -1958,9 +1962,6 @@ export class NativeEngine extends Engine {
1958
1962
  this._commandBufferEncoder.finishEncodingCommand();
1959
1963
  }
1960
1964
  _unsetNativeTexture(uniform) {
1961
- if (!_native.Engine.COMMAND_UNSETTEXTURE) {
1962
- return;
1963
- }
1964
1965
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNSETTEXTURE);
1965
1966
  this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
1966
1967
  this._commandBufferEncoder.finishEncodingCommand();
@@ -2001,9 +2002,6 @@ export class NativeEngine extends Engine {
2001
2002
  * Unbind all textures
2002
2003
  */
2003
2004
  unbindAllTextures() {
2004
- if (!_native.Engine.COMMAND_DISCARDALLTEXTURES) {
2005
- return;
2006
- }
2007
2005
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DISCARDALLTEXTURES);
2008
2006
  this._commandBufferEncoder.finishEncodingCommand();
2009
2007
  }
@@ -2128,10 +2126,10 @@ export class NativeEngine extends Engine {
2128
2126
  return this._gpuFrameTimeToken;
2129
2127
  }
2130
2128
  endTimeQuery(token) {
2131
- this._engine.populateFrameStats?.(this._frameStats);
2129
+ this._engine.populateFrameStats(this._frameStats);
2132
2130
  return this._frameStats.gpuTimeNs;
2133
2131
  }
2134
2132
  }
2135
2133
  // This must match the protocol version in NativeEngine.cpp
2136
- NativeEngine.PROTOCOL_VERSION = 8;
2134
+ NativeEngine.PROTOCOL_VERSION = 9;
2137
2135
  //# sourceMappingURL=nativeEngine.js.map