@idetik/core 0.19.0 → 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.d.ts CHANGED
@@ -617,7 +617,7 @@ declare class Idetik {
617
617
  private readonly chunkManager_;
618
618
  private readonly context_;
619
619
  private readonly renderer_;
620
- private viewports_;
620
+ private readonly viewports_;
621
621
  readonly canvas: HTMLCanvasElement;
622
622
  readonly overlays: Overlay[];
623
623
  private readonly stats_?;
@@ -676,10 +676,6 @@ declare class Idetik {
676
676
  get renderedObjects(): number;
677
677
  get width(): number;
678
678
  get height(): number;
679
- get textureInfo(): {
680
- textures: number;
681
- totalBytes: number;
682
- };
683
679
  get viewports(): readonly Viewport[];
684
680
  get running(): boolean;
685
681
  getViewport(id: string): Viewport | undefined;
@@ -720,10 +716,6 @@ declare class WebGLRenderer extends Renderer {
720
716
  private renderedObjectsPerFrame_;
721
717
  constructor(canvas: HTMLCanvasElement);
722
718
  render(viewport: Viewport): void;
723
- get textureInfo(): {
724
- textures: number;
725
- totalBytes: number;
726
- };
727
719
  private initStencil;
728
720
  private renderLayer;
729
721
  protected renderObject(layer: Layer, objectIndex: number, camera: Camera): void;
package/dist/index.js CHANGED
@@ -1333,12 +1333,6 @@ class TC {
1333
1333
  this.disposeTexture(A);
1334
1334
  this.gpuTextureBytes_ = 0, this.textureCount_ = 0;
1335
1335
  }
1336
- get textureInfo() {
1337
- return {
1338
- textures: this.textureCount_,
1339
- totalBytes: this.gpuTextureBytes_
1340
- };
1341
- }
1342
1336
  alreadyActive(A) {
1343
1337
  return this.currentTexture_ === A && !A.needsUpdate;
1344
1338
  }
@@ -1699,27 +1693,35 @@ class bC extends jB {
1699
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);
1700
1694
  }
1701
1695
  render(A) {
1702
- let I = getComputedStyle(A.element).visibility !== "hidden";
1703
- 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(
1704
1702
  V(0, 0),
1705
1703
  V(this.width, this.height)
1706
- );
1707
- IA.equals(B.floor(), C.floor()) ? this.state_.setScissorTest(!1) : IA.intersects(B, C) ? (this.state_.setScissor(B), this.state_.setScissorTest(!0)) : (c.warn(
1708
- "WebGLRenderer",
1709
- `Viewport ${A.id} is entirely outside canvas bounds, skipping render`
1710
- ), I = !1), this.state_.setViewport(B), this.renderedObjectsPerFrame_ = 0, I && this.clear();
1711
- 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;
1712
1718
  this.state_.setDepthMask(!0);
1713
- const i = A.camera.frustum, o = { viewport: A };
1714
- for (const a of Q)
1715
- 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);
1716
1721
  this.state_.setDepthMask(!1);
1717
- for (const a of E)
1718
- a.update(o), a.state === "ready" && I && this.renderLayer(a, A.camera, i);
1719
- this.state_.setDepthMask(!0), this.renderedObjects_ = this.renderedObjectsPerFrame_;
1720
- }
1721
- get textureInfo() {
1722
- return this.textures_.textureInfo;
1722
+ for (const a of B)
1723
+ a.state === "ready" && this.renderLayer(a, A.camera, o);
1724
+ this.renderedObjects_ = this.renderedObjectsPerFrame_;
1723
1725
  }
1724
1726
  initStencil() {
1725
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);
@@ -2864,9 +2866,6 @@ class Hi {
2864
2866
  get height() {
2865
2867
  return this.renderer_.height;
2866
2868
  }
2867
- get textureInfo() {
2868
- return this.renderer_.textureInfo;
2869
- }
2870
2869
  get viewports() {
2871
2870
  return this.viewports_;
2872
2871
  }