@margoengine/points 0.1.0 → 1.0.0
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/LICENSE +201 -201
- package/NOTICE +4 -4
- package/README.md +877 -794
- package/dist/copc-write.d.ts +95 -0
- package/dist/copc-write.js +318 -0
- package/dist/copc.d.ts +1 -1
- package/dist/copc.js +25 -28
- package/dist/frame.d.ts +5 -0
- package/dist/index.js +66 -66
- package/dist/laz-encode-CHXgHra_.js +446 -0
- package/dist/laz-encode.d.ts +14 -0
- package/dist/laz-model-DCphHLqH.js +385 -0
- package/dist/laz-model.d.ts +47 -0
- package/dist/laz-write.d.ts +46 -0
- package/dist/laz-write.js +75 -0
- package/dist/laz.js +198 -578
- package/dist/material.d.ts +3 -3
- package/dist/octree.js +3 -3
- package/dist/pick.js +20 -20
- package/dist/plugin.d.ts +3 -3
- package/dist/potree-las-RC8sjbYU.js +1 -0
- package/dist/potree-las.d.ts +1 -0
- package/dist/potree.js +1 -1
- package/dist/{shaders-Deu8H36P.js → shaders-DCnbvb0-.js} +50 -46
- package/dist/shared/fog.d.ts +33 -33
- package/dist/shared/pass.d.ts +53 -53
- package/dist/shared/selection-mask.d.ts +52 -52
- package/dist/shared/style-expression.d.ts +18 -18
- package/dist/sprites.d.ts +1 -1
- package/dist/style.js +1 -0
- package/dist/surfels.js +68 -68
- package/package.json +104 -96
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
// @margo/core-built
|
|
1
|
+
// @margo/core-built 1.0.0
|
|
2
2
|
import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
|
|
3
3
|
|
|
4
4
|
import { a as e, c as t, d as n, l as r, o as i, r as a, s as o, t as s, u as c } from "./tier-BcFbLPVT.js";
|
|
5
5
|
import { _ as l, a as u, c as d, d as f, f as p, g as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, y as D } from "./cloud-B4O_G-Df.js";
|
|
6
|
-
import { c as O, d as
|
|
7
|
-
import { a as
|
|
8
|
-
import { MargoError as
|
|
6
|
+
import { _ as ee, c as O, d as k, f as A, g as te, h as ne, i as j, l as re, n as ie, o as M, p as N, r as P, t as F, u as I } from "./shaders-DCnbvb0-.js";
|
|
7
|
+
import { a as L, c as R, d as z, i as B, l as V, n as H, o as U, r as W, s as G, t as K, u as q } from "./attributes-DNc-1pdr.js";
|
|
8
|
+
import { MargoError as ae } from "@margoengine/math/errors";
|
|
9
9
|
import { meshWorldMatrix as J } from "@margoengine/math/mesh";
|
|
10
|
-
import { multiplyMatrices as
|
|
10
|
+
import { multiplyMatrices as oe } from "@margoengine/math/mat4";
|
|
11
11
|
//#region src/sprites.ts
|
|
12
|
-
var
|
|
12
|
+
var se = 16, Y = class {
|
|
13
13
|
constructor(e = {}) {
|
|
14
14
|
this.visible = !0, this.matrix = new Float32Array([
|
|
15
15
|
1,
|
|
@@ -76,7 +76,7 @@ var ae = 16, X = class {
|
|
|
76
76
|
this.dispose();
|
|
77
77
|
}
|
|
78
78
|
bind(e) {
|
|
79
|
-
if (e && this.owner && this.owner !== e) throw new
|
|
79
|
+
if (e && this.owner && this.owner !== e) throw new ae("attached", "The batch already belongs to another plugin; remove it from that plugin first");
|
|
80
80
|
this.owner = e;
|
|
81
81
|
}
|
|
82
82
|
check(e) {
|
|
@@ -115,14 +115,14 @@ var ae = 16, X = class {
|
|
|
115
115
|
};
|
|
116
116
|
//#endregion
|
|
117
117
|
//#region ../shared/borrowed.js
|
|
118
|
-
function
|
|
118
|
+
function ce(e, t, n) {
|
|
119
119
|
return e.value = t, e.device = typeof t == "function" ? void 0 : n, e.made = void 0, e.told = !1, e;
|
|
120
120
|
}
|
|
121
|
-
var
|
|
121
|
+
var le = (e, t, n, r) => ce({
|
|
122
122
|
name: t,
|
|
123
123
|
setter: n
|
|
124
124
|
}, e, r);
|
|
125
|
-
function
|
|
125
|
+
function ue(e, t, n) {
|
|
126
126
|
let { value: i } = e;
|
|
127
127
|
if (typeof i == "function") return e.device !== t && (e.made = i(e.device = t)), e.made;
|
|
128
128
|
if (i != null) {
|
|
@@ -132,7 +132,7 @@ function ce(e, t, n) {
|
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region ../shared/mipmaps.js
|
|
135
|
-
var
|
|
135
|
+
var de = (e) => `
|
|
136
136
|
@vertex fn vertex(@builtin(vertex_index) i:u32)->@builtin(position) vec4f {
|
|
137
137
|
return vec4f(array<vec2f,3>(vec2f(-1,-1),vec2f(3,-1),vec2f(-1,3))[i],0,1);
|
|
138
138
|
}
|
|
@@ -153,11 +153,11 @@ var le = (e) => `
|
|
|
153
153
|
${e ? "return vec4f(select(sum.rgb/area,sc/sum.a,sum.a>0.0),sum.a/area);" : "return sum/area;"}
|
|
154
154
|
}
|
|
155
155
|
`;
|
|
156
|
-
function
|
|
156
|
+
function fe(e, t, n, r, i = 1, a = "plain") {
|
|
157
157
|
if (n < 2) return;
|
|
158
158
|
let o = t.format, s = a === "weighted", c = s ? o + ":weighted" : o, l = r.get(c);
|
|
159
159
|
if (!l) {
|
|
160
|
-
let t = e.createShaderModule({ code:
|
|
160
|
+
let t = e.createShaderModule({ code: de(s) });
|
|
161
161
|
r.set(c, l = e.createRenderPipeline({
|
|
162
162
|
layout: "auto",
|
|
163
163
|
vertex: {
|
|
@@ -206,24 +206,24 @@ function ue(e, t, n, r, i = 1, a = "plain") {
|
|
|
206
206
|
}
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region ../shared/copy-external.js
|
|
209
|
-
var
|
|
210
|
-
function
|
|
209
|
+
var X = /* @__PURE__ */ new WeakSet(), Z = /* @__PURE__ */ new WeakMap();
|
|
210
|
+
function pe(e) {
|
|
211
211
|
return !!e && typeof e == "object" && ("videoWidth" in e || "displayWidth" in e);
|
|
212
212
|
}
|
|
213
|
-
var
|
|
214
|
-
function
|
|
215
|
-
let i = e.queue, a = t.source, o =
|
|
216
|
-
if (o && !
|
|
213
|
+
var me = (e) => [e.videoWidth ?? e.displayWidth ?? e.naturalWidth ?? e.width ?? 0, e.videoHeight ?? e.displayHeight ?? e.naturalHeight ?? e.height ?? 0];
|
|
214
|
+
function he(e, t, n, r) {
|
|
215
|
+
let i = e.queue, a = t.source, o = pe(a);
|
|
216
|
+
if (o && !X.has(i)) try {
|
|
217
217
|
return i.copyExternalImageToTexture(t, n, r);
|
|
218
218
|
} catch (e) {
|
|
219
219
|
if (!(e instanceof TypeError)) throw e;
|
|
220
|
-
|
|
220
|
+
X.add(i);
|
|
221
221
|
}
|
|
222
222
|
if (!o) return i.copyExternalImageToTexture(t, n, r);
|
|
223
|
-
let [s, c] =
|
|
223
|
+
let [s, c] = me(a), l = Z.get(a);
|
|
224
224
|
if (!l || l.w !== s || l.h !== c) {
|
|
225
225
|
let e = typeof OffscreenCanvas == "function" ? new OffscreenCanvas(s, c) : document.createElement("canvas");
|
|
226
|
-
e.width = s, e.height = c,
|
|
226
|
+
e.width = s, e.height = c, Z.set(a, l = {
|
|
227
227
|
canvas: e,
|
|
228
228
|
w: s,
|
|
229
229
|
h: c
|
|
@@ -236,7 +236,7 @@ function pe(e, t, n, r) {
|
|
|
236
236
|
}
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region ../shared/projection.js
|
|
239
|
-
function
|
|
239
|
+
function ge(e, t) {
|
|
240
240
|
if (!e || e[3] || e[7] || e[11]) return null;
|
|
241
241
|
let n = (n) => e[n] * t[0] + e[4 + n] * t[1] + e[8 + n] * t[2] + e[12 + n], r = Math.hypot(e[2], e[6], e[10]), i = n(2);
|
|
242
242
|
return {
|
|
@@ -251,7 +251,7 @@ function me(e, t) {
|
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/plugin.ts
|
|
254
|
-
function
|
|
254
|
+
function Q(e, t, n, r) {
|
|
255
255
|
if (!(t < 2)) {
|
|
256
256
|
for (let r = 0; r < t; r++) n[r] = e[r];
|
|
257
257
|
n.length = t, n.sort(r);
|
|
@@ -259,7 +259,7 @@ function $(e, t, n, r) {
|
|
|
259
259
|
n.length = 0;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
var
|
|
262
|
+
var $ = (e) => typeof e == "function" || typeof e.createView == "function", _e = class r {coreRequirement=__margoCoreRequirement("1.0.0",import.meta.url);
|
|
263
263
|
memoryFor(e) {
|
|
264
264
|
let t = this.cloudGpu.get(e);
|
|
265
265
|
return t ? {
|
|
@@ -283,7 +283,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
283
283
|
gpu: []
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("
|
|
286
|
+
static attach(e, t) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
|
|
287
287
|
let n = new r(t);
|
|
288
288
|
return e.use(n), n;
|
|
289
289
|
}
|
|
@@ -309,7 +309,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
309
309
|
canvas: !0,
|
|
310
310
|
orthographic: !1,
|
|
311
311
|
drawn: /* @__PURE__ */ new WeakMap()
|
|
312
|
-
})), this.box = /* @__PURE__ */ new Float64Array(6), this.pickMvp = /* @__PURE__ */ new Float64Array(16), this.pickRanges = [], this.pickWindow = [], this.entryBlock = [], this.entryCount = [], this.entryWeight = [], this.entryDistance = [], this.blockAllotment = /* @__PURE__ */ new Uint32Array(), this.blockOrder = [], this.cloudDraws = [], this.cloudDrawScratch = [], this.spriteDraws = [], this.cloudCount = 0, this.cloudEnd = 0, this.spriteCount = 0, this.spriteEnd = 0, this.transparency =
|
|
312
|
+
})), this.box = /* @__PURE__ */ new Float64Array(6), this.pickMvp = /* @__PURE__ */ new Float64Array(16), this.pickRanges = [], this.pickWindow = [], this.entryBlock = [], this.entryCount = [], this.entryWeight = [], this.entryDistance = [], this.blockAllotment = /* @__PURE__ */ new Uint32Array(), this.blockOrder = [], this.cloudDraws = [], this.cloudDrawScratch = [], this.spriteDraws = [], this.cloudCount = 0, this.cloudEnd = 0, this.spriteCount = 0, this.spriteEnd = 0, this.transparency = A(), this.hookLayouts = /* @__PURE__ */ new Map(), this.spriteDrawScratch = [], this.pointColor = {
|
|
313
313
|
view: void 0,
|
|
314
314
|
loadOp: "load",
|
|
315
315
|
storeOp: "store"
|
|
@@ -332,11 +332,11 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
332
332
|
if (this.cloudCount = this.cloudEnd = this.spriteCount = this.spriteEnd = 0, t.clouds = t.blocks = t.blocksVisible = t.pointsVisible = t.pointsDrawn = t.sprites = t.drawCalls = t.uploads = t.uploadBytes = 0, e.backend !== "webgpu" || !this.device || !this.gpu || !this.engine || e.device !== this.device || !this.clouds.size && !this.batches.size) return;
|
|
333
333
|
let n = this.engine, r = this.device, i = this.gpu, a = e.camera;
|
|
334
334
|
this.writeFrame(e);
|
|
335
|
-
let o = this.pixelScale?.(e) ??
|
|
335
|
+
let o = this.pixelScale?.(e) ?? te(n.canvas, e.width), s = this.frameData[18], c = this.frameData[16], l = this.frameData[17];
|
|
336
336
|
if (this.fogUsed = !1, this.fogSource) {
|
|
337
337
|
for (let e of this.clouds) this.fogUsed ||= e.visible && e.material.fog;
|
|
338
338
|
for (let e of this.batches) this.fogUsed ||= e.visible && e.material.fog;
|
|
339
|
-
this.fogUsed && (
|
|
339
|
+
this.fogUsed && (ne(this.fogSource, a.position, this.fogData), r.queue.writeBuffer(this.fogResources().buffer, 0, this.fogData));
|
|
340
340
|
}
|
|
341
341
|
let u = this.entryBlock, f = this.entryCount, p = this.entryWeight, m = this.entryDistance;
|
|
342
342
|
u.length = 0, f.length = 0, p.length = 0, m.length = 0;
|
|
@@ -389,32 +389,32 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
389
389
|
let y = 0;
|
|
390
390
|
for (let e of this.batches) {
|
|
391
391
|
if (!e.visible || !e.count) continue;
|
|
392
|
-
let a = e.attachedMesh,
|
|
393
|
-
if (!
|
|
394
|
-
let
|
|
395
|
-
|
|
396
|
-
let
|
|
392
|
+
let a = e.attachedMesh, s = a ? J(n, a) : e.matrix;
|
|
393
|
+
if (!s) continue;
|
|
394
|
+
let c = e.material;
|
|
395
|
+
c.validate();
|
|
396
|
+
let l = this.ensureBatch(e);
|
|
397
397
|
if (e.dirty.length) {
|
|
398
398
|
for (let [n, i] of x(e.dirty)) {
|
|
399
399
|
let a = Math.min(i, e.count);
|
|
400
|
-
a <= n || (r.queue.writeBuffer(
|
|
400
|
+
a <= n || (r.queue.writeBuffer(l.instances, n * 16 * 4, e.data, n * 16, (a - n) * 16), t.uploads++, t.uploadBytes += (a - n) * 16 * 4);
|
|
401
401
|
}
|
|
402
402
|
e.dirty.length = 0;
|
|
403
403
|
}
|
|
404
|
-
let
|
|
405
|
-
|
|
406
|
-
let
|
|
407
|
-
|
|
408
|
-
let
|
|
409
|
-
for (let e = 0; e <
|
|
410
|
-
|
|
404
|
+
let u = this.texture(c) ?? i.whiteView, d = l.floats;
|
|
405
|
+
d.set(s, 0), d.set(c.color, 16), d[19] = c.opacity, d[20] = c.rotation, d[21] = c.alphaTest, d[22] = c.sizeUnits === "pixels" ? o : 0;
|
|
406
|
+
let f = c.clipping;
|
|
407
|
+
d[23] = f.length / 4 * (c.clipIntersection ? -1 : 1), d.set(f, 24), d.fill(0, 24 + f.length);
|
|
408
|
+
let p = !1;
|
|
409
|
+
for (let e = 0; e < d.length; e++) if (!Object.is(l.written[e], d[e])) {
|
|
410
|
+
p = !0;
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
413
|
-
|
|
414
|
-
let
|
|
415
|
-
|
|
413
|
+
p && (r.queue.writeBuffer(l.uniform, 0, d), l.written.set(d));
|
|
414
|
+
let m = this.spriteDraws[y], h = this.batchGroup(l, u, c.mapFilter === "nearest" ? i.nearest : i.linear);
|
|
415
|
+
m ? (m.batch = e, m.group = h) : this.spriteDraws[y] = m = {
|
|
416
416
|
batch: e,
|
|
417
|
-
group:
|
|
417
|
+
group: h
|
|
418
418
|
}, y++;
|
|
419
419
|
}
|
|
420
420
|
let S = 0;
|
|
@@ -434,7 +434,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
434
434
|
let t = l[n];
|
|
435
435
|
t.r.transparent = t.cloud.material.transparent, t.r.pipeline = this.pointPipeline(e, t.cloud.material, p && !m);
|
|
436
436
|
}
|
|
437
|
-
if (
|
|
437
|
+
if (Q(l, t, this.cloudDrawScratch, (e, t) => +e.r.transparent - t.r.transparent), t) {
|
|
438
438
|
let n = e.descriptor.depthStencil.format, a = this.pointColors;
|
|
439
439
|
if (this.pointColor.view = e.color, p) {
|
|
440
440
|
let t = e.descriptor.multisample?.count ?? 1, n = this.edlTarget(e.width, e.height, t, this.edlPipelines(e.format, t)[0]);
|
|
@@ -479,7 +479,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
if (n) {
|
|
482
|
-
|
|
482
|
+
Q(this.spriteDraws, n, this.spriteDrawScratch, (e, t) => +e.batch.material.transparent - t.batch.material.transparent);
|
|
483
483
|
let t = this.sceneDepth;
|
|
484
484
|
t.view = e.depth, e.descriptor.depthStencil.format.includes("stencil") ? t.stencilReadOnly = !0 : delete t.stencilReadOnly, this.pointColor.view = e.color, this.pointColors.length = 1;
|
|
485
485
|
let a = e.encoder.beginRenderPass({
|
|
@@ -506,13 +506,13 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
506
506
|
return this.fogSource;
|
|
507
507
|
}
|
|
508
508
|
setFog(e) {
|
|
509
|
-
return this.fogSource =
|
|
509
|
+
return this.fogSource = N(e), this;
|
|
510
510
|
}
|
|
511
511
|
add(e) {
|
|
512
512
|
if (e instanceof w) {
|
|
513
513
|
e.bind(this), this.clouds.add(e);
|
|
514
514
|
for (let t of this.watchers) t.added(e);
|
|
515
|
-
} else if (e instanceof
|
|
515
|
+
} else if (e instanceof Y) e.bind(this), this.batches.add(e);
|
|
516
516
|
else throw TypeError("Expected a PointCloud or SpriteBatch");
|
|
517
517
|
return e;
|
|
518
518
|
}
|
|
@@ -520,7 +520,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
520
520
|
if (e instanceof w && this.clouds.delete(e)) {
|
|
521
521
|
this.releaseCloud(e), e.bind(void 0), this.releaseUnusedTexture(e.material);
|
|
522
522
|
for (let t of this.watchers) t.removed(e);
|
|
523
|
-
} else e instanceof
|
|
523
|
+
} else e instanceof Y && this.batches.delete(e) && (this.releaseBatch(e), e.bind(void 0), this.releaseUnusedTexture(e.material));
|
|
524
524
|
}
|
|
525
525
|
clear() {
|
|
526
526
|
for (let e of [...this.clouds, ...this.batches]) this.remove(e);
|
|
@@ -613,8 +613,8 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
613
613
|
255
|
|
614
614
|
]), { bytesPerRow: 4 }, [1, 1]), this.gpu = {
|
|
615
615
|
pointModule: t.createShaderModule({ code: O }),
|
|
616
|
-
spriteModule: t.createShaderModule({ code:
|
|
617
|
-
edlModule: t.createShaderModule({ code:
|
|
616
|
+
spriteModule: t.createShaderModule({ code: re }),
|
|
617
|
+
edlModule: t.createShaderModule({ code: P }),
|
|
618
618
|
frameLayout: s,
|
|
619
619
|
cloudLayout: c,
|
|
620
620
|
spriteLayout: l,
|
|
@@ -687,7 +687,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
687
687
|
for (let e of this.clouds) {
|
|
688
688
|
let t = this.cloudGpu.get(e), n = u.drawn.get(e);
|
|
689
689
|
if (!t || !n?.length) continue;
|
|
690
|
-
|
|
690
|
+
oe(d, t.model, S);
|
|
691
691
|
let r = 0;
|
|
692
692
|
for (let i = 0; i < n.length; i += 2) {
|
|
693
693
|
let a = n[i];
|
|
@@ -722,10 +722,10 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
722
722
|
texture(e) {
|
|
723
723
|
let t = e.map, n = this.device;
|
|
724
724
|
if (!t) return this.gpu.whiteView;
|
|
725
|
-
if (
|
|
725
|
+
if ($(t)) {
|
|
726
726
|
let e = this.borrowed.get(t);
|
|
727
|
-
e || this.borrowed.set(t, e =
|
|
728
|
-
let r =
|
|
727
|
+
e || this.borrowed.set(t, e = le(t, "Points material map", "the map setter"));
|
|
728
|
+
let r = ue(e, n, this.engine);
|
|
729
729
|
if (!r) return null;
|
|
730
730
|
let i = this.borrowedViews.get(r);
|
|
731
731
|
return i || this.borrowedViews.set(r, i = r.createView()), i;
|
|
@@ -742,7 +742,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
742
742
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT
|
|
743
743
|
});
|
|
744
744
|
try {
|
|
745
|
-
typeof ImageData < "u" && t instanceof ImageData ? n.queue.writeTexture({ texture: c }, t.data, { bytesPerRow: a * 4 }, [a, o]) :
|
|
745
|
+
typeof ImageData < "u" && t instanceof ImageData ? n.queue.writeTexture({ texture: c }, t.data, { bytesPerRow: a * 4 }, [a, o]) : he(n, { source: t }, { texture: c }, [a, o]), fe(n, c, s, this.mipCache), r = {
|
|
746
746
|
source: t,
|
|
747
747
|
version: e.mapVersion,
|
|
748
748
|
mipmaps: e.mipmaps,
|
|
@@ -890,7 +890,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
890
890
|
dstFactor: "one",
|
|
891
891
|
operation: "add"
|
|
892
892
|
}
|
|
893
|
-
} :
|
|
893
|
+
} : k;
|
|
894
894
|
}
|
|
895
895
|
fogged(e) {
|
|
896
896
|
return this.fogSource !== null && e.fog;
|
|
@@ -933,12 +933,12 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
933
933
|
}
|
|
934
934
|
fogModule(e, t) {
|
|
935
935
|
let n = this.fogResources().modules, r = e + t.blending, i = n.get(r);
|
|
936
|
-
return i || (i = this.device.createShaderModule({ code:
|
|
936
|
+
return i || (i = this.device.createShaderModule({ code: j(e, t.blending === "additive") }), n.set(r, i)), i;
|
|
937
937
|
}
|
|
938
938
|
pointPipeline(e, t, n) {
|
|
939
939
|
let r = e.descriptor.depthStencil.format, i = t.shading === "sphere", a = this.fogged(t), o = `p|${e.descriptor.multisample?.count}|${e.format}|${r}|${n}|${i}|${t.writesDepth}|${t.depthTest}|${t.blending}${a ? "|fog" : ""}`, s = this.pipelines.get(o);
|
|
940
940
|
if (!s) {
|
|
941
|
-
let c = this.gpu, l = n && this.packedEdl(), u = n === "alone" || l ? this.device.createShaderModule({ code:
|
|
941
|
+
let c = this.gpu, l = n && this.packedEdl(), u = n === "alone" || l ? this.device.createShaderModule({ code: M(a ? j("point", t.blending === "additive") : O) }) : a ? this.fogModule("point", t) : c.pointModule, d = [n === "alone" ? null : {
|
|
942
942
|
format: e.format,
|
|
943
943
|
blend: this.blend(t.blending)
|
|
944
944
|
}];
|
|
@@ -1010,7 +1010,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
1010
1010
|
surfacePipeline(e, t, n, r) {
|
|
1011
1011
|
let i = n.blending === "additive", a = this.fogged(n), o = r.surface(3), s = e.descriptor.depthStencil.format, c = `t|${t}|${e.descriptor.multisample?.count}|${s}|${i}|${a}|${o}`, l = this.pipelines.get(c);
|
|
1012
1012
|
if (!l) {
|
|
1013
|
-
let n = this.device, u = this.gpu, d = n.createShaderModule({ code:
|
|
1013
|
+
let n = this.device, u = this.gpu, d = n.createShaderModule({ code: I(t, o, a ? i : void 0) });
|
|
1014
1014
|
l = n.createRenderPipeline({
|
|
1015
1015
|
layout: n.createPipelineLayout({ bindGroupLayouts: [
|
|
1016
1016
|
u.frameLayout,
|
|
@@ -1089,7 +1089,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
1089
1089
|
edlPipeline(e, t, n) {
|
|
1090
1090
|
let r = `e|${e}|${t}|${n}`, i = this.pipelines.get(r);
|
|
1091
1091
|
if (!i) {
|
|
1092
|
-
let a = this.gpu, o = n !== null || this.packedEdl(), s =
|
|
1092
|
+
let a = this.gpu, o = n !== null || this.packedEdl(), s = P.replace("texture_2d<f32>", "texture_multisampled_2d<f32>"), c = t === 1 ? P : n === null ? s.replace("position:vec4f)", "position:vec4f,@builtin(sample_index) sample:u32)") : s, l = n === null ? t === 1 ? "0" : "i32(sample)" : String(n), u = !o && t === 1 ? a.edlModule : this.device.createShaderModule({ code: o ? c.replace(/textureLoad\(depths,([pq]),0\)\.r/g, `unpackDepth(textureLoad(depths,$1,${l}))`) + ie : c.replace(/textureLoad\(depths,([pq]),0\)/g, `textureLoad(depths,$1,${l})`) });
|
|
1093
1093
|
i = this.device.createRenderPipeline({
|
|
1094
1094
|
layout: t === 1 ? a.edlPipelineLayout : this.edlSampledLayout(),
|
|
1095
1095
|
vertex: {
|
|
@@ -1153,7 +1153,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
1153
1153
|
}
|
|
1154
1154
|
writeFrame(e) {
|
|
1155
1155
|
let n = this.frameData, r = e.camera.matrix, [i, a] = t(e);
|
|
1156
|
-
this.orthographic =
|
|
1156
|
+
this.orthographic = ee(n, this.view, e.camera, i, a, e.format), n[27] = this.transparency.hook ? ge(e.camera.matrix, e.camera.position)?.near ?? 0 : 0;
|
|
1157
1157
|
let s = !this.frameValid;
|
|
1158
1158
|
for (let e = 0; !s && e < this.frameBits.length; e++) s = this.frameBits[e] !== this.frameWritten[e];
|
|
1159
1159
|
s && (this.device.queue.writeBuffer(this.gpu.frame, 0, n), this.frameWritten.set(this.frameBits), this.frameValid = !0);
|
|
@@ -1167,7 +1167,7 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
1167
1167
|
}
|
|
1168
1168
|
writeCloudUniform(e, t, n, r, i = 1, a = 1) {
|
|
1169
1169
|
let o = e.material, s = t.floats, c = t.uints;
|
|
1170
|
-
s.set(n, 0), s.set(o.color, 16), s[19] = o.opacity, s[20] = (o.sizeUnits === "pixels" ? o.size * i : o.size) * a, s[21] = o.minPixelSize * i * a, s[22] = o.maxPixelSize * i * a, s[23] = o.alphaTest, c[24] = (e.colors && o.vertexColors ?
|
|
1170
|
+
s.set(n, 0), s.set(o.color, 16), s[19] = o.opacity, s[20] = (o.sizeUnits === "pixels" ? o.size * i : o.size) * a, s[21] = o.minPixelSize * i * a, s[22] = o.maxPixelSize * i * a, s[23] = o.alphaTest, c[24] = (e.colors && o.vertexColors ? F.colors : 0) | (e.sizes ? F.sizes : 0) | (o.sizeUnits === "world" ? F.world : 0) | (o.shape === "round" ? F.round : 0) | (r ? F.map : 0) | (o.shading === "sphere" ? F.sphere : 0) | (e.direct ? F.direct : 0) | (e.colorSpace === "srgb" ? F.srgbColors : 0) | (e.colorFormat === "float" ? F.floatColors : 0) | (e.mask ? F.mask : 0);
|
|
1171
1171
|
let l = o.clipping;
|
|
1172
1172
|
c[25] = l.length / 4 + (o.clipIntersection ? 65536 : 0), s[26] = o.ditherFade?.[0] ?? 0, s[27] = o.ditherFade?.[1] ?? 1, s.set(l, 32), s.fill(0, 32 + l.length);
|
|
1173
1173
|
let u = !1;
|
|
@@ -1243,4 +1243,4 @@ var he = (e) => typeof e == "function" || typeof e.createView == "function", ge
|
|
|
1243
1243
|
}
|
|
1244
1244
|
};
|
|
1245
1245
|
//#endregion
|
|
1246
|
-
export {
|
|
1246
|
+
export { K as ASPRS_CLASSES, H as CLASSIFICATION_COLORS, W as ELEVATION_STOPS, u as NO_BLOCK, w as PointCloud, y as PointsMaterial, _e as PointsPlugin, se as SPRITE_STRIDE, Y as SpriteBatch, S as SpriteMaterial, b as allocateBudget, C as atlasRect, d as boxInFrustum, _ as boxScreenRect, T as buildBlocks, B as classificationColors, f as cullBlocks, p as expandBlockBounds, L as measureAngle, U as measureArea, G as measureHeight, R as measurePath, V as measurePointDistance, x as mergeRanges, v as packColors, g as parseColor, h as pickPoint, m as projectToPixels, q as rampColors, l as random, z as rgb16ToRgba8, E as screenArea, D as worldBox };
|