@itwin/core-frontend 3.1.0-dev.15 → 3.1.0-dev.22

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 (41) hide show
  1. package/lib/cjs/IModelConnection.d.ts +3 -5
  2. package/lib/cjs/IModelConnection.d.ts.map +1 -1
  3. package/lib/cjs/IModelConnection.js +4 -10
  4. package/lib/cjs/IModelConnection.js.map +1 -1
  5. package/lib/cjs/ImageUtil.d.ts.map +1 -1
  6. package/lib/cjs/ImageUtil.js +8 -14
  7. package/lib/cjs/ImageUtil.js.map +1 -1
  8. package/lib/cjs/Viewport.d.ts +8 -8
  9. package/lib/cjs/Viewport.d.ts.map +1 -1
  10. package/lib/cjs/Viewport.js.map +1 -1
  11. package/lib/cjs/render/webgl/SceneCompositor.js +14 -13
  12. package/lib/cjs/render/webgl/SceneCompositor.js.map +1 -1
  13. package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  14. package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +4 -3
  15. package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  16. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +1 -1
  17. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  18. package/lib/cjs/tools/ViewTool.d.ts +4 -4
  19. package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
  20. package/lib/cjs/tools/ViewTool.js.map +1 -1
  21. package/lib/esm/IModelConnection.d.ts +3 -5
  22. package/lib/esm/IModelConnection.d.ts.map +1 -1
  23. package/lib/esm/IModelConnection.js +5 -11
  24. package/lib/esm/IModelConnection.js.map +1 -1
  25. package/lib/esm/ImageUtil.d.ts.map +1 -1
  26. package/lib/esm/ImageUtil.js +8 -14
  27. package/lib/esm/ImageUtil.js.map +1 -1
  28. package/lib/esm/Viewport.d.ts +8 -8
  29. package/lib/esm/Viewport.d.ts.map +1 -1
  30. package/lib/esm/Viewport.js.map +1 -1
  31. package/lib/esm/render/webgl/SceneCompositor.js +14 -13
  32. package/lib/esm/render/webgl/SceneCompositor.js.map +1 -1
  33. package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  34. package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +4 -3
  35. package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  36. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +1 -1
  37. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  38. package/lib/esm/tools/ViewTool.d.ts +4 -4
  39. package/lib/esm/tools/ViewTool.d.ts.map +1 -1
  40. package/lib/esm/tools/ViewTool.js.map +1 -1
  41. package/package.json +20 -20
@@ -1673,12 +1673,14 @@ class MRTCompositor extends Compositor {
1673
1673
  });
1674
1674
  }
