@idetik/core 0.22.0 → 0.22.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 +1 -3
- package/dist/index.js +15 -20
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/chunk_store_view.d.ts.map +1 -1
- package/dist/types/src/core/layer.d.ts +1 -3
- package/dist/types/src/core/layer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -375,7 +375,6 @@ type LayerState = "initialized" | "loading" | "ready";
|
|
|
375
375
|
type BlendMode = "none" | "normal" | "additive" | "subtractive" | "multiply" | "premultiplied";
|
|
376
376
|
type StateChangeCallback = (newState: LayerState, prevState?: LayerState) => void;
|
|
377
377
|
interface LayerOptions {
|
|
378
|
-
transparent?: boolean;
|
|
379
378
|
opacity?: number;
|
|
380
379
|
blendMode?: BlendMode;
|
|
381
380
|
}
|
|
@@ -387,10 +386,9 @@ declare abstract class Layer {
|
|
|
387
386
|
private objects_;
|
|
388
387
|
private state_;
|
|
389
388
|
private readonly callbacks_;
|
|
390
|
-
transparent: boolean;
|
|
391
389
|
private opacity_;
|
|
392
390
|
blendMode: BlendMode;
|
|
393
|
-
constructor({
|
|
391
|
+
constructor({ opacity, blendMode }?: LayerOptions);
|
|
394
392
|
get opacity(): number;
|
|
395
393
|
set opacity(value: number);
|
|
396
394
|
abstract update(context?: RenderContext): void;
|
package/dist/index.js
CHANGED
|
@@ -1676,7 +1676,7 @@ class sC extends eQ {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
renderLayer(A, I, g) {
|
|
1678
1678
|
if (A.objects.length === 0) return;
|
|
1679
|
-
this.state_.setBlendingMode(A.
|
|
1679
|
+
this.state_.setBlendingMode(A.blendMode);
|
|
1680
1680
|
const B = A.hasMultipleLODs();
|
|
1681
1681
|
this.state_.setStencilTest(B), B && this.gl_.clear(this.gl_.STENCIL_BUFFER_BIT), A.objects.forEach((Q, E) => {
|
|
1682
1682
|
g.intersectsWithBox3(Q.boundingBox) && (this.renderObject(A, E, I), this.renderedObjectsPerFrame_ += 1);
|
|
@@ -8316,7 +8316,7 @@ class Ro extends eQ {
|
|
|
8316
8316
|
const E = this.device_.createCommandEncoder();
|
|
8317
8317
|
this.passEncoder_ = this.beginRenderPass(E);
|
|
8318
8318
|
const { x: i, y: o, width: s, height: t } = B.floor().toRect();
|
|
8319
|
-
this.passEncoder_.setViewport(i, o, s, t, 0, 1), Q && this.passEncoder_.setScissorRect(i, o, s, t), this.currentStencil_ = A.hasMultipleLODs(), this.currentStencil_ && this.passEncoder_.setStencilReference(0), this.currentBlendMode_ = A.
|
|
8319
|
+
this.passEncoder_.setViewport(i, o, s, t, 0, 1), Q && this.passEncoder_.setScissorRect(i, o, s, t), this.currentStencil_ = A.hasMultipleLODs(), this.currentStencil_ && this.passEncoder_.setStencilReference(0), this.currentBlendMode_ = A.blendMode, this.currentOpacity_ = A.opacity, A.objects.forEach((a, r) => {
|
|
8320
8320
|
g.intersectsWithBox3(a.boundingBox) && (this.renderObject(A, r, I), this.renderedObjectsPerFrame_ += 1);
|
|
8321
8321
|
}), this.passEncoder_.end(), this.device_.queue.submit([E.finish()]), this.passEncoder_ = null;
|
|
8322
8322
|
}
|
|
@@ -8659,18 +8659,18 @@ class Yo {
|
|
|
8659
8659
|
return;
|
|
8660
8660
|
}
|
|
8661
8661
|
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(mg);
|
|
8662
|
-
const E = this.channelsOfInterest(A), i = this.fallbackLOD(), o = (s
|
|
8663
|
-
const a = this.computePriority(
|
|
8662
|
+
const E = this.channelsOfInterest(A), i = this.fallbackLOD(), o = (s) => {
|
|
8663
|
+
const t = s.lod === i, a = s.lod === this.currentLOD_, r = this.computePriority(
|
|
8664
8664
|
t,
|
|
8665
|
-
|
|
8665
|
+
a,
|
|
8666
8666
|
!0,
|
|
8667
8667
|
!1,
|
|
8668
8668
|
!0
|
|
8669
8669
|
);
|
|
8670
|
-
|
|
8670
|
+
r !== null && this.chunkViewStates_.set(s, {
|
|
8671
8671
|
visible: !0,
|
|
8672
8672
|
prefetch: !1,
|
|
8673
|
-
priority:
|
|
8673
|
+
priority: r,
|
|
8674
8674
|
orderKey: 0
|
|
8675
8675
|
});
|
|
8676
8676
|
};
|
|
@@ -8678,12 +8678,12 @@ class Yo {
|
|
|
8678
8678
|
Q,
|
|
8679
8679
|
this.currentLOD_,
|
|
8680
8680
|
E,
|
|
8681
|
-
|
|
8681
|
+
o
|
|
8682
8682
|
), this.currentLOD_ !== i && this.iterateAllChunksAtLod(
|
|
8683
8683
|
Q,
|
|
8684
8684
|
i,
|
|
8685
8685
|
E,
|
|
8686
|
-
|
|
8686
|
+
o
|
|
8687
8687
|
), this.markTimeChunksForPrefetchVolume(Q, A), this.policyChanged_ = !1, this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0, this.lastViewProjection_ = g;
|
|
8688
8688
|
}
|
|
8689
8689
|
allVisibleFallbackLODLoaded() {
|
|
@@ -9173,7 +9173,7 @@ class uo {
|
|
|
9173
9173
|
partitionLayers() {
|
|
9174
9174
|
const A = [], I = [];
|
|
9175
9175
|
for (const g of this.layers)
|
|
9176
|
-
g.
|
|
9176
|
+
g.blendMode === "none" ? A.push(g) : I.push(g);
|
|
9177
9177
|
return { opaque: A, transparent: I };
|
|
9178
9178
|
}
|
|
9179
9179
|
add(A) {
|
|
@@ -10101,18 +10101,13 @@ class Rg {
|
|
|
10101
10101
|
objects_ = [];
|
|
10102
10102
|
state_ = "initialized";
|
|
10103
10103
|
callbacks_ = [];
|
|
10104
|
-
transparent;
|
|
10105
10104
|
opacity_;
|
|
10106
10105
|
blendMode;
|
|
10107
|
-
constructor({
|
|
10108
|
-
|
|
10109
|
-
opacity: I = 1,
|
|
10110
|
-
blendMode: g = "normal"
|
|
10111
|
-
} = {}) {
|
|
10112
|
-
(I < 0 || I > 1) && u.warn(
|
|
10106
|
+
constructor({ opacity: A = 1, blendMode: I = "none" } = {}) {
|
|
10107
|
+
(A < 0 || A > 1) && u.warn(
|
|
10113
10108
|
"Layer",
|
|
10114
|
-
`Layer opacity out of bounds: ${
|
|
10115
|
-
), this.
|
|
10109
|
+
`Layer opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
|
|
10110
|
+
), this.opacity_ = XA(A, 0, 1), this.blendMode = I;
|
|
10116
10111
|
}
|
|
10117
10112
|
get opacity() {
|
|
10118
10113
|
return this.opacity_;
|
|
@@ -10994,7 +10989,7 @@ class ra extends Rg {
|
|
|
10994
10989
|
this.channelChangeCallbacks_.splice(I, 1);
|
|
10995
10990
|
}
|
|
10996
10991
|
constructor({ source: A, sliceCoords: I, policy: g, channelProps: B }) {
|
|
10997
|
-
super({
|
|
10992
|
+
super({ blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.sourcePolicy_ = g, this.initialChannelProps_ = B, this.channelProps_ = B, this.setState("initialized");
|
|
10998
10993
|
}
|
|
10999
10994
|
getOrCreateVolume(A, I) {
|
|
11000
10995
|
const g = this.currentVolumes_.get(A);
|