@vitessce/gl 3.6.7 → 3.6.8
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/{deflate-Cig7rac7.js → deflate-B4KLsA1z.js} +1 -1
- package/dist/{index-CNNVumvy.js → index-BvCO07xL.js} +470 -168
- package/dist/index.js +2 -2
- package/dist/{jpeg-CwP7rsVP.js → jpeg-DcD9Rdd5.js} +1 -1
- package/dist/{lerc-GH_cegK4.js → lerc-ssyon6X7.js} +1 -1
- package/dist/{lzw-Czt4iK0_.js → lzw-BaMqhIgE.js} +1 -1
- package/dist/{packbits-BSFtv6qa.js → packbits-CRM43Fiw.js} +1 -1
- package/dist/{raw-BaUnStbF.js → raw-BKuuUvuj.js} +1 -1
- package/dist/{webimage-CTqHbTQE.js → webimage-CiKLGrMh.js} +1 -1
- package/dist-tsc/deck.js +1 -0
- package/package.json +3 -3
- package/src/deck.js +1 -0
|
@@ -497,10 +497,10 @@ function validateWorkerVersion(worker, coreVersion = VERSION$b) {
|
|
|
497
497
|
}
|
|
498
498
|
return true;
|
|
499
499
|
}
|
|
500
|
-
const fs$
|
|
500
|
+
const fs$r = {};
|
|
501
501
|
const __viteBrowserExternal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
502
502
|
__proto__: null,
|
|
503
|
-
default: fs$
|
|
503
|
+
default: fs$r
|
|
504
504
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
505
505
|
const VERSION$a = "3.2.10";
|
|
506
506
|
const loadLibraryPromises = {};
|
|
@@ -4086,14 +4086,14 @@ function setParameters(gl, values2) {
|
|
|
4086
4086
|
}
|
|
4087
4087
|
}
|
|
4088
4088
|
}
|
|
4089
|
-
function getParameters(gl,
|
|
4090
|
-
|
|
4091
|
-
if (typeof
|
|
4092
|
-
const key =
|
|
4089
|
+
function getParameters(gl, parameters2) {
|
|
4090
|
+
parameters2 = parameters2 || GL_PARAMETER_DEFAULTS;
|
|
4091
|
+
if (typeof parameters2 === "number") {
|
|
4092
|
+
const key = parameters2;
|
|
4093
4093
|
const getter = GL_PARAMETER_GETTERS[key];
|
|
4094
4094
|
return getter ? getter(gl, key) : gl.getParameter(key);
|
|
4095
4095
|
}
|
|
4096
|
-
const parameterKeys = Array.isArray(
|
|
4096
|
+
const parameterKeys = Array.isArray(parameters2) ? parameters2 : Object.keys(parameters2);
|
|
4097
4097
|
const state = {};
|
|
4098
4098
|
for (const key of parameterKeys) {
|
|
4099
4099
|
const getter = GL_PARAMETER_GETTERS[key];
|
|
@@ -4104,15 +4104,15 @@ function getParameters(gl, parameters) {
|
|
|
4104
4104
|
function resetParameters(gl) {
|
|
4105
4105
|
setParameters(gl, GL_PARAMETER_DEFAULTS);
|
|
4106
4106
|
}
|
|
4107
|
-
function withParameters(gl,
|
|
4108
|
-
if (isObjectEmpty$2(
|
|
4107
|
+
function withParameters(gl, parameters2, func) {
|
|
4108
|
+
if (isObjectEmpty$2(parameters2)) {
|
|
4109
4109
|
return func(gl);
|
|
4110
4110
|
}
|
|
4111
4111
|
const {
|
|
4112
4112
|
nocatch = true
|
|
4113
|
-
} =
|
|
4113
|
+
} = parameters2;
|
|
4114
4114
|
pushContextState(gl);
|
|
4115
|
-
setParameters(gl,
|
|
4115
|
+
setParameters(gl, parameters2);
|
|
4116
4116
|
let value;
|
|
4117
4117
|
if (nocatch) {
|
|
4118
4118
|
value = func(gl);
|
|
@@ -4556,8 +4556,8 @@ let Resource$1 = class Resource {
|
|
|
4556
4556
|
let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4557
4557
|
pname = getKeyValue(this.gl, pname);
|
|
4558
4558
|
assert$9(pname);
|
|
4559
|
-
const
|
|
4560
|
-
const parameter =
|
|
4559
|
+
const parameters2 = this.constructor.PARAMETERS || {};
|
|
4560
|
+
const parameter = parameters2[pname];
|
|
4561
4561
|
if (parameter) {
|
|
4562
4562
|
const isWebgl2 = isWebGL2$1(this.gl);
|
|
4563
4563
|
const parameterAvailable = (!("webgl2" in parameter) || isWebgl2) && (!("extension" in parameter) || this.gl.getExtension(parameter.extension));
|
|
@@ -4573,13 +4573,13 @@ let Resource$1 = class Resource {
|
|
|
4573
4573
|
getParameters() {
|
|
4574
4574
|
let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4575
4575
|
const {
|
|
4576
|
-
parameters,
|
|
4576
|
+
parameters: parameters2,
|
|
4577
4577
|
keys
|
|
4578
4578
|
} = options;
|
|
4579
4579
|
const PARAMETERS = this.constructor.PARAMETERS || {};
|
|
4580
4580
|
const isWebgl2 = isWebGL2$1(this.gl);
|
|
4581
4581
|
const values2 = {};
|
|
4582
|
-
const parameterKeys =
|
|
4582
|
+
const parameterKeys = parameters2 || Object.keys(PARAMETERS);
|
|
4583
4583
|
for (const pname of parameterKeys) {
|
|
4584
4584
|
const parameter = PARAMETERS[pname];
|
|
4585
4585
|
const parameterAvailable = parameter && (!("webgl2" in parameter) || isWebgl2) && (!("extension" in parameter) || this.gl.getExtension(parameter.extension));
|
|
@@ -4596,8 +4596,8 @@ let Resource$1 = class Resource {
|
|
|
4596
4596
|
setParameter(pname, value) {
|
|
4597
4597
|
pname = getKeyValue(this.gl, pname);
|
|
4598
4598
|
assert$9(pname);
|
|
4599
|
-
const
|
|
4600
|
-
const parameter =
|
|
4599
|
+
const parameters2 = this.constructor.PARAMETERS || {};
|
|
4600
|
+
const parameter = parameters2[pname];
|
|
4601
4601
|
if (parameter) {
|
|
4602
4602
|
const isWebgl2 = isWebGL2$1(this.gl);
|
|
4603
4603
|
const parameterAvailable = (!("webgl2" in parameter) || isWebgl2) && (!("extension" in parameter) || this.gl.getExtension(parameter.extension));
|
|
@@ -4611,9 +4611,9 @@ let Resource$1 = class Resource {
|
|
|
4611
4611
|
this._setParameter(pname, value);
|
|
4612
4612
|
return this;
|
|
4613
4613
|
}
|
|
4614
|
-
setParameters(
|
|
4615
|
-
for (const pname in
|
|
4616
|
-
this.setParameter(pname,
|
|
4614
|
+
setParameters(parameters2) {
|
|
4615
|
+
for (const pname in parameters2) {
|
|
4616
|
+
this.setParameter(pname, parameters2[pname]);
|
|
4617
4617
|
}
|
|
4618
4618
|
return this;
|
|
4619
4619
|
}
|
|
@@ -5354,7 +5354,7 @@ class Texture extends Resource$1 {
|
|
|
5354
5354
|
format = 6408,
|
|
5355
5355
|
border = 0,
|
|
5356
5356
|
recreate = false,
|
|
5357
|
-
parameters = {},
|
|
5357
|
+
parameters: parameters2 = {},
|
|
5358
5358
|
pixelStore = {},
|
|
5359
5359
|
textureUnit = void 0
|
|
5360
5360
|
} = props;
|
|
@@ -5402,7 +5402,7 @@ class Texture extends Resource$1 {
|
|
|
5402
5402
|
if (mipmaps && this._isNPOT()) {
|
|
5403
5403
|
log$3.warn("texture: ".concat(this, " is Non-Power-Of-Two, disabling mipmaping"))();
|
|
5404
5404
|
mipmaps = false;
|
|
5405
|
-
this._updateForNPOT(
|
|
5405
|
+
this._updateForNPOT(parameters2);
|
|
5406
5406
|
}
|
|
5407
5407
|
this.mipmaps = mipmaps;
|
|
5408
5408
|
this.setImageData({
|
|
@@ -5421,14 +5421,14 @@ class Texture extends Resource$1 {
|
|
|
5421
5421
|
if (mipmaps) {
|
|
5422
5422
|
this.generateMipmap();
|
|
5423
5423
|
}
|
|
5424
|
-
this.setParameters(
|
|
5424
|
+
this.setParameters(parameters2);
|
|
5425
5425
|
if (recreate) {
|
|
5426
5426
|
this.data = data;
|
|
5427
5427
|
}
|
|
5428
5428
|
if (isVideo) {
|
|
5429
5429
|
this._video = {
|
|
5430
5430
|
video: data,
|
|
5431
|
-
parameters,
|
|
5431
|
+
parameters: parameters2,
|
|
5432
5432
|
lastTime: data.readyState >= HTMLVideoElement.HAVE_CURRENT_DATA ? data.currentTime : -1
|
|
5433
5433
|
};
|
|
5434
5434
|
}
|
|
@@ -5438,7 +5438,7 @@ class Texture extends Resource$1 {
|
|
|
5438
5438
|
if (this._video) {
|
|
5439
5439
|
const {
|
|
5440
5440
|
video,
|
|
5441
|
-
parameters,
|
|
5441
|
+
parameters: parameters2,
|
|
5442
5442
|
lastTime
|
|
5443
5443
|
} = this._video;
|
|
5444
5444
|
if (lastTime === video.currentTime || video.readyState < HTMLVideoElement.HAVE_CURRENT_DATA) {
|
|
@@ -5446,7 +5446,7 @@ class Texture extends Resource$1 {
|
|
|
5446
5446
|
}
|
|
5447
5447
|
this.setSubImageData({
|
|
5448
5448
|
data: video,
|
|
5449
|
-
parameters
|
|
5449
|
+
parameters: parameters2
|
|
5450
5450
|
});
|
|
5451
5451
|
if (this.mipmaps) {
|
|
5452
5452
|
this.generateMipmap();
|
|
@@ -5496,7 +5496,7 @@ class Texture extends Resource$1 {
|
|
|
5496
5496
|
format = this.format,
|
|
5497
5497
|
border = this.border,
|
|
5498
5498
|
offset = 0,
|
|
5499
|
-
parameters = {}
|
|
5499
|
+
parameters: parameters2 = {}
|
|
5500
5500
|
} = options;
|
|
5501
5501
|
let {
|
|
5502
5502
|
data = null,
|
|
@@ -5538,7 +5538,7 @@ class Texture extends Resource$1 {
|
|
|
5538
5538
|
}));
|
|
5539
5539
|
let gl2;
|
|
5540
5540
|
let compressedTextureSize = 0;
|
|
5541
|
-
withParameters(this.gl,
|
|
5541
|
+
withParameters(this.gl, parameters2, () => {
|
|
5542
5542
|
switch (dataType) {
|
|
5543
5543
|
case "null":
|
|
5544
5544
|
gl.texImage2D(target, level, format, width, height, border, dataFormat, type, data);
|
|
@@ -5597,7 +5597,7 @@ class Texture extends Resource$1 {
|
|
|
5597
5597
|
compressed = false,
|
|
5598
5598
|
offset = 0,
|
|
5599
5599
|
border = this.border,
|
|
5600
|
-
parameters = {}
|
|
5600
|
+
parameters: parameters2 = {}
|
|
5601
5601
|
} = _ref2;
|
|
5602
5602
|
({
|
|
5603
5603
|
type,
|
|
@@ -5628,7 +5628,7 @@ class Texture extends Resource$1 {
|
|
|
5628
5628
|
data = data.handle;
|
|
5629
5629
|
}
|
|
5630
5630
|
this.gl.bindTexture(this.target, this.handle);
|
|
5631
|
-
withParameters(this.gl,
|
|
5631
|
+
withParameters(this.gl, parameters2, () => {
|
|
5632
5632
|
if (compressed) {
|
|
5633
5633
|
this.gl.compressedTexSubImage2D(target, level, x, y, width, height, format, data);
|
|
5634
5634
|
} else if (data === null) {
|
|
@@ -5841,15 +5841,15 @@ class Texture extends Resource$1 {
|
|
|
5841
5841
|
}
|
|
5842
5842
|
return !isPowerOfTwo(this.width) || !isPowerOfTwo(this.height);
|
|
5843
5843
|
}
|
|
5844
|
-
_updateForNPOT(
|
|
5845
|
-
if (
|
|
5846
|
-
|
|
5844
|
+
_updateForNPOT(parameters2) {
|
|
5845
|
+
if (parameters2[this.gl.TEXTURE_MIN_FILTER] === void 0) {
|
|
5846
|
+
parameters2[this.gl.TEXTURE_MIN_FILTER] = this.gl.LINEAR;
|
|
5847
5847
|
}
|
|
5848
|
-
if (
|
|
5849
|
-
|
|
5848
|
+
if (parameters2[this.gl.TEXTURE_WRAP_S] === void 0) {
|
|
5849
|
+
parameters2[this.gl.TEXTURE_WRAP_S] = this.gl.CLAMP_TO_EDGE;
|
|
5850
5850
|
}
|
|
5851
|
-
if (
|
|
5852
|
-
|
|
5851
|
+
if (parameters2[this.gl.TEXTURE_WRAP_T] === void 0) {
|
|
5852
|
+
parameters2[this.gl.TEXTURE_WRAP_T] = this.gl.CLAMP_TO_EDGE;
|
|
5853
5853
|
}
|
|
5854
5854
|
}
|
|
5855
5855
|
_getNPOTParam(pname, param) {
|
|
@@ -5932,7 +5932,7 @@ class TextureCube extends Texture {
|
|
|
5932
5932
|
let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
5933
5933
|
const {
|
|
5934
5934
|
mipmaps = true,
|
|
5935
|
-
parameters = {}
|
|
5935
|
+
parameters: parameters2 = {}
|
|
5936
5936
|
} = props;
|
|
5937
5937
|
this.opts = props;
|
|
5938
5938
|
this.setCubeMapImageData(props).then(() => {
|
|
@@ -5940,7 +5940,7 @@ class TextureCube extends Texture {
|
|
|
5940
5940
|
if (mipmaps) {
|
|
5941
5941
|
this.generateMipmap(props);
|
|
5942
5942
|
}
|
|
5943
|
-
this.setParameters(
|
|
5943
|
+
this.setParameters(parameters2);
|
|
5944
5944
|
});
|
|
5945
5945
|
return this;
|
|
5946
5946
|
}
|
|
@@ -6056,11 +6056,11 @@ class Texture3D extends Texture {
|
|
|
6056
6056
|
type = 5121,
|
|
6057
6057
|
offset = 0,
|
|
6058
6058
|
data,
|
|
6059
|
-
parameters = {}
|
|
6059
|
+
parameters: parameters2 = {}
|
|
6060
6060
|
} = _ref;
|
|
6061
6061
|
this._trackDeallocatedMemory("Texture");
|
|
6062
6062
|
this.gl.bindTexture(this.target, this.handle);
|
|
6063
|
-
withParameters(this.gl,
|
|
6063
|
+
withParameters(this.gl, parameters2, () => {
|
|
6064
6064
|
if (ArrayBuffer.isView(data)) {
|
|
6065
6065
|
this.gl.texImage3D(this.target, level, dataFormat, width, height, depth, border, format, type, data);
|
|
6066
6066
|
}
|
|
@@ -6350,31 +6350,31 @@ function clear(gl) {
|
|
|
6350
6350
|
depth = null,
|
|
6351
6351
|
stencil = null
|
|
6352
6352
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6353
|
-
const
|
|
6353
|
+
const parameters2 = {};
|
|
6354
6354
|
if (framebuffer) {
|
|
6355
|
-
|
|
6355
|
+
parameters2.framebuffer = framebuffer;
|
|
6356
6356
|
}
|
|
6357
6357
|
let clearFlags = 0;
|
|
6358
6358
|
if (color) {
|
|
6359
6359
|
clearFlags |= GL_COLOR_BUFFER_BIT;
|
|
6360
6360
|
if (color !== true) {
|
|
6361
|
-
|
|
6361
|
+
parameters2.clearColor = color;
|
|
6362
6362
|
}
|
|
6363
6363
|
}
|
|
6364
6364
|
if (depth) {
|
|
6365
6365
|
clearFlags |= GL_DEPTH_BUFFER_BIT;
|
|
6366
6366
|
if (depth !== true) {
|
|
6367
|
-
|
|
6367
|
+
parameters2.clearDepth = depth;
|
|
6368
6368
|
}
|
|
6369
6369
|
}
|
|
6370
6370
|
if (stencil) {
|
|
6371
6371
|
clearFlags |= GL_STENCIL_BUFFER_BIT;
|
|
6372
6372
|
if (depth !== true) {
|
|
6373
|
-
|
|
6373
|
+
parameters2.clearStencil = depth;
|
|
6374
6374
|
}
|
|
6375
6375
|
}
|
|
6376
6376
|
assert$9(clearFlags !== 0, ERR_ARGUMENTS);
|
|
6377
|
-
withParameters(gl,
|
|
6377
|
+
withParameters(gl, parameters2, () => {
|
|
6378
6378
|
gl.clear(clearFlags);
|
|
6379
6379
|
});
|
|
6380
6380
|
}
|
|
@@ -6470,7 +6470,7 @@ function readPixelsToArray(source) {
|
|
|
6470
6470
|
const {
|
|
6471
6471
|
framebuffer,
|
|
6472
6472
|
deleteFramebuffer
|
|
6473
|
-
} = getFramebuffer$
|
|
6473
|
+
} = getFramebuffer$3(source);
|
|
6474
6474
|
assert$9(framebuffer);
|
|
6475
6475
|
const {
|
|
6476
6476
|
gl,
|
|
@@ -6508,7 +6508,7 @@ function readPixelsToBuffer(source, _ref) {
|
|
|
6508
6508
|
const {
|
|
6509
6509
|
framebuffer,
|
|
6510
6510
|
deleteFramebuffer
|
|
6511
|
-
} = getFramebuffer$
|
|
6511
|
+
} = getFramebuffer$3(source);
|
|
6512
6512
|
assert$9(framebuffer);
|
|
6513
6513
|
sourceWidth = sourceWidth || framebuffer.width;
|
|
6514
6514
|
sourceHeight = sourceHeight || framebuffer.height;
|
|
@@ -6597,7 +6597,7 @@ function copyToTexture(source, target) {
|
|
|
6597
6597
|
const {
|
|
6598
6598
|
framebuffer,
|
|
6599
6599
|
deleteFramebuffer
|
|
6600
|
-
} = getFramebuffer$
|
|
6600
|
+
} = getFramebuffer$3(source);
|
|
6601
6601
|
assert$9(framebuffer);
|
|
6602
6602
|
const {
|
|
6603
6603
|
gl,
|
|
@@ -6641,7 +6641,7 @@ function copyToTexture(source, target) {
|
|
|
6641
6641
|
}
|
|
6642
6642
|
return texture;
|
|
6643
6643
|
}
|
|
6644
|
-
function getFramebuffer$
|
|
6644
|
+
function getFramebuffer$3(source) {
|
|
6645
6645
|
if (!(source instanceof Framebuffer)) {
|
|
6646
6646
|
return {
|
|
6647
6647
|
framebuffer: toFramebuffer(source),
|
|
@@ -7100,9 +7100,9 @@ class Framebuffer extends Resource$1 {
|
|
|
7100
7100
|
getAttachmentParameters() {
|
|
7101
7101
|
let attachment = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 36064;
|
|
7102
7102
|
let keys = arguments.length > 1 ? arguments[1] : void 0;
|
|
7103
|
-
let
|
|
7103
|
+
let parameters2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.constructor.ATTACHMENT_PARAMETERS || [];
|
|
7104
7104
|
const values2 = {};
|
|
7105
|
-
for (const pname of
|
|
7105
|
+
for (const pname of parameters2) {
|
|
7106
7106
|
const key = keys ? getKey(this.gl, pname) : pname;
|
|
7107
7107
|
values2[key] = this.getAttachmentParameter(attachment, pname, keys);
|
|
7108
7108
|
}
|
|
@@ -7111,13 +7111,13 @@ class Framebuffer extends Resource$1 {
|
|
|
7111
7111
|
getParameters() {
|
|
7112
7112
|
let keys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
7113
7113
|
const attachments = Object.keys(this.attachments);
|
|
7114
|
-
const
|
|
7114
|
+
const parameters2 = {};
|
|
7115
7115
|
for (const attachmentName of attachments) {
|
|
7116
7116
|
const attachment = Number(attachmentName);
|
|
7117
7117
|
const key = keys ? getKey(this.gl, attachment) : attachment;
|
|
7118
|
-
|
|
7118
|
+
parameters2[key] = this.getAttachmentParameters(attachment, keys);
|
|
7119
7119
|
}
|
|
7120
|
-
return
|
|
7120
|
+
return parameters2;
|
|
7121
7121
|
}
|
|
7122
7122
|
show() {
|
|
7123
7123
|
if (typeof window !== "undefined") {
|
|
@@ -8094,7 +8094,7 @@ class Program extends Resource$1 {
|
|
|
8094
8094
|
vertexArray = null,
|
|
8095
8095
|
transformFeedback,
|
|
8096
8096
|
framebuffer,
|
|
8097
|
-
parameters = {},
|
|
8097
|
+
parameters: parameters2 = {},
|
|
8098
8098
|
uniforms,
|
|
8099
8099
|
samplers
|
|
8100
8100
|
} = _ref;
|
|
@@ -8114,7 +8114,7 @@ class Program extends Resource$1 {
|
|
|
8114
8114
|
}
|
|
8115
8115
|
vertexArray.bindForDraw(vertexCount, instanceCount, () => {
|
|
8116
8116
|
if (framebuffer !== void 0) {
|
|
8117
|
-
|
|
8117
|
+
parameters2 = Object.assign({}, parameters2, {
|
|
8118
8118
|
framebuffer
|
|
8119
8119
|
});
|
|
8120
8120
|
}
|
|
@@ -8123,7 +8123,7 @@ class Program extends Resource$1 {
|
|
|
8123
8123
|
transformFeedback.begin(primitiveMode);
|
|
8124
8124
|
}
|
|
8125
8125
|
this._bindTextures();
|
|
8126
|
-
withParameters(this.gl,
|
|
8126
|
+
withParameters(this.gl, parameters2, () => {
|
|
8127
8127
|
if (isIndexed && isInstanced) {
|
|
8128
8128
|
this.gl2.drawElementsInstanced(drawMode, vertexCount, indexType, offset, instanceCount);
|
|
8129
8129
|
} else if (isIndexed && isWebGL2$1(this.gl) && !isNaN(start) && !isNaN(end)) {
|
|
@@ -10006,8 +10006,8 @@ function normalizeShaderModule(module2) {
|
|
|
10006
10006
|
if (!module2.normalized) {
|
|
10007
10007
|
module2.normalized = true;
|
|
10008
10008
|
if (module2.uniforms && !module2.getUniforms) {
|
|
10009
|
-
const
|
|
10010
|
-
module2.getUniforms =
|
|
10009
|
+
const shaderModule2 = new ShaderModule(module2);
|
|
10010
|
+
module2.getUniforms = shaderModule2.getUniforms.bind(shaderModule2);
|
|
10011
10011
|
}
|
|
10012
10012
|
}
|
|
10013
10013
|
return module2;
|
|
@@ -10647,14 +10647,14 @@ const fp64functionShader = "const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.2
|
|
|
10647
10647
|
const CONST_UNIFORMS = {
|
|
10648
10648
|
ONE: 1
|
|
10649
10649
|
};
|
|
10650
|
-
function getUniforms$
|
|
10650
|
+
function getUniforms$7() {
|
|
10651
10651
|
return CONST_UNIFORMS;
|
|
10652
10652
|
}
|
|
10653
10653
|
const fp64arithmetic = {
|
|
10654
10654
|
name: "fp64-arithmetic",
|
|
10655
10655
|
vs: fp64arithmeticShader,
|
|
10656
10656
|
fs: null,
|
|
10657
|
-
getUniforms: getUniforms$
|
|
10657
|
+
getUniforms: getUniforms$7,
|
|
10658
10658
|
fp64ify,
|
|
10659
10659
|
fp64LowPart: fp64LowPart$1,
|
|
10660
10660
|
fp64ifyMatrix4
|
|
@@ -14272,7 +14272,7 @@ const DEFAULT_MODULE_OPTIONS$2 = {
|
|
|
14272
14272
|
projectionMatrix: IDENTITY_MATRIX$1,
|
|
14273
14273
|
cameraPositionWorld: [0, 0, 0]
|
|
14274
14274
|
};
|
|
14275
|
-
function getUniforms$
|
|
14275
|
+
function getUniforms$6() {
|
|
14276
14276
|
let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_MODULE_OPTIONS$2;
|
|
14277
14277
|
const uniforms = {};
|
|
14278
14278
|
if (opts.modelMatrix !== void 0) {
|
|
@@ -14293,13 +14293,13 @@ function getUniforms$5() {
|
|
|
14293
14293
|
return uniforms;
|
|
14294
14294
|
}
|
|
14295
14295
|
const common$1 = "varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n";
|
|
14296
|
-
const vs$
|
|
14297
|
-
const fs$
|
|
14296
|
+
const vs$r = "".concat(common$1, "\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n");
|
|
14297
|
+
const fs$q = "\n".concat(common$1);
|
|
14298
14298
|
const project$1 = {
|
|
14299
14299
|
name: "project",
|
|
14300
|
-
getUniforms: getUniforms$
|
|
14301
|
-
vs: vs$
|
|
14302
|
-
fs: fs$
|
|
14300
|
+
getUniforms: getUniforms$6,
|
|
14301
|
+
vs: vs$r,
|
|
14302
|
+
fs: fs$q
|
|
14303
14303
|
};
|
|
14304
14304
|
const lightingShader$1 = "#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";
|
|
14305
14305
|
const INITIAL_MODULE_OPTIONS$2 = {
|
|
@@ -14337,7 +14337,7 @@ function getLightSourceUniforms(_ref) {
|
|
|
14337
14337
|
lightSourceUniforms.lighting_uDirectionalLightCount = directionalLights.length;
|
|
14338
14338
|
return lightSourceUniforms;
|
|
14339
14339
|
}
|
|
14340
|
-
function getUniforms$
|
|
14340
|
+
function getUniforms$5() {
|
|
14341
14341
|
let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : INITIAL_MODULE_OPTIONS$2;
|
|
14342
14342
|
if ("lightSources" in opts) {
|
|
14343
14343
|
const {
|
|
@@ -14377,7 +14377,7 @@ function getUniforms$4() {
|
|
|
14377
14377
|
break;
|
|
14378
14378
|
}
|
|
14379
14379
|
}
|
|
14380
|
-
return getUniforms$
|
|
14380
|
+
return getUniforms$5({
|
|
14381
14381
|
lightSources
|
|
14382
14382
|
});
|
|
14383
14383
|
}
|
|
@@ -14387,7 +14387,7 @@ const lights = {
|
|
|
14387
14387
|
name: "lights",
|
|
14388
14388
|
vs: lightingShader$1,
|
|
14389
14389
|
fs: lightingShader$1,
|
|
14390
|
-
getUniforms: getUniforms$
|
|
14390
|
+
getUniforms: getUniforms$5,
|
|
14391
14391
|
defines: {
|
|
14392
14392
|
MAX_LIGHTS: 3
|
|
14393
14393
|
}
|
|
@@ -14396,7 +14396,7 @@ const DEFAULT_LIGHT_DIRECTION$1 = new Float32Array([1, 1, 2]);
|
|
|
14396
14396
|
const DEFAULT_MODULE_OPTIONS$1 = {
|
|
14397
14397
|
lightDirection: DEFAULT_LIGHT_DIRECTION$1
|
|
14398
14398
|
};
|
|
14399
|
-
function getUniforms$
|
|
14399
|
+
function getUniforms$4() {
|
|
14400
14400
|
let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_MODULE_OPTIONS$1;
|
|
14401
14401
|
const uniforms = {};
|
|
14402
14402
|
if (opts.lightDirection) {
|
|
@@ -14404,13 +14404,13 @@ function getUniforms$3() {
|
|
|
14404
14404
|
}
|
|
14405
14405
|
return uniforms;
|
|
14406
14406
|
}
|
|
14407
|
-
const vs$
|
|
14408
|
-
const fs$
|
|
14407
|
+
const vs$q = null;
|
|
14408
|
+
const fs$p = "uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n";
|
|
14409
14409
|
const dirlight = {
|
|
14410
14410
|
name: "dirlight",
|
|
14411
|
-
vs: vs$
|
|
14412
|
-
fs: fs$
|
|
14413
|
-
getUniforms: getUniforms$
|
|
14411
|
+
vs: vs$q,
|
|
14412
|
+
fs: fs$p,
|
|
14413
|
+
getUniforms: getUniforms$4,
|
|
14414
14414
|
dependencies: [project$1]
|
|
14415
14415
|
};
|
|
14416
14416
|
const DEFAULT_HIGHLIGHT_COLOR = new Uint8Array([0, 255, 255, 255]);
|
|
@@ -14420,7 +14420,7 @@ const DEFAULT_MODULE_OPTIONS = {
|
|
|
14420
14420
|
pickingActive: false,
|
|
14421
14421
|
pickingAttribute: false
|
|
14422
14422
|
};
|
|
14423
|
-
function getUniforms$
|
|
14423
|
+
function getUniforms$3() {
|
|
14424
14424
|
let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_MODULE_OPTIONS;
|
|
14425
14425
|
const uniforms = {};
|
|
14426
14426
|
if (opts.pickingSelectedColor !== void 0) {
|
|
@@ -14445,13 +14445,13 @@ function getUniforms$2() {
|
|
|
14445
14445
|
}
|
|
14446
14446
|
return uniforms;
|
|
14447
14447
|
}
|
|
14448
|
-
const vs$
|
|
14449
|
-
const fs$
|
|
14448
|
+
const vs$p = "uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n";
|
|
14449
|
+
const fs$o = "uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n";
|
|
14450
14450
|
const picking$1 = {
|
|
14451
14451
|
name: "picking",
|
|
14452
|
-
vs: vs$
|
|
14453
|
-
fs: fs$
|
|
14454
|
-
getUniforms: getUniforms$
|
|
14452
|
+
vs: vs$p,
|
|
14453
|
+
fs: fs$o,
|
|
14454
|
+
getUniforms: getUniforms$3
|
|
14455
14455
|
};
|
|
14456
14456
|
const lightingShader = "\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";
|
|
14457
14457
|
const INITIAL_MODULE_OPTIONS$1 = {};
|
|
@@ -14469,7 +14469,7 @@ function getMaterialUniforms(material) {
|
|
|
14469
14469
|
lighting_uSpecularColor: specularColor.map((x) => x / 255)
|
|
14470
14470
|
};
|
|
14471
14471
|
}
|
|
14472
|
-
function getUniforms$
|
|
14472
|
+
function getUniforms$2() {
|
|
14473
14473
|
let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : INITIAL_MODULE_OPTIONS$1;
|
|
14474
14474
|
if (!("material" in opts)) {
|
|
14475
14475
|
return {};
|
|
@@ -14491,7 +14491,7 @@ const gouraudLighting = {
|
|
|
14491
14491
|
defines: {
|
|
14492
14492
|
LIGHTING_VERTEX: 1
|
|
14493
14493
|
},
|
|
14494
|
-
getUniforms: getUniforms$
|
|
14494
|
+
getUniforms: getUniforms$2
|
|
14495
14495
|
};
|
|
14496
14496
|
const phongLighting = {
|
|
14497
14497
|
name: "phong-lighting",
|
|
@@ -14500,23 +14500,23 @@ const phongLighting = {
|
|
|
14500
14500
|
defines: {
|
|
14501
14501
|
LIGHTING_FRAGMENT: 1
|
|
14502
14502
|
},
|
|
14503
|
-
getUniforms: getUniforms$
|
|
14503
|
+
getUniforms: getUniforms$2
|
|
14504
14504
|
};
|
|
14505
|
-
const vs$
|
|
14506
|
-
const fs$
|
|
14505
|
+
const vs$o = "uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n";
|
|
14506
|
+
const fs$n = "#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n";
|
|
14507
14507
|
const pbr = {
|
|
14508
14508
|
name: "pbr",
|
|
14509
|
-
vs: vs$
|
|
14510
|
-
fs: fs$
|
|
14509
|
+
vs: vs$o,
|
|
14510
|
+
fs: fs$n,
|
|
14511
14511
|
defines: {
|
|
14512
14512
|
LIGHTING_FRAGMENT: 1
|
|
14513
14513
|
},
|
|
14514
14514
|
dependencies: [lights]
|
|
14515
14515
|
};
|
|
14516
|
-
const vs$
|
|
14516
|
+
const vs$n = "attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n";
|
|
14517
14517
|
const transform$2 = {
|
|
14518
14518
|
name: "transform",
|
|
14519
|
-
vs: vs$
|
|
14519
|
+
vs: vs$n,
|
|
14520
14520
|
fs: null
|
|
14521
14521
|
};
|
|
14522
14522
|
class ProgramManager {
|
|
@@ -14916,7 +14916,7 @@ class Model {
|
|
|
14916
14916
|
uniforms = {},
|
|
14917
14917
|
attributes = {},
|
|
14918
14918
|
transformFeedback = this.transformFeedback,
|
|
14919
|
-
parameters = {},
|
|
14919
|
+
parameters: parameters2 = {},
|
|
14920
14920
|
vertexArray = this.vertexArray
|
|
14921
14921
|
} = opts;
|
|
14922
14922
|
this.setAttributes(attributes);
|
|
@@ -14950,7 +14950,7 @@ class Model {
|
|
|
14950
14950
|
logPriority,
|
|
14951
14951
|
uniforms: null,
|
|
14952
14952
|
framebuffer,
|
|
14953
|
-
parameters,
|
|
14953
|
+
parameters: parameters2,
|
|
14954
14954
|
drawMode: this.getDrawMode(),
|
|
14955
14955
|
vertexCount: this.getVertexCount(),
|
|
14956
14956
|
vertexArray,
|
|
@@ -14975,20 +14975,20 @@ class Model {
|
|
|
14975
14975
|
unbindModels = []
|
|
14976
14976
|
} = opts;
|
|
14977
14977
|
let {
|
|
14978
|
-
parameters
|
|
14978
|
+
parameters: parameters2
|
|
14979
14979
|
} = opts;
|
|
14980
14980
|
if (feedbackBuffers) {
|
|
14981
14981
|
this._setFeedbackBuffers(feedbackBuffers);
|
|
14982
14982
|
}
|
|
14983
14983
|
if (discard) {
|
|
14984
|
-
|
|
14984
|
+
parameters2 = Object.assign({}, parameters2, {
|
|
14985
14985
|
[35977]: discard
|
|
14986
14986
|
});
|
|
14987
14987
|
}
|
|
14988
14988
|
unbindModels.forEach((model) => model.vertexArray.unbindBuffers());
|
|
14989
14989
|
try {
|
|
14990
14990
|
this.draw(Object.assign({}, opts, {
|
|
14991
|
-
parameters
|
|
14991
|
+
parameters: parameters2
|
|
14992
14992
|
}));
|
|
14993
14993
|
} finally {
|
|
14994
14994
|
unbindModels.forEach((model) => model.vertexArray.bindBuffers());
|
|
@@ -15533,7 +15533,7 @@ class TextureTransform {
|
|
|
15533
15533
|
} = this.bindings[this.currentIndex];
|
|
15534
15534
|
const attributes = Object.assign({}, sourceBuffers, opts.attributes);
|
|
15535
15535
|
const uniforms = Object.assign({}, opts.uniforms);
|
|
15536
|
-
const
|
|
15536
|
+
const parameters2 = Object.assign({}, opts.parameters);
|
|
15537
15537
|
let discard = opts.discard;
|
|
15538
15538
|
if (this.hasSourceTextures || this.hasTargetTexture) {
|
|
15539
15539
|
attributes.transform_elementID = this.elementIDBuffer;
|
|
@@ -15551,14 +15551,14 @@ class TextureTransform {
|
|
|
15551
15551
|
}
|
|
15552
15552
|
if (this.hasTargetTexture) {
|
|
15553
15553
|
discard = false;
|
|
15554
|
-
|
|
15554
|
+
parameters2.viewport = [0, 0, framebuffer.width, framebuffer.height];
|
|
15555
15555
|
}
|
|
15556
15556
|
return {
|
|
15557
15557
|
attributes,
|
|
15558
15558
|
framebuffer,
|
|
15559
15559
|
uniforms,
|
|
15560
15560
|
discard,
|
|
15561
|
-
parameters
|
|
15561
|
+
parameters: parameters2
|
|
15562
15562
|
};
|
|
15563
15563
|
}
|
|
15564
15564
|
swap() {
|
|
@@ -16863,12 +16863,12 @@ const esm$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
16863
16863
|
withParameters
|
|
16864
16864
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16865
16865
|
const defines = "#define SMOOTH_EDGE_RADIUS 0.5";
|
|
16866
|
-
const vs$
|
|
16867
|
-
const fs$
|
|
16866
|
+
const vs$m = "\n".concat(defines, "\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n");
|
|
16867
|
+
const fs$m = "\n".concat(defines, "\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n");
|
|
16868
16868
|
const geometry = {
|
|
16869
16869
|
name: "geometry",
|
|
16870
|
-
vs: vs$
|
|
16871
|
-
fs: fs$
|
|
16870
|
+
vs: vs$m,
|
|
16871
|
+
fs: fs$m
|
|
16872
16872
|
};
|
|
16873
16873
|
const COORDINATE_SYSTEM = {
|
|
16874
16874
|
DEFAULT: -1,
|
|
@@ -17118,7 +17118,7 @@ function calculateViewportUniforms({
|
|
|
17118
17118
|
return uniforms;
|
|
17119
17119
|
}
|
|
17120
17120
|
const INITIAL_MODULE_OPTIONS = {};
|
|
17121
|
-
function getUniforms(opts = INITIAL_MODULE_OPTIONS) {
|
|
17121
|
+
function getUniforms$1(opts = INITIAL_MODULE_OPTIONS) {
|
|
17122
17122
|
if ("viewport" in opts) {
|
|
17123
17123
|
return getUniformsFromViewport(opts);
|
|
17124
17124
|
}
|
|
@@ -17128,13 +17128,13 @@ const project = {
|
|
|
17128
17128
|
name: "project",
|
|
17129
17129
|
dependencies: [fp32, geometry],
|
|
17130
17130
|
vs: projectShader,
|
|
17131
|
-
getUniforms
|
|
17131
|
+
getUniforms: getUniforms$1
|
|
17132
17132
|
};
|
|
17133
|
-
const vs$
|
|
17133
|
+
const vs$l = "\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n mat3 rotation;\n if (project_needs_rotation(projectedPosition, rotation)) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n";
|
|
17134
17134
|
const project32 = {
|
|
17135
17135
|
name: "project32",
|
|
17136
17136
|
dependencies: [project],
|
|
17137
|
-
vs: vs$
|
|
17137
|
+
vs: vs$l
|
|
17138
17138
|
};
|
|
17139
17139
|
function createMat4$1() {
|
|
17140
17140
|
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -17784,8 +17784,8 @@ function getFlyToTransitionParams(startProps, endProps, opts) {
|
|
|
17784
17784
|
r1
|
|
17785
17785
|
};
|
|
17786
17786
|
}
|
|
17787
|
-
const vs$
|
|
17788
|
-
const fs$
|
|
17787
|
+
const vs$k = "\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n";
|
|
17788
|
+
const fs$l = "\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n";
|
|
17789
17789
|
const getMemoizedViewportCenterPosition = memoize$1(getViewportCenterPosition);
|
|
17790
17790
|
const getMemoizedViewProjectionMatrices = memoize$1(getViewProjectionMatrices);
|
|
17791
17791
|
const DEFAULT_SHADOW_COLOR$1 = [0, 0, 0, 1];
|
|
@@ -17878,8 +17878,8 @@ function createShadowUniforms(opts, context) {
|
|
|
17878
17878
|
const shadow = {
|
|
17879
17879
|
name: "shadow",
|
|
17880
17880
|
dependencies: [project],
|
|
17881
|
-
vs: vs$
|
|
17882
|
-
fs: fs$
|
|
17881
|
+
vs: vs$k,
|
|
17882
|
+
fs: fs$l,
|
|
17883
17883
|
inject: {
|
|
17884
17884
|
"vs:DECKGL_FILTER_GL_POSITION": "\n position = shadow_setVertexPosition(geometry.position);\n ",
|
|
17885
17885
|
"fs:DECKGL_FILTER_COLOR": "\n color = shadow_filterShadowColor(color);\n "
|
|
@@ -17907,8 +17907,8 @@ const DEFAULT_MODULES = [project];
|
|
|
17907
17907
|
const SHADER_HOOKS = ["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)", "vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)", "vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)", "fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];
|
|
17908
17908
|
function createProgramManager(gl) {
|
|
17909
17909
|
const programManager = ProgramManager.getDefaultProgramManager(gl);
|
|
17910
|
-
for (const
|
|
17911
|
-
programManager.addDefaultModule(
|
|
17910
|
+
for (const shaderModule2 of DEFAULT_MODULES) {
|
|
17911
|
+
programManager.addDefaultModule(shaderModule2);
|
|
17912
17912
|
}
|
|
17913
17913
|
for (const shaderHook of SHADER_HOOKS) {
|
|
17914
17914
|
programManager.addShaderHook(shaderHook);
|
|
@@ -18406,13 +18406,13 @@ class LightingEffect {
|
|
|
18406
18406
|
}
|
|
18407
18407
|
}
|
|
18408
18408
|
getModuleParameters(layer) {
|
|
18409
|
-
const
|
|
18409
|
+
const parameters2 = this.shadow ? {
|
|
18410
18410
|
shadowMaps: this.shadowMaps,
|
|
18411
18411
|
dummyShadowMap: this.dummyShadowMap,
|
|
18412
18412
|
shadowColor: this.shadowColor,
|
|
18413
18413
|
shadowMatrices: this.shadowMatrices
|
|
18414
18414
|
} : {};
|
|
18415
|
-
|
|
18415
|
+
parameters2.lightSources = {
|
|
18416
18416
|
ambientLight: this.ambientLight,
|
|
18417
18417
|
directionalLights: this.directionalLights.map((directionalLight) => directionalLight.getProjectedLight({
|
|
18418
18418
|
layer
|
|
@@ -18421,7 +18421,7 @@ class LightingEffect {
|
|
|
18421
18421
|
layer
|
|
18422
18422
|
}))
|
|
18423
18423
|
};
|
|
18424
|
-
return
|
|
18424
|
+
return parameters2;
|
|
18425
18425
|
}
|
|
18426
18426
|
cleanup() {
|
|
18427
18427
|
for (const shadowPass of this.shadowPasses) {
|
|
@@ -26031,7 +26031,7 @@ function noop$2() {
|
|
|
26031
26031
|
const getCursor = ({
|
|
26032
26032
|
isDragging
|
|
26033
26033
|
}) => isDragging ? "grabbing" : "grab";
|
|
26034
|
-
const defaultProps$
|
|
26034
|
+
const defaultProps$P = {
|
|
26035
26035
|
id: "",
|
|
26036
26036
|
width: "100%",
|
|
26037
26037
|
height: "100%",
|
|
@@ -26162,7 +26162,7 @@ class Deck {
|
|
|
26162
26162
|
this._lastPointerDownInfo = pickedInfo.result[0] || pickedInfo.emptyInfo;
|
|
26163
26163
|
});
|
|
26164
26164
|
this.props = {
|
|
26165
|
-
...defaultProps$
|
|
26165
|
+
...defaultProps$P,
|
|
26166
26166
|
...props
|
|
26167
26167
|
};
|
|
26168
26168
|
props = this.props;
|
|
@@ -26664,7 +26664,7 @@ class Deck {
|
|
|
26664
26664
|
metrics.gpuMemory = memoryStats.get("GPU Memory").count;
|
|
26665
26665
|
}
|
|
26666
26666
|
}
|
|
26667
|
-
_defineProperty(Deck, "defaultProps", defaultProps$
|
|
26667
|
+
_defineProperty(Deck, "defaultProps", defaultProps$P);
|
|
26668
26668
|
_defineProperty(Deck, "VERSION", deckGlobal.VERSION);
|
|
26669
26669
|
class ShaderAttribute {
|
|
26670
26670
|
constructor(dataColumn, opts) {
|
|
@@ -27838,11 +27838,11 @@ class GPUInterpolationTransition {
|
|
|
27838
27838
|
this.buffers.length = 0;
|
|
27839
27839
|
}
|
|
27840
27840
|
}
|
|
27841
|
-
const vs$
|
|
27841
|
+
const vs$j = "\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n";
|
|
27842
27842
|
function getTransform$1(gl, attribute) {
|
|
27843
27843
|
const attributeType = getAttributeTypeFromSize(attribute.size);
|
|
27844
27844
|
return new Transform(gl, {
|
|
27845
|
-
vs: vs$
|
|
27845
|
+
vs: vs$j,
|
|
27846
27846
|
defines: {
|
|
27847
27847
|
ATTRIBUTE_TYPE: attributeType
|
|
27848
27848
|
},
|
|
@@ -27878,7 +27878,7 @@ class GPUSpringTransition {
|
|
|
27878
27878
|
this.currentStartIndices = attribute.startIndices;
|
|
27879
27879
|
this.currentLength = 0;
|
|
27880
27880
|
this.texture = getTexture(gl);
|
|
27881
|
-
this.framebuffer = getFramebuffer$
|
|
27881
|
+
this.framebuffer = getFramebuffer$2(gl, this.texture);
|
|
27882
27882
|
this.transform = getTransform(gl, attribute, this.framebuffer);
|
|
27883
27883
|
const bufferOpts = {
|
|
27884
27884
|
byteLength: 0,
|
|
@@ -28009,7 +28009,7 @@ function getTexture(gl) {
|
|
|
28009
28009
|
height: 1
|
|
28010
28010
|
});
|
|
28011
28011
|
}
|
|
28012
|
-
function getFramebuffer$
|
|
28012
|
+
function getFramebuffer$2(gl, texture) {
|
|
28013
28013
|
return new Framebuffer(gl, {
|
|
28014
28014
|
id: "spring-transition-is-transitioning-framebuffer",
|
|
28015
28015
|
width: 1,
|
|
@@ -29419,7 +29419,7 @@ const areViewportsEqual = memoize$1(({
|
|
|
29419
29419
|
return oldViewport.equals(viewport);
|
|
29420
29420
|
});
|
|
29421
29421
|
let pickingColorCache = new Uint8ClampedArray(0);
|
|
29422
|
-
const defaultProps$
|
|
29422
|
+
const defaultProps$O = {
|
|
29423
29423
|
data: {
|
|
29424
29424
|
type: "data",
|
|
29425
29425
|
value: EMPTY_ARRAY$1,
|
|
@@ -30109,7 +30109,7 @@ class Layer extends Component {
|
|
|
30109
30109
|
_drawLayer({
|
|
30110
30110
|
moduleParameters = null,
|
|
30111
30111
|
uniforms = {},
|
|
30112
|
-
parameters = {}
|
|
30112
|
+
parameters: parameters2 = {}
|
|
30113
30113
|
}) {
|
|
30114
30114
|
this._updateAttributeTransition();
|
|
30115
30115
|
const currentProps = this.props;
|
|
@@ -30128,11 +30128,11 @@ class Layer extends Component {
|
|
|
30128
30128
|
setParameters(context.gl, {
|
|
30129
30129
|
polygonOffset: offsets
|
|
30130
30130
|
});
|
|
30131
|
-
withParameters(context.gl,
|
|
30131
|
+
withParameters(context.gl, parameters2, () => {
|
|
30132
30132
|
const opts = {
|
|
30133
30133
|
moduleParameters,
|
|
30134
30134
|
uniforms,
|
|
30135
|
-
parameters,
|
|
30135
|
+
parameters: parameters2,
|
|
30136
30136
|
context
|
|
30137
30137
|
};
|
|
30138
30138
|
for (const extension of this.props.extensions) {
|
|
@@ -30256,17 +30256,17 @@ class Layer extends Component {
|
|
|
30256
30256
|
highlightColor
|
|
30257
30257
|
} = props;
|
|
30258
30258
|
if (forceUpdate || oldProps.autoHighlight !== autoHighlight || oldProps.highlightedObjectIndex !== highlightedObjectIndex || oldProps.highlightColor !== highlightColor) {
|
|
30259
|
-
const
|
|
30259
|
+
const parameters2 = {};
|
|
30260
30260
|
if (!autoHighlight) {
|
|
30261
|
-
|
|
30261
|
+
parameters2.pickingSelectedColor = null;
|
|
30262
30262
|
}
|
|
30263
30263
|
if (Array.isArray(highlightColor)) {
|
|
30264
|
-
|
|
30264
|
+
parameters2.pickingHighlightColor = highlightColor;
|
|
30265
30265
|
}
|
|
30266
30266
|
if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
|
|
30267
|
-
|
|
30267
|
+
parameters2.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
|
|
30268
30268
|
}
|
|
30269
|
-
this.setModuleParameters(
|
|
30269
|
+
this.setModuleParameters(parameters2);
|
|
30270
30270
|
}
|
|
30271
30271
|
}
|
|
30272
30272
|
_getUpdateParams() {
|
|
@@ -30294,7 +30294,7 @@ class Layer extends Component {
|
|
|
30294
30294
|
this.setNeedsUpdate();
|
|
30295
30295
|
}
|
|
30296
30296
|
}
|
|
30297
|
-
_defineProperty(Layer, "defaultProps", defaultProps$
|
|
30297
|
+
_defineProperty(Layer, "defaultProps", defaultProps$O);
|
|
30298
30298
|
_defineProperty(Layer, "layerName", "Layer");
|
|
30299
30299
|
const TRACE_RENDER_LAYERS = "compositeLayer.renderLayers";
|
|
30300
30300
|
class CompositeLayer extends Layer {
|
|
@@ -30370,7 +30370,7 @@ class CompositeLayer extends Layer {
|
|
|
30370
30370
|
opacity,
|
|
30371
30371
|
pickable,
|
|
30372
30372
|
visible,
|
|
30373
|
-
parameters,
|
|
30373
|
+
parameters: parameters2,
|
|
30374
30374
|
getPolygonOffset,
|
|
30375
30375
|
highlightedObjectIndex,
|
|
30376
30376
|
autoHighlight,
|
|
@@ -30391,7 +30391,7 @@ class CompositeLayer extends Layer {
|
|
|
30391
30391
|
opacity,
|
|
30392
30392
|
pickable,
|
|
30393
30393
|
visible,
|
|
30394
|
-
parameters,
|
|
30394
|
+
parameters: parameters2,
|
|
30395
30395
|
getPolygonOffset,
|
|
30396
30396
|
highlightedObjectIndex,
|
|
30397
30397
|
autoHighlight,
|
|
@@ -31330,6 +31330,307 @@ const esm$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
31330
31330
|
project32,
|
|
31331
31331
|
shadow
|
|
31332
31332
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
31333
|
+
const vs$i = "\nuniform DATAFILTER_TYPE filter_min;\nuniform DATAFILTER_TYPE filter_softMin;\nuniform DATAFILTER_TYPE filter_softMax;\nuniform DATAFILTER_TYPE filter_max;\nuniform bool filter_useSoftMargin;\nuniform bool filter_enabled;\nuniform bool filter_transformSize;\n\n#ifdef NON_INSTANCED_MODEL\n #define DATAFILTER_ATTRIB filterValues\n #define DATAFILTER_ATTRIB_64LOW filterValues64Low\n#else\n #define DATAFILTER_ATTRIB instanceFilterValues\n #define DATAFILTER_ATTRIB_64LOW instanceFilterValues64Low\n#endif\n\nattribute DATAFILTER_TYPE DATAFILTER_ATTRIB;\n#ifdef DATAFILTER_DOUBLE\n attribute DATAFILTER_TYPE DATAFILTER_ATTRIB_64LOW;\n\n uniform DATAFILTER_TYPE filter_min64High;\n uniform DATAFILTER_TYPE filter_max64High;\n#endif\n\nvarying float dataFilter_value;\n\nfloat dataFilter_reduceValue(float value) {\n return value;\n}\nfloat dataFilter_reduceValue(vec2 value) {\n return min(value.x, value.y);\n}\nfloat dataFilter_reduceValue(vec3 value) {\n return min(min(value.x, value.y), value.z);\n}\nfloat dataFilter_reduceValue(vec4 value) {\n return min(min(value.x, value.y), min(value.z, value.w));\n}\nvoid dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFromMax) {\n if (filter_enabled) {\n if (filter_useSoftMargin) {\n dataFilter_value = dataFilter_reduceValue(\n smoothstep(filter_min, filter_softMin, valueFromMin) *\n (1.0 - smoothstep(filter_softMax, filter_max, valueFromMax))\n );\n } else {\n dataFilter_value = dataFilter_reduceValue(\n step(filter_min, valueFromMin) * step(valueFromMax, filter_max)\n );\n }\n } else {\n dataFilter_value = 1.0;\n }\n}\n";
|
|
31334
|
+
const fs$k = "\nuniform bool filter_transformColor;\nvarying float dataFilter_value;\n";
|
|
31335
|
+
function getUniforms(opts) {
|
|
31336
|
+
if (!opts || !("extensions" in opts)) {
|
|
31337
|
+
return {};
|
|
31338
|
+
}
|
|
31339
|
+
const {
|
|
31340
|
+
filterRange = [-1, 1],
|
|
31341
|
+
filterEnabled = true,
|
|
31342
|
+
filterTransformSize = true,
|
|
31343
|
+
filterTransformColor = true
|
|
31344
|
+
} = opts;
|
|
31345
|
+
const filterSoftRange = opts.filterSoftRange || filterRange;
|
|
31346
|
+
return {
|
|
31347
|
+
...Number.isFinite(filterRange[0]) ? {
|
|
31348
|
+
filter_min: filterRange[0],
|
|
31349
|
+
filter_softMin: filterSoftRange[0],
|
|
31350
|
+
filter_softMax: filterSoftRange[1],
|
|
31351
|
+
filter_max: filterRange[1]
|
|
31352
|
+
} : {
|
|
31353
|
+
filter_min: filterRange.map((r2) => r2[0]),
|
|
31354
|
+
filter_softMin: filterSoftRange.map((r2) => r2[0]),
|
|
31355
|
+
filter_softMax: filterSoftRange.map((r2) => r2[1]),
|
|
31356
|
+
filter_max: filterRange.map((r2) => r2[1])
|
|
31357
|
+
},
|
|
31358
|
+
filter_enabled: filterEnabled,
|
|
31359
|
+
filter_useSoftMargin: Boolean(opts.filterSoftRange),
|
|
31360
|
+
filter_transformSize: filterEnabled && filterTransformSize,
|
|
31361
|
+
filter_transformColor: filterEnabled && filterTransformColor
|
|
31362
|
+
};
|
|
31363
|
+
}
|
|
31364
|
+
function getUniforms64(opts) {
|
|
31365
|
+
if (!opts || !("extensions" in opts)) {
|
|
31366
|
+
return {};
|
|
31367
|
+
}
|
|
31368
|
+
const uniforms = getUniforms(opts);
|
|
31369
|
+
if (Number.isFinite(uniforms.filter_min)) {
|
|
31370
|
+
const min64High = Math.fround(uniforms.filter_min);
|
|
31371
|
+
uniforms.filter_min -= min64High;
|
|
31372
|
+
uniforms.filter_softMin -= min64High;
|
|
31373
|
+
uniforms.filter_min64High = min64High;
|
|
31374
|
+
const max64High = Math.fround(uniforms.filter_max);
|
|
31375
|
+
uniforms.filter_max -= max64High;
|
|
31376
|
+
uniforms.filter_softMax -= max64High;
|
|
31377
|
+
uniforms.filter_max64High = max64High;
|
|
31378
|
+
} else {
|
|
31379
|
+
const min64High = uniforms.filter_min.map(Math.fround);
|
|
31380
|
+
uniforms.filter_min = uniforms.filter_min.map((x, i2) => x - min64High[i2]);
|
|
31381
|
+
uniforms.filter_softMin = uniforms.filter_softMin.map((x, i2) => x - min64High[i2]);
|
|
31382
|
+
uniforms.filter_min64High = min64High;
|
|
31383
|
+
const max64High = uniforms.filter_max.map(Math.fround);
|
|
31384
|
+
uniforms.filter_max = uniforms.filter_max.map((x, i2) => x - max64High[i2]);
|
|
31385
|
+
uniforms.filter_softMax = uniforms.filter_softMax.map((x, i2) => x - max64High[i2]);
|
|
31386
|
+
uniforms.filter_max64High = max64High;
|
|
31387
|
+
}
|
|
31388
|
+
return uniforms;
|
|
31389
|
+
}
|
|
31390
|
+
const inject$2 = {
|
|
31391
|
+
"vs:#main-start": "\n #ifdef DATAFILTER_DOUBLE\n dataFilter_setValue(\n DATAFILTER_ATTRIB - filter_min64High + DATAFILTER_ATTRIB_64LOW,\n DATAFILTER_ATTRIB - filter_max64High + DATAFILTER_ATTRIB_64LOW\n );\n #else\n dataFilter_setValue(DATAFILTER_ATTRIB, DATAFILTER_ATTRIB);\n #endif\n ",
|
|
31392
|
+
"vs:#main-end": "\n if (dataFilter_value == 0.0) {\n gl_Position = vec4(0.);\n }\n ",
|
|
31393
|
+
"vs:DECKGL_FILTER_SIZE": "\n if (filter_transformSize) {\n size = size * dataFilter_value;\n }\n ",
|
|
31394
|
+
"fs:DECKGL_FILTER_COLOR": "\n if (dataFilter_value == 0.0) discard;\n if (filter_transformColor) {\n color.a *= dataFilter_value;\n }\n "
|
|
31395
|
+
};
|
|
31396
|
+
const shaderModule = {
|
|
31397
|
+
name: "data-filter",
|
|
31398
|
+
vs: vs$i,
|
|
31399
|
+
fs: fs$k,
|
|
31400
|
+
inject: inject$2,
|
|
31401
|
+
getUniforms
|
|
31402
|
+
};
|
|
31403
|
+
const shaderModule64 = {
|
|
31404
|
+
name: "data-filter-fp64",
|
|
31405
|
+
vs: vs$i,
|
|
31406
|
+
fs: fs$k,
|
|
31407
|
+
inject: inject$2,
|
|
31408
|
+
getUniforms: getUniforms64
|
|
31409
|
+
};
|
|
31410
|
+
const AGGREGATE_VS = "#define SHADER_NAME data-filter-vertex-shader\n\n#ifdef FLOAT_TARGET\n attribute float filterIndices;\n attribute float filterPrevIndices;\n#else\n attribute vec2 filterIndices;\n attribute vec2 filterPrevIndices;\n#endif\n\nvarying vec4 vColor;\nconst float component = 1.0 / 255.0;\n\nvoid main() {\n #ifdef FLOAT_TARGET\n dataFilter_value *= float(filterIndices != filterPrevIndices);\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n vColor = vec4(0.0, 0.0, 0.0, 1.0);\n #else\n // Float texture is not supported: pack result into 4 channels x 256 px x 64px\n dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);\n float col = filterIndices.x;\n float row = filterIndices.y * 4.0;\n float channel = floor(row);\n row = fract(row);\n vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));\n gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);\n #endif\n gl_PointSize = 1.0;\n}\n";
|
|
31411
|
+
const AGGREGATE_FS = "#define SHADER_NAME data-filter-fragment-shader\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main() {\n if (dataFilter_value < 0.5) {\n discard;\n }\n gl_FragColor = vColor;\n}\n";
|
|
31412
|
+
function supportsFloatTarget(gl) {
|
|
31413
|
+
return Boolean(gl.getExtension("EXT_float_blend") && (gl.getExtension("EXT_color_buffer_float") || gl.getExtension("WEBGL_color_buffer_float")));
|
|
31414
|
+
}
|
|
31415
|
+
function getFramebuffer$1(gl, useFloatTarget) {
|
|
31416
|
+
if (useFloatTarget) {
|
|
31417
|
+
return new Framebuffer(gl, {
|
|
31418
|
+
width: 1,
|
|
31419
|
+
height: 1,
|
|
31420
|
+
attachments: {
|
|
31421
|
+
[36064]: new Texture2D(gl, {
|
|
31422
|
+
format: isWebGL2$1(gl) ? 34836 : 6408,
|
|
31423
|
+
type: 5126,
|
|
31424
|
+
mipmaps: false
|
|
31425
|
+
})
|
|
31426
|
+
}
|
|
31427
|
+
});
|
|
31428
|
+
}
|
|
31429
|
+
return new Framebuffer(gl, {
|
|
31430
|
+
width: 256,
|
|
31431
|
+
height: 64,
|
|
31432
|
+
depth: false
|
|
31433
|
+
});
|
|
31434
|
+
}
|
|
31435
|
+
function getModel(gl, shaderOptions, useFloatTarget) {
|
|
31436
|
+
shaderOptions.defines.NON_INSTANCED_MODEL = 1;
|
|
31437
|
+
if (useFloatTarget) {
|
|
31438
|
+
shaderOptions.defines.FLOAT_TARGET = 1;
|
|
31439
|
+
}
|
|
31440
|
+
return new Model(gl, {
|
|
31441
|
+
id: "data-filter-aggregation-model",
|
|
31442
|
+
vertexCount: 1,
|
|
31443
|
+
isInstanced: false,
|
|
31444
|
+
drawMode: 0,
|
|
31445
|
+
vs: AGGREGATE_VS,
|
|
31446
|
+
fs: AGGREGATE_FS,
|
|
31447
|
+
...shaderOptions
|
|
31448
|
+
});
|
|
31449
|
+
}
|
|
31450
|
+
const parameters = {
|
|
31451
|
+
blend: true,
|
|
31452
|
+
blendFunc: [1, 1, 1, 1],
|
|
31453
|
+
blendEquation: [32774, 32774],
|
|
31454
|
+
depthTest: false
|
|
31455
|
+
};
|
|
31456
|
+
const defaultProps$N = {
|
|
31457
|
+
getFilterValue: {
|
|
31458
|
+
type: "accessor",
|
|
31459
|
+
value: 0
|
|
31460
|
+
},
|
|
31461
|
+
onFilteredItemsChange: {
|
|
31462
|
+
type: "function",
|
|
31463
|
+
value: null,
|
|
31464
|
+
compare: false
|
|
31465
|
+
},
|
|
31466
|
+
filterEnabled: true,
|
|
31467
|
+
filterRange: [-1, 1],
|
|
31468
|
+
filterSoftRange: null,
|
|
31469
|
+
filterTransformSize: true,
|
|
31470
|
+
filterTransformColor: true
|
|
31471
|
+
};
|
|
31472
|
+
const DATA_TYPE_FROM_SIZE = {
|
|
31473
|
+
1: "float",
|
|
31474
|
+
2: "vec2",
|
|
31475
|
+
3: "vec3",
|
|
31476
|
+
4: "vec4"
|
|
31477
|
+
};
|
|
31478
|
+
class DataFilterExtension extends LayerExtension {
|
|
31479
|
+
constructor({
|
|
31480
|
+
filterSize = 1,
|
|
31481
|
+
fp64: fp642 = false,
|
|
31482
|
+
countItems = false
|
|
31483
|
+
} = {}) {
|
|
31484
|
+
if (!DATA_TYPE_FROM_SIZE[filterSize]) {
|
|
31485
|
+
throw new Error("filterSize out of range");
|
|
31486
|
+
}
|
|
31487
|
+
super({
|
|
31488
|
+
filterSize,
|
|
31489
|
+
fp64: fp642,
|
|
31490
|
+
countItems
|
|
31491
|
+
});
|
|
31492
|
+
}
|
|
31493
|
+
getShaders(extension) {
|
|
31494
|
+
const {
|
|
31495
|
+
filterSize,
|
|
31496
|
+
fp64: fp642
|
|
31497
|
+
} = extension.opts;
|
|
31498
|
+
return {
|
|
31499
|
+
modules: [fp642 ? shaderModule64 : shaderModule],
|
|
31500
|
+
defines: {
|
|
31501
|
+
DATAFILTER_TYPE: DATA_TYPE_FROM_SIZE[filterSize],
|
|
31502
|
+
DATAFILTER_DOUBLE: Boolean(fp642)
|
|
31503
|
+
}
|
|
31504
|
+
};
|
|
31505
|
+
}
|
|
31506
|
+
initializeState(context, extension) {
|
|
31507
|
+
const attributeManager = this.getAttributeManager();
|
|
31508
|
+
if (attributeManager) {
|
|
31509
|
+
attributeManager.add({
|
|
31510
|
+
filterValues: {
|
|
31511
|
+
size: extension.opts.filterSize,
|
|
31512
|
+
type: extension.opts.fp64 ? 5130 : 5126,
|
|
31513
|
+
accessor: "getFilterValue",
|
|
31514
|
+
shaderAttributes: {
|
|
31515
|
+
filterValues: {
|
|
31516
|
+
divisor: 0
|
|
31517
|
+
},
|
|
31518
|
+
instanceFilterValues: {
|
|
31519
|
+
divisor: 1
|
|
31520
|
+
}
|
|
31521
|
+
}
|
|
31522
|
+
}
|
|
31523
|
+
});
|
|
31524
|
+
}
|
|
31525
|
+
const {
|
|
31526
|
+
gl
|
|
31527
|
+
} = this.context;
|
|
31528
|
+
if (attributeManager && extension.opts.countItems) {
|
|
31529
|
+
const useFloatTarget = supportsFloatTarget(gl);
|
|
31530
|
+
attributeManager.add({
|
|
31531
|
+
filterIndices: {
|
|
31532
|
+
size: useFloatTarget ? 1 : 2,
|
|
31533
|
+
vertexOffset: 1,
|
|
31534
|
+
type: 5121,
|
|
31535
|
+
normalized: true,
|
|
31536
|
+
accessor: (object2, {
|
|
31537
|
+
index: index2
|
|
31538
|
+
}) => {
|
|
31539
|
+
const i2 = object2 && object2.__source ? object2.__source.index : index2;
|
|
31540
|
+
return useFloatTarget ? (i2 + 1) % 255 : [(i2 + 1) % 255, Math.floor(i2 / 255) % 255];
|
|
31541
|
+
},
|
|
31542
|
+
shaderAttributes: {
|
|
31543
|
+
filterPrevIndices: {
|
|
31544
|
+
vertexOffset: 0
|
|
31545
|
+
},
|
|
31546
|
+
filterIndices: {
|
|
31547
|
+
vertexOffset: 1
|
|
31548
|
+
}
|
|
31549
|
+
}
|
|
31550
|
+
}
|
|
31551
|
+
});
|
|
31552
|
+
const filterFBO = getFramebuffer$1(gl, useFloatTarget);
|
|
31553
|
+
const filterModel = getModel(gl, extension.getShaders.call(this, extension), useFloatTarget);
|
|
31554
|
+
this.setState({
|
|
31555
|
+
filterFBO,
|
|
31556
|
+
filterModel
|
|
31557
|
+
});
|
|
31558
|
+
}
|
|
31559
|
+
}
|
|
31560
|
+
updateState({
|
|
31561
|
+
props,
|
|
31562
|
+
oldProps
|
|
31563
|
+
}) {
|
|
31564
|
+
if (this.state.filterModel) {
|
|
31565
|
+
const attributeManager = this.getAttributeManager();
|
|
31566
|
+
const filterNeedsUpdate = attributeManager.attributes.filterValues.needsUpdate() || props.filterEnabled !== oldProps.filterEnabled || props.filterRange !== oldProps.filterRange || props.filterSoftRange !== oldProps.filterSoftRange;
|
|
31567
|
+
if (filterNeedsUpdate) {
|
|
31568
|
+
this.setState({
|
|
31569
|
+
filterNeedsUpdate
|
|
31570
|
+
});
|
|
31571
|
+
}
|
|
31572
|
+
}
|
|
31573
|
+
}
|
|
31574
|
+
draw(params, extension) {
|
|
31575
|
+
const {
|
|
31576
|
+
filterFBO,
|
|
31577
|
+
filterModel,
|
|
31578
|
+
filterNeedsUpdate
|
|
31579
|
+
} = this.state;
|
|
31580
|
+
const {
|
|
31581
|
+
onFilteredItemsChange
|
|
31582
|
+
} = this.props;
|
|
31583
|
+
if (filterNeedsUpdate && onFilteredItemsChange && filterModel) {
|
|
31584
|
+
const {
|
|
31585
|
+
attributes: {
|
|
31586
|
+
filterValues,
|
|
31587
|
+
filterIndices
|
|
31588
|
+
}
|
|
31589
|
+
} = this.getAttributeManager();
|
|
31590
|
+
filterModel.setVertexCount(this.getNumInstances());
|
|
31591
|
+
const {
|
|
31592
|
+
gl
|
|
31593
|
+
} = this.context;
|
|
31594
|
+
clear(gl, {
|
|
31595
|
+
framebuffer: filterFBO,
|
|
31596
|
+
color: [0, 0, 0, 0]
|
|
31597
|
+
});
|
|
31598
|
+
filterModel.updateModuleSettings(params.moduleParameters).setAttributes({
|
|
31599
|
+
...filterValues.getShaderAttributes(),
|
|
31600
|
+
...filterIndices && filterIndices.getShaderAttributes()
|
|
31601
|
+
}).draw({
|
|
31602
|
+
framebuffer: filterFBO,
|
|
31603
|
+
parameters: {
|
|
31604
|
+
...parameters,
|
|
31605
|
+
viewport: [0, 0, filterFBO.width, filterFBO.height]
|
|
31606
|
+
}
|
|
31607
|
+
});
|
|
31608
|
+
const color = readPixelsToArray(filterFBO);
|
|
31609
|
+
let count2 = 0;
|
|
31610
|
+
for (let i2 = 0; i2 < color.length; i2++) {
|
|
31611
|
+
count2 += color[i2];
|
|
31612
|
+
}
|
|
31613
|
+
onFilteredItemsChange({
|
|
31614
|
+
id: this.id,
|
|
31615
|
+
count: count2
|
|
31616
|
+
});
|
|
31617
|
+
this.state.filterNeedsUpdate = false;
|
|
31618
|
+
}
|
|
31619
|
+
}
|
|
31620
|
+
finalizeState() {
|
|
31621
|
+
const {
|
|
31622
|
+
filterFBO,
|
|
31623
|
+
filterModel
|
|
31624
|
+
} = this.state;
|
|
31625
|
+
if (filterFBO) {
|
|
31626
|
+
filterFBO.color.delete();
|
|
31627
|
+
filterFBO.delete();
|
|
31628
|
+
filterModel.delete();
|
|
31629
|
+
}
|
|
31630
|
+
}
|
|
31631
|
+
}
|
|
31632
|
+
_defineProperty(DataFilterExtension, "defaultProps", defaultProps$N);
|
|
31633
|
+
_defineProperty(DataFilterExtension, "extensionName", "DataFilterExtension");
|
|
31333
31634
|
const defaultProps$M = {
|
|
31334
31635
|
clipBounds: [0, 0, 1, 1]
|
|
31335
31636
|
};
|
|
@@ -31896,13 +32197,13 @@ function resizeImage(ctx, imageData, width, height) {
|
|
|
31896
32197
|
function getIconId(icon) {
|
|
31897
32198
|
return icon && (icon.id || icon.url);
|
|
31898
32199
|
}
|
|
31899
|
-
function resizeTexture(texture, width, height,
|
|
32200
|
+
function resizeTexture(texture, width, height, parameters2) {
|
|
31900
32201
|
const oldWidth = texture.width;
|
|
31901
32202
|
const oldHeight = texture.height;
|
|
31902
32203
|
const newTexture = new Texture2D(texture.gl, {
|
|
31903
32204
|
width,
|
|
31904
32205
|
height,
|
|
31905
|
-
parameters
|
|
32206
|
+
parameters: parameters2
|
|
31906
32207
|
});
|
|
31907
32208
|
copyToTexture(texture, newTexture, {
|
|
31908
32209
|
targetY: 0,
|
|
@@ -37520,7 +37821,7 @@ function getFloatTexture(gl, opts = {}) {
|
|
|
37520
37821
|
height = 1,
|
|
37521
37822
|
data = null,
|
|
37522
37823
|
unpackFlipY = true,
|
|
37523
|
-
parameters = DEFAULT_PARAMETERS
|
|
37824
|
+
parameters: parameters2 = DEFAULT_PARAMETERS
|
|
37524
37825
|
} = opts;
|
|
37525
37826
|
const texture = new Texture2D(gl, {
|
|
37526
37827
|
data,
|
|
@@ -37528,7 +37829,7 @@ function getFloatTexture(gl, opts = {}) {
|
|
|
37528
37829
|
type: 5126,
|
|
37529
37830
|
border: 0,
|
|
37530
37831
|
mipmaps: false,
|
|
37531
|
-
parameters,
|
|
37832
|
+
parameters: parameters2,
|
|
37532
37833
|
dataFormat: 6408,
|
|
37533
37834
|
width,
|
|
37534
37835
|
height,
|
|
@@ -37768,7 +38069,7 @@ class GPUGridAggregator {
|
|
|
37768
38069
|
maxFramebuffers
|
|
37769
38070
|
} = this.state;
|
|
37770
38071
|
const gridSize = [numCol, numRow];
|
|
37771
|
-
const
|
|
38072
|
+
const parameters2 = {
|
|
37772
38073
|
blend: true,
|
|
37773
38074
|
depthTest: false,
|
|
37774
38075
|
blendFunc: [1, 1]
|
|
@@ -37788,7 +38089,7 @@ class GPUGridAggregator {
|
|
|
37788
38089
|
const combineMaxMin = needMin && needMax && weights[id].combineMaxMin;
|
|
37789
38090
|
this._renderToWeightsTexture({
|
|
37790
38091
|
id,
|
|
37791
|
-
parameters,
|
|
38092
|
+
parameters: parameters2,
|
|
37792
38093
|
moduleSettings,
|
|
37793
38094
|
uniforms,
|
|
37794
38095
|
gridSize,
|
|
@@ -37799,7 +38100,7 @@ class GPUGridAggregator {
|
|
|
37799
38100
|
this._renderToMaxMinTexture({
|
|
37800
38101
|
id,
|
|
37801
38102
|
parameters: {
|
|
37802
|
-
...
|
|
38103
|
+
...parameters2,
|
|
37803
38104
|
blendEquation: MAX_MIN_BLEND_EQUATION
|
|
37804
38105
|
},
|
|
37805
38106
|
gridSize,
|
|
@@ -37814,7 +38115,7 @@ class GPUGridAggregator {
|
|
|
37814
38115
|
this._renderToMaxMinTexture({
|
|
37815
38116
|
id,
|
|
37816
38117
|
parameters: {
|
|
37817
|
-
...
|
|
38118
|
+
...parameters2,
|
|
37818
38119
|
blendEquation: MIN_BLEND_EQUATION
|
|
37819
38120
|
},
|
|
37820
38121
|
gridSize,
|
|
@@ -37829,7 +38130,7 @@ class GPUGridAggregator {
|
|
|
37829
38130
|
this._renderToMaxMinTexture({
|
|
37830
38131
|
id,
|
|
37831
38132
|
parameters: {
|
|
37832
|
-
...
|
|
38133
|
+
...parameters2,
|
|
37833
38134
|
blendEquation: MAX_BLEND_EQUATION
|
|
37834
38135
|
},
|
|
37835
38136
|
gridSize,
|
|
@@ -37846,7 +38147,7 @@ class GPUGridAggregator {
|
|
|
37846
38147
|
_renderToMaxMinTexture(opts) {
|
|
37847
38148
|
const {
|
|
37848
38149
|
id,
|
|
37849
|
-
parameters,
|
|
38150
|
+
parameters: parameters2,
|
|
37850
38151
|
gridSize,
|
|
37851
38152
|
minOrMaxFb,
|
|
37852
38153
|
combineMaxMin,
|
|
@@ -37866,7 +38167,7 @@ class GPUGridAggregator {
|
|
|
37866
38167
|
}, () => {
|
|
37867
38168
|
gl.clear(16384);
|
|
37868
38169
|
allAggregationModel.draw({
|
|
37869
|
-
parameters,
|
|
38170
|
+
parameters: parameters2,
|
|
37870
38171
|
uniforms: {
|
|
37871
38172
|
uSampler: framebuffers[id].texture,
|
|
37872
38173
|
gridSize,
|
|
@@ -37878,7 +38179,7 @@ class GPUGridAggregator {
|
|
|
37878
38179
|
_renderToWeightsTexture(opts) {
|
|
37879
38180
|
const {
|
|
37880
38181
|
id,
|
|
37881
|
-
parameters,
|
|
38182
|
+
parameters: parameters2,
|
|
37882
38183
|
moduleSettings,
|
|
37883
38184
|
uniforms,
|
|
37884
38185
|
gridSize,
|
|
@@ -37908,7 +38209,7 @@ class GPUGridAggregator {
|
|
|
37908
38209
|
};
|
|
37909
38210
|
gridAggregationModel.draw({
|
|
37910
38211
|
parameters: {
|
|
37911
|
-
...
|
|
38212
|
+
...parameters2,
|
|
37912
38213
|
blendEquation: equations[id]
|
|
37913
38214
|
},
|
|
37914
38215
|
moduleSettings,
|
|
@@ -54890,7 +55191,7 @@ class GLTFMaterialParser {
|
|
|
54890
55191
|
}
|
|
54891
55192
|
parseTexture(gltfTexture, name2) {
|
|
54892
55193
|
let define = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
54893
|
-
const
|
|
55194
|
+
const parameters2 = gltfTexture.texture && gltfTexture.texture.sampler && gltfTexture.texture.sampler.parameters || {};
|
|
54894
55195
|
const image = gltfTexture.texture.source.image;
|
|
54895
55196
|
let textureOptions;
|
|
54896
55197
|
let specialTextureParameters = {};
|
|
@@ -54907,7 +55208,7 @@ class GLTFMaterialParser {
|
|
|
54907
55208
|
const texture = new Texture2D(this.gl, {
|
|
54908
55209
|
id: gltfTexture.name || gltfTexture.id,
|
|
54909
55210
|
parameters: {
|
|
54910
|
-
...
|
|
55211
|
+
...parameters2,
|
|
54911
55212
|
...specialTextureParameters
|
|
54912
55213
|
},
|
|
54913
55214
|
pixelStore: {
|
|
@@ -58495,7 +58796,7 @@ class ScenegraphLayer extends Layer {
|
|
|
58495
58796
|
}
|
|
58496
58797
|
draw({
|
|
58497
58798
|
moduleParameters = null,
|
|
58498
|
-
parameters = {},
|
|
58799
|
+
parameters: parameters2 = {},
|
|
58499
58800
|
context
|
|
58500
58801
|
}) {
|
|
58501
58802
|
if (!this.state.scenegraph) return;
|
|
@@ -58520,7 +58821,7 @@ class ScenegraphLayer extends Layer {
|
|
|
58520
58821
|
model.model.setInstanceCount(numInstances);
|
|
58521
58822
|
model.updateModuleSettings(moduleParameters);
|
|
58522
58823
|
model.draw({
|
|
58523
|
-
parameters,
|
|
58824
|
+
parameters: parameters2,
|
|
58524
58825
|
uniforms: {
|
|
58525
58826
|
sizeScale,
|
|
58526
58827
|
opacity,
|
|
@@ -105273,22 +105574,22 @@ async function getDecoder(fileDirectory) {
|
|
|
105273
105574
|
const Decoder = await importFn();
|
|
105274
105575
|
return new Decoder(fileDirectory);
|
|
105275
105576
|
}
|
|
105276
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
105277
|
-
addDecoder(5, () => import("./lzw-
|
|
105577
|
+
addDecoder([void 0, 1], () => import("./raw-BKuuUvuj.js").then((m) => m.default));
|
|
105578
|
+
addDecoder(5, () => import("./lzw-BaMqhIgE.js").then((m) => m.default));
|
|
105278
105579
|
addDecoder(6, () => {
|
|
105279
105580
|
throw new Error("old style JPEG compression is not supported.");
|
|
105280
105581
|
});
|
|
105281
|
-
addDecoder(7, () => import("./jpeg-
|
|
105282
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
105283
|
-
addDecoder(32773, () => import("./packbits-
|
|
105582
|
+
addDecoder(7, () => import("./jpeg-DcD9Rdd5.js").then((m) => m.default));
|
|
105583
|
+
addDecoder([8, 32946], () => import("./deflate-B4KLsA1z.js").then((m) => m.default));
|
|
105584
|
+
addDecoder(32773, () => import("./packbits-CRM43Fiw.js").then((m) => m.default));
|
|
105284
105585
|
addDecoder(
|
|
105285
105586
|
34887,
|
|
105286
|
-
() => import("./lerc-
|
|
105587
|
+
() => import("./lerc-ssyon6X7.js").then(async (m) => {
|
|
105287
105588
|
await m.zstd.init();
|
|
105288
105589
|
return m;
|
|
105289
105590
|
}).then((m) => m.default)
|
|
105290
105591
|
);
|
|
105291
|
-
addDecoder(50001, () => import("./webimage-
|
|
105592
|
+
addDecoder(50001, () => import("./webimage-CiKLGrMh.js").then((m) => m.default));
|
|
105292
105593
|
function copyNewSize(array, width, height, samplesPerPixel = 1) {
|
|
105293
105594
|
return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
|
|
105294
105595
|
}
|
|
@@ -107191,8 +107492,8 @@ class HttpResponse extends BaseResponse {
|
|
|
107191
107492
|
class HttpClient extends BaseClient {
|
|
107192
107493
|
constructor(url) {
|
|
107193
107494
|
super(url);
|
|
107194
|
-
this.parsedUrl = fs$
|
|
107195
|
-
this.httpApi = this.parsedUrl.protocol === "http:" ? fs$
|
|
107495
|
+
this.parsedUrl = fs$r.parse(this.url);
|
|
107496
|
+
this.httpApi = this.parsedUrl.protocol === "http:" ? fs$r : fs$r;
|
|
107196
107497
|
}
|
|
107197
107498
|
constructRequest(headers, signal) {
|
|
107198
107499
|
return new Promise((resolve, reject) => {
|
|
@@ -107392,7 +107693,7 @@ function makeFileReaderSource(file) {
|
|
|
107392
107693
|
}
|
|
107393
107694
|
function closeAsync(fd) {
|
|
107394
107695
|
return new Promise((resolve, reject) => {
|
|
107395
|
-
fs$
|
|
107696
|
+
fs$r.close(fd, (err2) => {
|
|
107396
107697
|
if (err2) {
|
|
107397
107698
|
reject(err2);
|
|
107398
107699
|
} else {
|
|
@@ -107403,7 +107704,7 @@ function closeAsync(fd) {
|
|
|
107403
107704
|
}
|
|
107404
107705
|
function openAsync(path, flags, mode = void 0) {
|
|
107405
107706
|
return new Promise((resolve, reject) => {
|
|
107406
|
-
fs$
|
|
107707
|
+
fs$r.open(path, flags, mode, (err2, fd) => {
|
|
107407
107708
|
if (err2) {
|
|
107408
107709
|
reject(err2);
|
|
107409
107710
|
} else {
|
|
@@ -107414,7 +107715,7 @@ function openAsync(path, flags, mode = void 0) {
|
|
|
107414
107715
|
}
|
|
107415
107716
|
function readAsync(...args) {
|
|
107416
107717
|
return new Promise((resolve, reject) => {
|
|
107417
|
-
fs$
|
|
107718
|
+
fs$r.read(...args, (err2, bytesRead, buffer2) => {
|
|
107418
107719
|
if (err2) {
|
|
107419
107720
|
reject(err2);
|
|
107420
107721
|
} else {
|
|
@@ -120092,7 +120393,7 @@ const XRLayer = class extends Layer {
|
|
|
120092
120393
|
*/
|
|
120093
120394
|
getShaders() {
|
|
120094
120395
|
const { dtype, interpolation } = this.props;
|
|
120095
|
-
const { shaderModule, sampler } = getRenderingAttrs$1(
|
|
120396
|
+
const { shaderModule: shaderModule2, sampler } = getRenderingAttrs$1(
|
|
120096
120397
|
dtype,
|
|
120097
120398
|
this.context.gl,
|
|
120098
120399
|
interpolation
|
|
@@ -120105,7 +120406,7 @@ const XRLayer = class extends Layer {
|
|
|
120105
120406
|
`;
|
|
120106
120407
|
}
|
|
120107
120408
|
return super.getShaders({
|
|
120108
|
-
...
|
|
120409
|
+
...shaderModule2,
|
|
120109
120410
|
defines: {
|
|
120110
120411
|
SAMPLER_TYPE: sampler
|
|
120111
120412
|
},
|
|
@@ -126186,6 +126487,7 @@ const deck = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
126186
126487
|
__proto__: null,
|
|
126187
126488
|
COORDINATE_SYSTEM,
|
|
126188
126489
|
ContourLayer,
|
|
126490
|
+
DataFilterExtension,
|
|
126189
126491
|
DeckGL,
|
|
126190
126492
|
LineLayer,
|
|
126191
126493
|
OrbitView,
|