1675
1675
  renderOpaque(commands, compositeFlags, renderForReadPixels) {
1676
- // Output the first 2 passes to color and pick data buffers. (All 3 in the case of rendering for readPixels()).
1677
- this._readPickDataFromPingPong = true;
1678
1676
  const needComposite = 0 /* None */ !== compositeFlags;
1679
1677
  const needAO = 0 /* None */ !== (compositeFlags & 4 /* AmbientOcclusion */);
1680
1678
  const fbStack = System.instance.frameBufferStack;
1681
- fbStack.execute(needComposite ? this._fbos.opaqueAndCompositeAll : this._fbos.opaqueAll, true, this.useMsBuffers, () => {
1679
+ // Output the first 2 passes to color and pick data buffers. (All 3 in the case of rendering for readPixels() or ambient occlusion).
1680
+ let fbo = (needComposite ? this._fbos.opaqueAndCompositeAll : this._fbos.opaqueAll);
1681
+ const useMsBuffers = fbo.isMultisampled && this.useMsBuffers;
1682
+ this._readPickDataFromPingPong = !useMsBuffers; // if multisampling then can read pick textures directly.
1683
+ fbStack.execute(fbo, true, useMsBuffers, () => {
1682
1684
  this.drawPass(commands, 2 /* OpaqueLinear */);
1683
1685
  this.drawPass(commands, 3 /* OpaquePlanar */, true);
1684
1686
  if (needAO || renderForReadPixels) {
@@ -1686,33 +1688,32 @@ class MRTCompositor extends Compositor {
1686
1688
  this._primitiveDrawState = PrimitiveDrawState.Pickable;
1687
1689
  this.drawPass(commands, 4 /* OpaqueGeneral */, true);
1688
1690
  this._primitiveDrawState = PrimitiveDrawState.Both;
1689
- if (this.useMsBuffers) {
1690
- const fbo = (needComposite ? this._fbos.opaqueAndCompositeAll : this._fbos.opaqueAll);
1691
+ if (useMsBuffers)
1691
1692
  fbo.blitMsBuffersToTextures(true);
1692
- }
1693
1693
  }
1694
1694
  });
1695
1695
  this._readPickDataFromPingPong = false;
1696
1696
  // The general pass (and following) will not bother to write to pick buffers and so can read from the actual pick buffers.
1697
1697
  if (!renderForReadPixels) {
1698
- fbStack.execute(needComposite ? this._fbos.opaqueAndCompositeColor : this._fbos.opaqueColor, true, this.useMsBuffers, () => {
1698
+ fbo = (needComposite ? this._fbos.opaqueAndCompositeColor : this._fbos.opaqueColor);
1699
+ fbStack.execute(fbo, true, useMsBuffers, () => {
1699
1700
  if (needAO)
1700
1701
  this._primitiveDrawState = PrimitiveDrawState.NonPickable;
1701
1702
  this.drawPass(commands, 4 /* OpaqueGeneral */, false);
1702
1703
  this._primitiveDrawState = PrimitiveDrawState.Both;
1703
1704
  this.drawPass(commands, 8 /* HiddenEdge */, false);
1704
1705
  });
1705
- if (this.useMsBuffers) {
1706
- const fbo = (needComposite ? this._fbos.opaqueAndCompositeColor : this._fbos.opaqueColor);
1706
+ if (useMsBuffers)
1707
1707
  fbo.blitMsBuffersToTextures(needComposite);
1708
- }
1709
1708
  }
1710
1709
  if (needAO)
1711
1710
  this.renderAmbientOcclusion();
1712
1711
  }
1713
1712
  renderLayers(commands, needComposite, pass) {
1714
- this._readPickDataFromPingPong = true;
1715
- System.instance.frameBufferStack.execute(needComposite ? this._fbos.opaqueAndCompositeAll : this._fbos.opaqueAll, true, 1 /* OpaqueLayers */ === pass && this.useMsBuffers, () => {
1713
+ const fbo = (needComposite ? this._fbos.opaqueAndCompositeAll : this._fbos.opaqueAll);
1714
+ const useMsBuffers = 1 /* OpaqueLayers */ === pass && fbo.isMultisampled && this.useMsBuffers;
1715
+ this._readPickDataFromPingPong = !useMsBuffers;
1716
+ System.instance.frameBufferStack.execute(fbo, true, useMsBuffers, () => {
1716
1717
  this.drawPass(commands, pass, true);
1717
1718
  });
1718
1719
  this._readPickDataFromPingPong = false;
@@ -1758,7 +1759,7 @@ class MRTCompositor extends Compositor {
1758
1759
  }
1759
1760
  pingPong() {
1760
1761
  if (this._fbos.opaqueAll.isMultisampled && this.useMsBuffers) {
1761
- // If we are multisampling we can just blit the FeatureId and DepthAndOrder buffers to their textures.
1762
+ // If we are multisampling we can just blit the FeatureId and DepthAndOrder MS buffers to their textures.
1762
1763
  this._fbos.opaqueAll.blitMsBuffersToTextures(false, 1);
1763
1764
  this._fbos.opaqueAll.blitMsBuffersToTextures(false, 2);
1764
1765
  }