@idetik/core 0.19.1 → 0.19.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.
package/dist/index.js CHANGED
@@ -1693,24 +1693,35 @@ class bC extends jB {
1693
1693
  ), this.programs_ = new DC(I), this.bindings_ = new uC(I), this.textures_ = new TC(I), this.state_ = new WC(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
1694
1694
  }
1695
1695
  render(A) {
1696
- let I = getComputedStyle(A.element).visibility !== "hidden";
1697
- const B = A.getBoxRelativeTo(this.canvas), C = new IA(
1696
+ this.renderedObjects_ = 0, this.renderedObjectsPerFrame_ = 0;
1697
+ const { opaque: I, transparent: B } = A.layerManager.partitionLayers();
1698
+ for (const a of [...I, ...B])
1699
+ a.update({ viewport: A });
1700
+ if (getComputedStyle(A.element).visibility === "hidden") return;
1701
+ const C = A.getBoxRelativeTo(this.canvas), Q = new IA(
1698
1702
  V(0, 0),
1699
1703
  V(this.width, this.height)
1700
- );
1701
- IA.equals(B.floor(), C.floor()) ? this.state_.setScissorTest(!1) : IA.intersects(B, C) ? (this.state_.setScissor(B), this.state_.setScissorTest(!0)) : (c.warn(
1702
- "WebGLRenderer",
1703
- `Viewport ${A.id} is entirely outside canvas bounds, skipping render`
1704
- ), I = !1), this.state_.setViewport(B), this.renderedObjectsPerFrame_ = 0, I && this.clear();
1705
- const { opaque: Q, transparent: E } = A.layerManager.partitionLayers();
1704
+ ), E = IA.equals(C.floor(), Q.floor()), i = IA.intersects(C, Q);
1705
+ if (E)
1706
+ this.state_.setScissorTest(!1);
1707
+ else if (i)
1708
+ this.state_.setScissorTest(!0), this.state_.setScissor(C);
1709
+ else {
1710
+ c.warn(
1711
+ "WebGLRenderer",
1712
+ `Viewport ${A.id} is entirely outside canvas bounds, skipping render`
1713
+ );
1714
+ return;
1715
+ }
1716
+ this.clear();
1717
+ const o = A.camera.frustum;
1706
1718
  this.state_.setDepthMask(!0);
1707
- const i = A.camera.frustum, o = { viewport: A };
1708
- for (const a of Q)
1709
- a.update(o), a.state === "ready" && I && this.renderLayer(a, A.camera, i);
1719
+ for (const a of I)
1720
+ a.state === "ready" && this.renderLayer(a, A.camera, o);
1710
1721
  this.state_.setDepthMask(!1);
1711
- for (const a of E)
1712
- a.update(o), a.state === "ready" && I && this.renderLayer(a, A.camera, i);
1713
- this.state_.setDepthMask(!0), this.renderedObjects_ = this.renderedObjectsPerFrame_;
1722
+ for (const a of B)
1723
+ a.state === "ready" && this.renderLayer(a, A.camera, o);
1724
+ this.renderedObjects_ = this.renderedObjectsPerFrame_;
1714
1725
  }
1715
1726
  initStencil() {
1716
1727
  this.gl_.clearStencil(0), this.gl_.stencilMask(255), this.gl_.stencilFunc(this.gl_.EQUAL, 0, 255), this.gl_.stencilOp(this.gl_.KEEP, this.gl_.KEEP, this.gl_.INCR);