@xeokit/xeokit-sdk 2.4.0-alpha-78 → 2.4.0-alpha-79
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/xeokit-sdk.cjs.js +144 -225
- package/dist/xeokit-sdk.es.js +144 -225
- package/dist/xeokit-sdk.es5.js +76 -84
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +5 -5
- package/package.json +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -11514,7 +11514,7 @@ class Annotation extends Marker {
|
|
|
11514
11514
|
}
|
|
11515
11515
|
|
|
11516
11516
|
const tempVec3a$D = math.vec3();
|
|
11517
|
-
const tempVec3b$
|
|
11517
|
+
const tempVec3b$q = math.vec3();
|
|
11518
11518
|
const tempVec3c$m = math.vec3();
|
|
11519
11519
|
|
|
11520
11520
|
/**
|
|
@@ -12000,7 +12000,7 @@ class AnnotationsPlugin extends Plugin {
|
|
|
12000
12000
|
this.error("Param 'pickResult' does not have both worldPos and worldNormal");
|
|
12001
12001
|
} else {
|
|
12002
12002
|
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$D);
|
|
12003
|
-
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$
|
|
12003
|
+
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$q);
|
|
12004
12004
|
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$m);
|
|
12005
12005
|
worldPos = offsetWorldPos;
|
|
12006
12006
|
entity = pickResult.entity;
|
|
@@ -19885,14 +19885,14 @@ class CustomProjection extends Component {
|
|
|
19885
19885
|
}
|
|
19886
19886
|
|
|
19887
19887
|
const tempVec3$7 = math.vec3();
|
|
19888
|
-
const tempVec3b$
|
|
19888
|
+
const tempVec3b$p = math.vec3();
|
|
19889
19889
|
const tempVec3c$l = math.vec3();
|
|
19890
19890
|
const tempVec3d$f = math.vec3();
|
|
19891
19891
|
const tempVec3e$8 = math.vec3();
|
|
19892
19892
|
const tempVec3f$2 = math.vec3();
|
|
19893
19893
|
const tempVec4a$d = math.vec4();
|
|
19894
19894
|
const tempVec4b$c = math.vec4();
|
|
19895
|
-
const tempVec4c$
|
|
19895
|
+
const tempVec4c$2 = math.vec4();
|
|
19896
19896
|
const tempMat = math.mat4();
|
|
19897
19897
|
const tempMatb = math.mat4();
|
|
19898
19898
|
const eyeLookVec = math.vec3();
|
|
@@ -20198,7 +20198,7 @@ class Camera extends Component {
|
|
|
20198
20198
|
orbitYaw(angleInc) {
|
|
20199
20199
|
let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20200
20200
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20201
|
-
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$
|
|
20201
|
+
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$p);
|
|
20202
20202
|
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$l); // Set eye position as 'look' plus 'eye' vector
|
|
20203
20203
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f); // Rotate 'up' vector
|
|
20204
20204
|
}
|
|
@@ -20216,7 +20216,7 @@ class Camera extends Component {
|
|
|
20216
20216
|
}
|
|
20217
20217
|
}
|
|
20218
20218
|
let eye2 = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20219
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$
|
|
20219
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
|
|
20220
20220
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20221
20221
|
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$f);
|
|
20222
20222
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3e$8);
|
|
@@ -20231,7 +20231,7 @@ class Camera extends Component {
|
|
|
20231
20231
|
yaw(angleInc) {
|
|
20232
20232
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20233
20233
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20234
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3b$
|
|
20234
|
+
look2 = math.transformPoint3(tempMat, look2, tempVec3b$p);
|
|
20235
20235
|
this.look = math.addVec3(look2, this._eye, tempVec3c$l);
|
|
20236
20236
|
if (this._gimbalLock) {
|
|
20237
20237
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f);
|
|
@@ -20251,7 +20251,7 @@ class Camera extends Component {
|
|
|
20251
20251
|
}
|
|
20252
20252
|
}
|
|
20253
20253
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20254
|
-
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$
|
|
20254
|
+
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
|
|
20255
20255
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20256
20256
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
|
|
20257
20257
|
look2 = math.transformPoint3(tempMat, look2, tempVec3d$f);
|
|
@@ -20268,7 +20268,7 @@ class Camera extends Component {
|
|
|
20268
20268
|
const vec = [0, 0, 0];
|
|
20269
20269
|
let v;
|
|
20270
20270
|
if (pan[0] !== 0) {
|
|
20271
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$
|
|
20271
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$p));
|
|
20272
20272
|
v = math.mulVec3Scalar(left, pan[0]);
|
|
20273
20273
|
vec[0] += v[0];
|
|
20274
20274
|
vec[1] += v[1];
|
|
@@ -20297,7 +20297,7 @@ class Camera extends Component {
|
|
|
20297
20297
|
*/
|
|
20298
20298
|
zoom(delta) {
|
|
20299
20299
|
const vec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20300
|
-
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$
|
|
20300
|
+
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$p));
|
|
20301
20301
|
const newLenLook = Math.abs(lenLook + delta);
|
|
20302
20302
|
if (newLenLook < 0.5) {
|
|
20303
20303
|
return;
|
|
@@ -20758,7 +20758,7 @@ class Camera extends Component {
|
|
|
20758
20758
|
projectWorldPos(worldPos) {
|
|
20759
20759
|
const _worldPos = tempVec4a$d;
|
|
20760
20760
|
const viewPos = tempVec4b$c;
|
|
20761
|
-
const screenPos = tempVec4c$
|
|
20761
|
+
const screenPos = tempVec4c$2;
|
|
20762
20762
|
_worldPos[0] = worldPos[0];
|
|
20763
20763
|
_worldPos[1] = worldPos[1];
|
|
20764
20764
|
_worldPos[2] = worldPos[2];
|
|
@@ -25967,7 +25967,7 @@ class LinesMaterial extends Material {
|
|
|
25967
25967
|
}
|
|
25968
25968
|
|
|
25969
25969
|
const tempVec3a$B = math.vec3();
|
|
25970
|
-
const tempVec3b$
|
|
25970
|
+
const tempVec3b$o = math.vec3();
|
|
25971
25971
|
const tempMat4a$f = math.mat4();
|
|
25972
25972
|
|
|
25973
25973
|
/**
|
|
@@ -26045,7 +26045,7 @@ function frustumIntersectsAABB3(frustum, aabb) {
|
|
|
26045
26045
|
let ret = Frustum.INSIDE;
|
|
26046
26046
|
|
|
26047
26047
|
const min = tempVec3a$B;
|
|
26048
|
-
const max = tempVec3b$
|
|
26048
|
+
const max = tempVec3b$o;
|
|
26049
26049
|
|
|
26050
26050
|
min[0] = aabb[0];
|
|
26051
26051
|
min[1] = aabb[1];
|
|
@@ -48426,7 +48426,7 @@ class LineSet extends Component {
|
|
|
48426
48426
|
|
|
48427
48427
|
const tempVec3$5 = math.vec3();
|
|
48428
48428
|
const tempVec3a$u = math.vec3();
|
|
48429
|
-
const tempVec3b$
|
|
48429
|
+
const tempVec3b$n = math.vec3();
|
|
48430
48430
|
const tempVec3c$k = math.vec3();
|
|
48431
48431
|
|
|
48432
48432
|
/**
|
|
@@ -49107,7 +49107,7 @@ class BCFViewpointsPlugin extends Plugin {
|
|
|
49107
49107
|
const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
|
|
49108
49108
|
const bitmap_data = e.bitmap_data; // base64
|
|
49109
49109
|
let location = xyzObjectToArray(e.location, tempVec3a$u);
|
|
49110
|
-
let normal = xyzObjectToArray(e.normal, tempVec3b$
|
|
49110
|
+
let normal = xyzObjectToArray(e.normal, tempVec3b$n);
|
|
49111
49111
|
let up = xyzObjectToArray(e.up, tempVec3c$k);
|
|
49112
49112
|
let height = e.height || 1;
|
|
49113
49113
|
if (!bitmap_type) {
|
|
@@ -52183,7 +52183,7 @@ CameraPathAnimation.PLAYING = 2;
|
|
|
52183
52183
|
CameraPathAnimation.PLAYING_TO = 3;
|
|
52184
52184
|
|
|
52185
52185
|
const tempVec3$3 = math.vec3();
|
|
52186
|
-
const tempVec3b$
|
|
52186
|
+
const tempVec3b$m = math.vec3();
|
|
52187
52187
|
math.vec3();
|
|
52188
52188
|
const zeroVec$2 = math.vec3([0, -1, 0]);
|
|
52189
52189
|
const tempQuat = math.vec4([0, 0, 0, 1]);
|
|
@@ -52611,7 +52611,7 @@ class ImagePlane extends Component {
|
|
|
52611
52611
|
const dist = -math.dotVec3(negDir, tempVec3$3);
|
|
52612
52612
|
|
|
52613
52613
|
math.normalizeVec3(negDir);
|
|
52614
|
-
math.mulVec3Scalar(negDir, dist, tempVec3b$
|
|
52614
|
+
math.mulVec3Scalar(negDir, dist, tempVec3b$m);
|
|
52615
52615
|
math.vec3PairToQuaternion(zeroVec$2, dir, tempQuat);
|
|
52616
52616
|
|
|
52617
52617
|
this._node.quaternion = tempQuat;
|
|
@@ -55330,7 +55330,7 @@ const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
|
|
|
55330
55330
|
|
|
55331
55331
|
const tempVec4 = math.vec4();
|
|
55332
55332
|
const tempVec3a$s = math.vec3();
|
|
55333
|
-
|
|
55333
|
+
math.vec3();
|
|
55334
55334
|
const tempVec3c$j = math.vec3();
|
|
55335
55335
|
const tempMat4a$e = math.mat4();
|
|
55336
55336
|
|
|
@@ -55774,22 +55774,24 @@ class VBOSceneModelRenderer {
|
|
|
55774
55774
|
|
|
55775
55775
|
this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
|
|
55776
55776
|
|
|
55777
|
-
|
|
55778
|
-
|
|
55779
|
-
|
|
55777
|
+
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
55778
|
+
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
55779
|
+
if (gotOrigin || gotPosition) {
|
|
55780
|
+
const rtcOrigin = tempVec3a$s;
|
|
55781
|
+
if (gotOrigin) {
|
|
55780
55782
|
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$j);
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55783
|
+
rtcOrigin[0] = rotatedOrigin[0];
|
|
55784
|
+
rtcOrigin[1] = rotatedOrigin[1];
|
|
55785
|
+
rtcOrigin[2] = rotatedOrigin[2];
|
|
55784
55786
|
} else {
|
|
55785
|
-
|
|
55786
|
-
|
|
55787
|
-
|
|
55788
|
-
}
|
|
55789
|
-
|
|
55790
|
-
|
|
55791
|
-
|
|
55792
|
-
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix,
|
|
55787
|
+
rtcOrigin[0] = 0;
|
|
55788
|
+
rtcOrigin[1] = 0;
|
|
55789
|
+
rtcOrigin[2] = 0;
|
|
55790
|
+
}
|
|
55791
|
+
rtcOrigin[0] += position[0];
|
|
55792
|
+
rtcOrigin[1] += position[1];
|
|
55793
|
+
rtcOrigin[2] += position[2];
|
|
55794
|
+
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$e), offset += mat4Size);
|
|
55793
55795
|
} else {
|
|
55794
55796
|
this._matricesUniformBlockBufferData.set(viewMatrix, offset += mat4Size);
|
|
55795
55797
|
}
|
|
@@ -59357,7 +59359,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59357
59359
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
59358
59360
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
59359
59361
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
59360
|
-
|
|
59362
|
+
{
|
|
59361
59363
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix?
|
|
59362
59364
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
59363
59365
|
}
|
|
@@ -59427,7 +59429,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59427
59429
|
this._aPosition = program.getAttribute("position");
|
|
59428
59430
|
this._aOffset = program.getAttribute("offset");
|
|
59429
59431
|
this._aFlags = program.getAttribute("flags");
|
|
59430
|
-
|
|
59432
|
+
{
|
|
59431
59433
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
59432
59434
|
}
|
|
59433
59435
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -59482,7 +59484,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59482
59484
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
59483
59485
|
src.push("uniform vec2 snapVectorA;");
|
|
59484
59486
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
59485
|
-
|
|
59487
|
+
{
|
|
59486
59488
|
src.push("uniform float logDepthBufFC;");
|
|
59487
59489
|
src.push("out float vFragDepth;");
|
|
59488
59490
|
src.push("out float isPerspective;");
|
|
@@ -59523,7 +59525,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59523
59525
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
59524
59526
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
59525
59527
|
src.push("clipPos.xyzw *= tmp;");
|
|
59526
|
-
|
|
59528
|
+
{
|
|
59527
59529
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
59528
59530
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59529
59531
|
}
|
|
@@ -59547,7 +59549,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59547
59549
|
src.push("precision mediump float;");
|
|
59548
59550
|
src.push("precision mediump int;");
|
|
59549
59551
|
src.push("#endif");
|
|
59550
|
-
|
|
59552
|
+
{
|
|
59551
59553
|
src.push("in float isPerspective;");
|
|
59552
59554
|
src.push("uniform float logDepthBufFC;");
|
|
59553
59555
|
src.push("in float vFragDepth;");
|
|
@@ -59578,7 +59580,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59578
59580
|
src.push(" if (dist > 0.0) { discard; }");
|
|
59579
59581
|
src.push(" }");
|
|
59580
59582
|
}
|
|
59581
|
-
|
|
59583
|
+
{
|
|
59582
59584
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
59583
59585
|
}
|
|
59584
59586
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
@@ -59702,7 +59704,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59702
59704
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
59703
59705
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
59704
59706
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
59705
|
-
|
|
59707
|
+
{
|
|
59706
59708
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix?
|
|
59707
59709
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
59708
59710
|
}
|
|
@@ -59783,7 +59785,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59783
59785
|
this._aOffset = program.getAttribute("offset");
|
|
59784
59786
|
this._aFlags = program.getAttribute("flags");
|
|
59785
59787
|
|
|
59786
|
-
|
|
59788
|
+
{
|
|
59787
59789
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
59788
59790
|
}
|
|
59789
59791
|
|
|
@@ -59839,7 +59841,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59839
59841
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
59840
59842
|
src.push("uniform vec2 snapVectorA;");
|
|
59841
59843
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
59842
|
-
|
|
59844
|
+
{
|
|
59843
59845
|
src.push("uniform float logDepthBufFC;");
|
|
59844
59846
|
src.push("out float vFragDepth;");
|
|
59845
59847
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -59881,7 +59883,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59881
59883
|
src.push("clipPos.xyzw /= tmp;");
|
|
59882
59884
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
59883
59885
|
src.push("clipPos.xyzw *= tmp;");
|
|
59884
|
-
|
|
59886
|
+
{
|
|
59885
59887
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
59886
59888
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59887
59889
|
}
|
|
@@ -59906,7 +59908,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59906
59908
|
src.push("precision mediump float;");
|
|
59907
59909
|
src.push("precision mediump int;");
|
|
59908
59910
|
src.push("#endif");
|
|
59909
|
-
|
|
59911
|
+
{
|
|
59910
59912
|
src.push("in float isPerspective;");
|
|
59911
59913
|
src.push("uniform float logDepthBufFC;");
|
|
59912
59914
|
src.push("in float vFragDepth;");
|
|
@@ -59937,7 +59939,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59937
59939
|
src.push(" if (dist > 0.0) { discard; }");
|
|
59938
59940
|
src.push(" }");
|
|
59939
59941
|
}
|
|
59940
|
-
|
|
59942
|
+
{
|
|
59941
59943
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
59942
59944
|
}
|
|
59943
59945
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
@@ -60028,8 +60030,8 @@ const tempMat4$1 = math.mat4();
|
|
|
60028
60030
|
const tempMat4b = math.mat4();
|
|
60029
60031
|
const tempVec4a$c = math.vec4([0, 0, 0, 1]);
|
|
60030
60032
|
const tempVec4b$b = math.vec4([0, 0, 0, 1]);
|
|
60031
|
-
|
|
60032
|
-
|
|
60033
|
+
math.vec4([0, 0, 0, 1]);
|
|
60034
|
+
math.OBB3();
|
|
60033
60035
|
|
|
60034
60036
|
const tempVec3a$p = math.vec3();
|
|
60035
60037
|
const tempVec3b$j = math.vec3();
|
|
@@ -60102,7 +60104,7 @@ class TrianglesBatchingLayer {
|
|
|
60102
60104
|
flagsBuf: null,
|
|
60103
60105
|
indicesBuf: null,
|
|
60104
60106
|
edgeIndicesBuf: null,
|
|
60105
|
-
positionsDecodeMatrix:null,
|
|
60107
|
+
positionsDecodeMatrix: null,
|
|
60106
60108
|
uvDecodeMatrix: null,
|
|
60107
60109
|
textureSet: cfg.textureSet,
|
|
60108
60110
|
pbrSupported: false // Set in #finalize if we have enough to support quality rendering
|
|
@@ -60188,7 +60190,6 @@ class TrianglesBatchingLayer {
|
|
|
60188
60190
|
* @param cfg.roughness Roughness factor [0..255]
|
|
60189
60191
|
* @param cfg.opacity Opacity [0..255]
|
|
60190
60192
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
60191
|
-
* @param [cfg.sceneModelMatrix] Flat float 4x4 matrix
|
|
60192
60193
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
60193
60194
|
* @param cfg.pickColor Quantized pick color
|
|
60194
60195
|
* @returns {number} Portion ID
|
|
@@ -60214,7 +60215,6 @@ class TrianglesBatchingLayer {
|
|
|
60214
60215
|
const roughness = cfg.roughness;
|
|
60215
60216
|
const opacity = cfg.opacity;
|
|
60216
60217
|
const meshMatrix = cfg.meshMatrix;
|
|
60217
|
-
const sceneModelMatrix = cfg.sceneModelMatrix;
|
|
60218
60218
|
const worldAABB = cfg.worldAABB;
|
|
60219
60219
|
const pickColor = cfg.pickColor;
|
|
60220
60220
|
|
|
@@ -60249,12 +60249,6 @@ class TrianglesBatchingLayer {
|
|
|
60249
60249
|
worldAABB[4] = max[1];
|
|
60250
60250
|
worldAABB[5] = max[2];
|
|
60251
60251
|
|
|
60252
|
-
if (sceneModelMatrix) {
|
|
60253
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3$2);
|
|
60254
|
-
math.transformOBB3(sceneModelMatrix, tempOBB3$2);
|
|
60255
|
-
math.OBB3ToAABB3(tempOBB3$2, worldAABB);
|
|
60256
|
-
}
|
|
60257
|
-
|
|
60258
60252
|
} else {
|
|
60259
60253
|
|
|
60260
60254
|
if (!positions) {
|
|
@@ -60286,13 +60280,7 @@ class TrianglesBatchingLayer {
|
|
|
60286
60280
|
buffer.positions[i + 2] = tempVec4b$b[2];
|
|
60287
60281
|
|
|
60288
60282
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$b);
|
|
60289
|
-
|
|
60290
|
-
if (sceneModelMatrix) {
|
|
60291
|
-
math.transformPoint4(sceneModelMatrix, tempVec4b$b, tempVec4c$8);
|
|
60292
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$8);
|
|
60293
|
-
} else {
|
|
60294
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60295
|
-
}
|
|
60283
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60296
60284
|
}
|
|
60297
60285
|
|
|
60298
60286
|
} else {
|
|
@@ -60304,13 +60292,7 @@ class TrianglesBatchingLayer {
|
|
|
60304
60292
|
tempVec4a$c[2] = buffer.positions[i + 2];
|
|
60305
60293
|
|
|
60306
60294
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$c);
|
|
60307
|
-
|
|
60308
|
-
if (sceneModelMatrix) {
|
|
60309
|
-
math.transformPoint4(sceneModelMatrix, tempVec4a$c, tempVec4b$b);
|
|
60310
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60311
|
-
} else {
|
|
60312
|
-
math.expandAABB3Point3(worldAABB, tempVec4a$c);
|
|
60313
|
-
}
|
|
60295
|
+
math.expandAABB3Point3(worldAABB, tempVec4a$c);
|
|
60314
60296
|
}
|
|
60315
60297
|
}
|
|
60316
60298
|
}
|
|
@@ -60940,7 +60922,7 @@ class TrianglesBatchingLayer {
|
|
|
60940
60922
|
offset = portion.indicesBaseIndex;
|
|
60941
60923
|
}
|
|
60942
60924
|
|
|
60943
|
-
return {
|
|
60925
|
+
return {count, offset}
|
|
60944
60926
|
}
|
|
60945
60927
|
|
|
60946
60928
|
// ---------------------- COLOR RENDERING -----------------------------------
|
|
@@ -64499,7 +64481,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64499
64481
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
64500
64482
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
64501
64483
|
|
|
64502
|
-
|
|
64484
|
+
{
|
|
64503
64485
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
64504
64486
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
64505
64487
|
}
|
|
@@ -64594,7 +64576,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64594
64576
|
this._aModelMatrixCol0 = program.getAttribute("modelMatrixCol0");
|
|
64595
64577
|
this._aModelMatrixCol1 = program.getAttribute("modelMatrixCol1");
|
|
64596
64578
|
this._aModelMatrixCol2 = program.getAttribute("modelMatrixCol2");
|
|
64597
|
-
|
|
64579
|
+
{
|
|
64598
64580
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
64599
64581
|
}
|
|
64600
64582
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -64653,7 +64635,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64653
64635
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
64654
64636
|
src.push("uniform vec2 snapVectorA;");
|
|
64655
64637
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
64656
|
-
|
|
64638
|
+
{
|
|
64657
64639
|
src.push("uniform float logDepthBufFC;");
|
|
64658
64640
|
src.push("out float vFragDepth;");
|
|
64659
64641
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -64695,7 +64677,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64695
64677
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
64696
64678
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
64697
64679
|
src.push("clipPos.xyzw *= tmp;");
|
|
64698
|
-
|
|
64680
|
+
{
|
|
64699
64681
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
64700
64682
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
64701
64683
|
}
|
|
@@ -64719,7 +64701,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64719
64701
|
src.push("precision mediump float;");
|
|
64720
64702
|
src.push("precision mediump int;");
|
|
64721
64703
|
src.push("#endif");
|
|
64722
|
-
|
|
64704
|
+
{
|
|
64723
64705
|
src.push("in float isPerspective;");
|
|
64724
64706
|
src.push("uniform float logDepthBufFC;");
|
|
64725
64707
|
src.push("in float vFragDepth;");
|
|
@@ -64750,7 +64732,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64750
64732
|
src.push("if (dist > 0.0) { discard; }");
|
|
64751
64733
|
src.push("}");
|
|
64752
64734
|
}
|
|
64753
|
-
|
|
64735
|
+
{
|
|
64754
64736
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
64755
64737
|
}
|
|
64756
64738
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
@@ -64873,7 +64855,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64873
64855
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
64874
64856
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
64875
64857
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
64876
|
-
|
|
64858
|
+
{
|
|
64877
64859
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix
|
|
64878
64860
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
64879
64861
|
}
|
|
@@ -64961,7 +64943,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64961
64943
|
this._aModelMatrixCol0 = program.getAttribute("modelMatrixCol0");
|
|
64962
64944
|
this._aModelMatrixCol1 = program.getAttribute("modelMatrixCol1");
|
|
64963
64945
|
this._aModelMatrixCol2 = program.getAttribute("modelMatrixCol2");
|
|
64964
|
-
|
|
64946
|
+
{
|
|
64965
64947
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
64966
64948
|
}
|
|
64967
64949
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -65020,7 +65002,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65020
65002
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
65021
65003
|
src.push("uniform vec2 snapVectorA;");
|
|
65022
65004
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
65023
|
-
|
|
65005
|
+
{
|
|
65024
65006
|
src.push("uniform float logDepthBufFC;");
|
|
65025
65007
|
src.push("out float vFragDepth;");
|
|
65026
65008
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -65061,7 +65043,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65061
65043
|
src.push("clipPos.xyzw /= tmp;");
|
|
65062
65044
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
65063
65045
|
src.push("clipPos.xyzw *= tmp;");
|
|
65064
|
-
|
|
65046
|
+
{
|
|
65065
65047
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
65066
65048
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
65067
65049
|
}
|
|
@@ -65086,7 +65068,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65086
65068
|
src.push("precision mediump float;");
|
|
65087
65069
|
src.push("precision mediump int;");
|
|
65088
65070
|
src.push("#endif");
|
|
65089
|
-
|
|
65071
|
+
{
|
|
65090
65072
|
src.push("in float isPerspective;");
|
|
65091
65073
|
src.push("uniform float logDepthBufFC;");
|
|
65092
65074
|
src.push("in float vFragDepth;");
|
|
@@ -65117,7 +65099,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65117
65099
|
src.push("if (dist > 0.0) { discard; }");
|
|
65118
65100
|
src.push("}");
|
|
65119
65101
|
}
|
|
65120
|
-
|
|
65102
|
+
{
|
|
65121
65103
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65122
65104
|
}
|
|
65123
65105
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
@@ -65208,7 +65190,7 @@ const tempUint8Vec4$2 = new Uint8Array(4);
|
|
|
65208
65190
|
const tempFloat32$2 = new Float32Array(1);
|
|
65209
65191
|
const tempVec4a$b = math.vec4([0, 0, 0, 1]);
|
|
65210
65192
|
const tempVec4b$a = math.vec4([0, 0, 0, 1]);
|
|
65211
|
-
|
|
65193
|
+
math.vec4([0, 0, 0, 1]);
|
|
65212
65194
|
const tempVec3fa$2 = new Float32Array(3);
|
|
65213
65195
|
|
|
65214
65196
|
const tempVec3a$m = math.vec3();
|
|
@@ -65351,7 +65333,6 @@ class TrianglesInstancingLayer {
|
|
|
65351
65333
|
* @param cfg.roughness Roughness factor [0..255]
|
|
65352
65334
|
* @param cfg.opacity Opacity [0..255].
|
|
65353
65335
|
* @param cfg.meshMatrix Flat float 4x4 matrix.
|
|
65354
|
-
* @param [cfg.sceneModelMatrix] Flat float 4x4 matrix.
|
|
65355
65336
|
* @param [cfg.worldMatrix] Flat float 4x4 matrix.
|
|
65356
65337
|
* @param cfg.worldAABB Flat float AABB.
|
|
65357
65338
|
* @param cfg.pickColor Quantized pick color
|
|
@@ -65364,7 +65345,6 @@ class TrianglesInstancingLayer {
|
|
|
65364
65345
|
const roughness = cfg.roughness;
|
|
65365
65346
|
const opacity = cfg.opacity !== null && cfg.opacity !== undefined ? cfg.opacity : 255;
|
|
65366
65347
|
const meshMatrix = cfg.meshMatrix;
|
|
65367
|
-
const sceneModelMatrix = cfg.sceneModelMatrix;
|
|
65368
65348
|
const worldAABB = cfg.aabb;
|
|
65369
65349
|
const pickColor = cfg.pickColor;
|
|
65370
65350
|
|
|
@@ -65448,12 +65428,7 @@ class TrianglesInstancingLayer {
|
|
|
65448
65428
|
tempVec4a$b[2] = positions[i + 2];
|
|
65449
65429
|
math.transformPoint4(positionsDecodeMatrix, tempVec4a$b, tempVec4b$a);
|
|
65450
65430
|
math.transformPoint4(meshMatrix, tempVec4b$a, tempVec4a$b);
|
|
65451
|
-
if (sceneModelMatrix) {
|
|
65452
|
-
math.transformPoint4(sceneModelMatrix, tempVec4a$b, tempVec4c$7);
|
|
65453
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$7);
|
|
65454
|
-
} else {
|
|
65455
65431
|
math.expandAABB3Point3(worldAABB, tempVec4a$b);
|
|
65456
|
-
}
|
|
65457
65432
|
}
|
|
65458
65433
|
|
|
65459
65434
|
if (this._state.origin) {
|
|
@@ -66693,8 +66668,8 @@ class LinesBatchingBuffer {
|
|
|
66693
66668
|
|
|
66694
66669
|
const tempVec4a$a = math.vec4([0, 0, 0, 1]);
|
|
66695
66670
|
const tempVec4b$9 = math.vec4([0, 0, 0, 1]);
|
|
66696
|
-
|
|
66697
|
-
|
|
66671
|
+
math.vec4([0, 0, 0, 1]);
|
|
66672
|
+
math.OBB3();
|
|
66698
66673
|
|
|
66699
66674
|
/**
|
|
66700
66675
|
* @private
|
|
@@ -66795,7 +66770,6 @@ class LinesBatchingLayer {
|
|
|
66795
66770
|
* @param cfg.color Quantized RGB color [0..255,0..255,0..255,0..255]
|
|
66796
66771
|
* @param cfg.opacity Opacity [0..255]
|
|
66797
66772
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
66798
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix
|
|
66799
66773
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
66800
66774
|
* @param cfg.pickColor Quantized pick color
|
|
66801
66775
|
* @returns {number} Portion ID
|
|
@@ -66812,7 +66786,6 @@ class LinesBatchingLayer {
|
|
|
66812
66786
|
const color = cfg.color;
|
|
66813
66787
|
const opacity = cfg.opacity;
|
|
66814
66788
|
const meshMatrix = cfg.meshMatrix;
|
|
66815
|
-
const worldMatrix = cfg.worldMatrix;
|
|
66816
66789
|
const worldAABB = cfg.worldAABB;
|
|
66817
66790
|
cfg.pickColor;
|
|
66818
66791
|
|
|
@@ -66847,12 +66820,6 @@ class LinesBatchingLayer {
|
|
|
66847
66820
|
worldAABB[4] = max[1];
|
|
66848
66821
|
worldAABB[5] = max[2];
|
|
66849
66822
|
|
|
66850
|
-
if (worldMatrix) {
|
|
66851
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3$1);
|
|
66852
|
-
math.transformOBB3(worldMatrix, tempOBB3$1);
|
|
66853
|
-
math.OBB3ToAABB3(tempOBB3$1, worldAABB);
|
|
66854
|
-
}
|
|
66855
|
-
|
|
66856
66823
|
} else {
|
|
66857
66824
|
|
|
66858
66825
|
if (!positions) {
|
|
@@ -66884,13 +66851,7 @@ class LinesBatchingLayer {
|
|
|
66884
66851
|
buffer.positions[i + 2] = tempVec4b$9[2];
|
|
66885
66852
|
|
|
66886
66853
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$9);
|
|
66887
|
-
|
|
66888
|
-
if (worldMatrix) {
|
|
66889
|
-
math.transformPoint4(worldMatrix, tempVec4b$9, tempVec4c$6);
|
|
66890
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$6);
|
|
66891
|
-
} else {
|
|
66892
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66893
|
-
}
|
|
66854
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66894
66855
|
}
|
|
66895
66856
|
|
|
66896
66857
|
} else {
|
|
@@ -66902,13 +66863,7 @@ class LinesBatchingLayer {
|
|
|
66902
66863
|
tempVec4a$a[2] = buffer.positions[i + 2];
|
|
66903
66864
|
|
|
66904
66865
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$a);
|
|
66905
|
-
|
|
66906
|
-
if (worldMatrix) {
|
|
66907
|
-
math.transformPoint4(worldMatrix, tempVec4a$a, tempVec4b$9);
|
|
66908
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66909
|
-
} else {
|
|
66910
|
-
math.expandAABB3Point3(worldAABB, tempVec4a$a);
|
|
66911
|
-
}
|
|
66866
|
+
math.expandAABB3Point3(worldAABB, tempVec4a$a);
|
|
66912
66867
|
}
|
|
66913
66868
|
}
|
|
66914
66869
|
}
|
|
@@ -67787,7 +67742,7 @@ const tempFloat32$1 = new Float32Array(1);
|
|
|
67787
67742
|
|
|
67788
67743
|
const tempVec4a$9 = math.vec4([0, 0, 0, 1]);
|
|
67789
67744
|
const tempVec4b$8 = math.vec4([0, 0, 0, 1]);
|
|
67790
|
-
|
|
67745
|
+
math.vec4([0, 0, 0, 1]);
|
|
67791
67746
|
|
|
67792
67747
|
const tempVec3fa$1 = new Float32Array(3);
|
|
67793
67748
|
|
|
@@ -67899,7 +67854,6 @@ class LinesInstancingLayer {
|
|
|
67899
67854
|
* @param cfg.color Color [0..255,0..255,0..255]
|
|
67900
67855
|
* @param cfg.opacity Opacity [0..255].
|
|
67901
67856
|
* @param cfg.meshMatrix Flat float 4x4 matrix.
|
|
67902
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix.
|
|
67903
67857
|
* @param cfg.aabb Flat float AABB.
|
|
67904
67858
|
* @returns {number} Portion ID.
|
|
67905
67859
|
*/
|
|
@@ -67908,7 +67862,6 @@ class LinesInstancingLayer {
|
|
|
67908
67862
|
const color = cfg.color;
|
|
67909
67863
|
const opacity = cfg.opacity;
|
|
67910
67864
|
const meshMatrix = cfg.meshMatrix;
|
|
67911
|
-
const worldMatrix = cfg.worldMatrix;
|
|
67912
67865
|
const worldAABB = cfg.aabb;
|
|
67913
67866
|
|
|
67914
67867
|
if (this._finalized) {
|
|
@@ -67958,12 +67911,7 @@ class LinesInstancingLayer {
|
|
|
67958
67911
|
tempVec4a$9[1] = obb[i + 1];
|
|
67959
67912
|
tempVec4a$9[2] = obb[i + 2];
|
|
67960
67913
|
math.transformPoint4(meshMatrix, tempVec4a$9, tempVec4b$8);
|
|
67961
|
-
|
|
67962
|
-
math.transformPoint4(worldMatrix, tempVec4b$8, tempVec4c$5);
|
|
67963
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$5);
|
|
67964
|
-
} else {
|
|
67965
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$8);
|
|
67966
|
-
}
|
|
67914
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$8);
|
|
67967
67915
|
}
|
|
67968
67916
|
|
|
67969
67917
|
if (this._state.origin) {
|
|
@@ -69301,8 +69249,8 @@ const tempVec3a$l = math.vec4();
|
|
|
69301
69249
|
const tempVec3b$f = math.vec4();
|
|
69302
69250
|
const tempVec4a$8 = math.vec4([0, 0, 0, 1]);
|
|
69303
69251
|
const tempVec4b$7 = math.vec4([0, 0, 0, 1]);
|
|
69304
|
-
|
|
69305
|
-
|
|
69252
|
+
math.vec4([0, 0, 0, 1]);
|
|
69253
|
+
math.OBB3();
|
|
69306
69254
|
|
|
69307
69255
|
/**
|
|
69308
69256
|
* @private
|
|
@@ -69410,7 +69358,6 @@ class PointsBatchingLayer {
|
|
|
69410
69358
|
* @param [cfg.colors] Flat float colors array.
|
|
69411
69359
|
* @param cfg.color Float RGB color [0..1,0..1,0..1]
|
|
69412
69360
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
69413
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix
|
|
69414
69361
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
69415
69362
|
* @param cfg.pickColor Quantized pick color
|
|
69416
69363
|
* @returns {number} Portion ID
|
|
@@ -69427,7 +69374,6 @@ class PointsBatchingLayer {
|
|
|
69427
69374
|
const colorsCompressed = cfg.colorsCompressed;
|
|
69428
69375
|
const colors = cfg.colors;
|
|
69429
69376
|
const meshMatrix = cfg.meshMatrix;
|
|
69430
|
-
const worldMatrix = cfg.worldMatrix;
|
|
69431
69377
|
const worldAABB = cfg.worldAABB;
|
|
69432
69378
|
const pickColor = cfg.pickColor;
|
|
69433
69379
|
|
|
@@ -69459,12 +69405,6 @@ class PointsBatchingLayer {
|
|
|
69459
69405
|
worldAABB[4] = max[1];
|
|
69460
69406
|
worldAABB[5] = max[2];
|
|
69461
69407
|
|
|
69462
|
-
if (worldMatrix) {
|
|
69463
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3);
|
|
69464
|
-
math.transformOBB3(worldMatrix, tempOBB3);
|
|
69465
|
-
math.OBB3ToAABB3(tempOBB3, worldAABB);
|
|
69466
|
-
}
|
|
69467
|
-
|
|
69468
69408
|
numVerts = positionsCompressed.length / 3;
|
|
69469
69409
|
|
|
69470
69410
|
} else {
|
|
@@ -69497,13 +69437,7 @@ class PointsBatchingLayer {
|
|
|
69497
69437
|
buffer.positions[i + 2] = tempVec4b$7[2];
|
|
69498
69438
|
|
|
69499
69439
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$7);
|
|
69500
|
-
|
|
69501
|
-
if (worldMatrix) {
|
|
69502
|
-
math.transformPoint4(worldMatrix, tempVec4b$7, tempVec4c$4);
|
|
69503
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$4);
|
|
69504
|
-
} else {
|
|
69505
69440
|
math.expandAABB3Point3(worldAABB, tempVec4b$7);
|
|
69506
|
-
}
|
|
69507
69441
|
}
|
|
69508
69442
|
|
|
69509
69443
|
} else {
|
|
@@ -69515,17 +69449,9 @@ class PointsBatchingLayer {
|
|
|
69515
69449
|
tempVec4a$8[2] = buffer.positions[i + 2];
|
|
69516
69450
|
|
|
69517
69451
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$8);
|
|
69518
|
-
|
|
69519
|
-
if (worldMatrix) {
|
|
69520
|
-
math.transformPoint4(worldMatrix, tempVec4a$8, tempVec4b$7);
|
|
69521
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$7);
|
|
69522
|
-
} else {
|
|
69523
69452
|
math.expandAABB3Point3(worldAABB, tempVec4a$8);
|
|
69524
|
-
}
|
|
69525
69453
|
}
|
|
69526
69454
|
}
|
|
69527
|
-
|
|
69528
|
-
|
|
69529
69455
|
}
|
|
69530
69456
|
|
|
69531
69457
|
if (this._state.origin) {
|
|
@@ -71256,7 +71182,7 @@ const tempUint8Vec4 = new Uint8Array(4);
|
|
|
71256
71182
|
const tempFloat32 = new Float32Array(1);
|
|
71257
71183
|
const tempVec4a$7 = math.vec4([0, 0, 0, 1]);
|
|
71258
71184
|
const tempVec4b$6 = math.vec4([0, 0, 0, 1]);
|
|
71259
|
-
|
|
71185
|
+
math.vec4([0, 0, 0, 1]);
|
|
71260
71186
|
const tempVec3fa = new Float32Array(3);
|
|
71261
71187
|
|
|
71262
71188
|
/**
|
|
@@ -71367,7 +71293,6 @@ class PointsInstancingLayer {
|
|
|
71367
71293
|
createPortion(cfg) {
|
|
71368
71294
|
|
|
71369
71295
|
const meshMatrix = cfg.meshMatrix;
|
|
71370
|
-
const worldMatrix = cfg.worldMatrix;
|
|
71371
71296
|
const worldAABB = cfg.aabb;
|
|
71372
71297
|
const pickColor = cfg.pickColor;
|
|
71373
71298
|
|
|
@@ -71413,12 +71338,7 @@ class PointsInstancingLayer {
|
|
|
71413
71338
|
tempVec4a$7[1] = obb[i + 1];
|
|
71414
71339
|
tempVec4a$7[2] = obb[i + 2];
|
|
71415
71340
|
math.transformPoint4(meshMatrix, tempVec4a$7, tempVec4b$6);
|
|
71416
|
-
|
|
71417
|
-
math.transformPoint4(worldMatrix, tempVec4b$6, tempVec4c$3);
|
|
71418
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$3);
|
|
71419
|
-
} else {
|
|
71420
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$6);
|
|
71421
|
-
}
|
|
71341
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$6);
|
|
71422
71342
|
}
|
|
71423
71343
|
|
|
71424
71344
|
if (this._state.origin) {
|
|
@@ -74998,7 +74918,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74998
74918
|
const viewMatrix = camera.viewMatrix;
|
|
74999
74919
|
|
|
75000
74920
|
if (!this._program) {
|
|
75001
|
-
this._allocate(
|
|
74921
|
+
this._allocate();
|
|
75002
74922
|
if (this.errors) {
|
|
75003
74923
|
return;
|
|
75004
74924
|
}
|
|
@@ -75127,7 +75047,6 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75127
75047
|
|
|
75128
75048
|
this._uRenderPass = program.getLocation("renderPass");
|
|
75129
75049
|
this._uSceneModelWorldMatrix = program.getLocation("sceneModelWorldMatrix");
|
|
75130
|
-
this._uWorldMatrix = program.getLocation("worldMatrix");
|
|
75131
75050
|
this._uViewMatrix = program.getLocation("viewMatrix");
|
|
75132
75051
|
this._uProjMatrix = program.getLocation("projMatrix");
|
|
75133
75052
|
this._uSectionPlanes = [];
|
|
@@ -75146,13 +75065,13 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75146
75065
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
75147
75066
|
}
|
|
75148
75067
|
|
|
75149
|
-
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
75150
|
-
this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
|
|
75151
|
-
this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
|
|
75152
|
-
this._uTexturePerPolygonIdEdgeIndices = "uTexturePerPolygonIdEdgeIndices";
|
|
75068
|
+
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
75069
|
+
this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
|
|
75070
|
+
this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
|
|
75071
|
+
this._uTexturePerPolygonIdEdgeIndices = "uTexturePerPolygonIdEdgeIndices";
|
|
75153
75072
|
this._uTexturePerEdgeIdPortionIds = "uTexturePerEdgeIdPortionIds";
|
|
75154
|
-
this._uTextureModelMatrices = "uTextureModelMatrices";
|
|
75155
|
-
this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
|
|
75073
|
+
this._uTextureModelMatrices = "uTextureModelMatrices";
|
|
75074
|
+
this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
|
|
75156
75075
|
}
|
|
75157
75076
|
|
|
75158
75077
|
_bindProgram() {
|
|
@@ -75183,7 +75102,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75183
75102
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
75184
75103
|
const src = [];
|
|
75185
75104
|
src.push("#version 300 es");
|
|
75186
|
-
src.push("//
|
|
75105
|
+
src.push("// TrianglesDataTextureEdgesColorRenderer");
|
|
75187
75106
|
|
|
75188
75107
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
75189
75108
|
src.push("precision highp float;");
|
|
@@ -75201,20 +75120,18 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75201
75120
|
|
|
75202
75121
|
src.push("uniform int renderPass;");
|
|
75203
75122
|
|
|
75204
|
-
if (scene.entityOffsetsEnabled)
|
|
75205
|
-
src.push("in vec3 offset;");
|
|
75206
|
-
}
|
|
75123
|
+
if (scene.entityOffsetsEnabled) ;
|
|
75207
75124
|
|
|
75208
75125
|
src.push("uniform mat4 sceneModelWorldMatrix;");
|
|
75209
75126
|
src.push("uniform mat4 viewMatrix;");
|
|
75210
75127
|
src.push("uniform mat4 projMatrix;");
|
|
75211
75128
|
|
|
75212
|
-
src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
|
|
75213
|
-
src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
|
|
75214
|
-
src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
|
|
75215
|
-
src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
|
|
75216
|
-
src.push("uniform highp usampler2D uTexturePerPolygonIdEdgeIndices;");
|
|
75217
|
-
src.push("uniform mediump usampler2D uTexturePerEdgeIdPortionIds;");
|
|
75129
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
|
|
75130
|
+
src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
|
|
75131
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
|
|
75132
|
+
src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
|
|
75133
|
+
src.push("uniform highp usampler2D uTexturePerPolygonIdEdgeIndices;");
|
|
75134
|
+
src.push("uniform mediump usampler2D uTexturePerEdgeIdPortionIds;");
|
|
75218
75135
|
src.push("uniform highp sampler2D uTextureModelMatrices;");
|
|
75219
75136
|
|
|
75220
75137
|
// src.push("uniform vec4 color;");
|
|
@@ -75250,19 +75167,19 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75250
75167
|
src.push("ivec2 objectIndexCoords = ivec2(objectIndex % 512, objectIndex / 512);");
|
|
75251
75168
|
|
|
75252
75169
|
// get flags & flags2
|
|
75253
|
-
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75254
|
-
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75255
|
-
|
|
75170
|
+
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75171
|
+
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75172
|
+
|
|
75256
75173
|
// flags.z = NOT_RENDERED | EDGES_COLOR_OPAQUE | EDGES_COLOR_TRANSPARENT | EDGES_HIGHLIGHTED | EDGES_XRAYED | EDGES_SELECTED
|
|
75257
75174
|
// renderPass = EDGES_COLOR_OPAQUE | EDGES_COLOR_TRANSPARENT
|
|
75258
|
-
|
|
75175
|
+
|
|
75259
75176
|
src.push(`if (int(flags.z) != renderPass) {`);
|
|
75260
75177
|
src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
|
|
75261
75178
|
src.push(" return;"); // Cull vertex
|
|
75262
75179
|
src.push("} else {");
|
|
75263
75180
|
|
|
75264
75181
|
// get vertex base
|
|
75265
|
-
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
|
|
75182
|
+
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
|
|
75266
75183
|
|
|
75267
75184
|
src.push("ivec4 packedEdgeIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+6, objectIndexCoords.y), 0));");
|
|
75268
75185
|
|
|
@@ -75273,21 +75190,21 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75273
75190
|
|
|
75274
75191
|
src.push("ivec3 vertexIndices = ivec3(texelFetch(uTexturePerPolygonIdEdgeIndices, ivec2(h_index, v_index), 0));");
|
|
75275
75192
|
src.push("ivec3 uniqueVertexIndexes = vertexIndices + (packedVertexBase.r << 24) + (packedVertexBase.g << 16) + (packedVertexBase.b << 8) + packedVertexBase.a;");
|
|
75276
|
-
|
|
75193
|
+
|
|
75277
75194
|
src.push("int indexPositionH = uniqueVertexIndexes[gl_VertexID % 2] & 4095;");
|
|
75278
75195
|
src.push("int indexPositionV = uniqueVertexIndexes[gl_VertexID % 2] >> 12;");
|
|
75279
75196
|
|
|
75280
75197
|
src.push("mat4 positionsDecodeMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+3, objectIndexCoords.y), 0));");
|
|
75281
75198
|
|
|
75282
75199
|
// get flags & flags2
|
|
75283
|
-
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75284
|
-
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75285
|
-
|
|
75200
|
+
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75201
|
+
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75202
|
+
|
|
75286
75203
|
// get position
|
|
75287
75204
|
src.push("vec3 position = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH, indexPositionV), 0));");
|
|
75288
75205
|
|
|
75289
75206
|
// get color
|
|
75290
|
-
src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
|
|
75207
|
+
src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
|
|
75291
75208
|
|
|
75292
75209
|
src.push(`if (color.a == 0u) {`);
|
|
75293
75210
|
src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
|
|
@@ -75299,7 +75216,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75299
75216
|
// get XYZ offset
|
|
75300
75217
|
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
75301
75218
|
|
|
75302
|
-
|
|
75219
|
+
// src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
75303
75220
|
|
|
75304
75221
|
src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
75305
75222
|
|
|
@@ -75328,10 +75245,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75328
75245
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
75329
75246
|
const src = [];
|
|
75330
75247
|
src.push ('#version 300 es');
|
|
75331
|
-
src.push("//
|
|
75332
|
-
if (scene.logarithmicDepthBufferEnabled) {
|
|
75333
|
-
src.push("#extension GL_EXT_frag_depth : enable");
|
|
75334
|
-
}
|
|
75248
|
+
src.push("// TrianglesDataTextureEdgesColorRenderer");
|
|
75335
75249
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
75336
75250
|
src.push("precision highp float;");
|
|
75337
75251
|
src.push("precision highp int;");
|
|
@@ -75369,6 +75283,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75369
75283
|
src.push("}");
|
|
75370
75284
|
}
|
|
75371
75285
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
75286
|
+
// src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
75372
75287
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
75373
75288
|
}
|
|
75374
75289
|
src.push(" outColor = vColor;");
|
|
@@ -76386,7 +76301,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76386
76301
|
gl.uniformMatrix4fv(this._uSceneModelWorldMatrix, false, rotationMatrixConjugate);
|
|
76387
76302
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
76388
76303
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
76389
|
-
|
|
76304
|
+
{
|
|
76390
76305
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
76391
76306
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
76392
76307
|
}
|
|
@@ -76466,7 +76381,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76466
76381
|
dir: program.getLocation("sectionPlaneDir" + i)
|
|
76467
76382
|
});
|
|
76468
76383
|
}
|
|
76469
|
-
|
|
76384
|
+
{
|
|
76470
76385
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
76471
76386
|
}
|
|
76472
76387
|
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
@@ -76539,7 +76454,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76539
76454
|
|
|
76540
76455
|
src.push("vec3 positions[3];");
|
|
76541
76456
|
|
|
76542
|
-
|
|
76457
|
+
{
|
|
76543
76458
|
src.push("uniform float logDepthBufFC;");
|
|
76544
76459
|
src.push("out float vFragDepth;");
|
|
76545
76460
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -76613,7 +76528,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76613
76528
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
76614
76529
|
src.push("clipPos.xyzw *= tmp;");
|
|
76615
76530
|
src.push("vViewPosition = clipPos;");
|
|
76616
|
-
|
|
76531
|
+
{
|
|
76617
76532
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
76618
76533
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
76619
76534
|
}
|
|
@@ -76639,7 +76554,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76639
76554
|
src.push("precision mediump float;");
|
|
76640
76555
|
src.push("precision mediump int;");
|
|
76641
76556
|
src.push("#endif");
|
|
76642
|
-
|
|
76557
|
+
{
|
|
76643
76558
|
src.push("in float isPerspective;");
|
|
76644
76559
|
src.push("uniform float logDepthBufFC;");
|
|
76645
76560
|
src.push("in float vFragDepth;");
|
|
@@ -76670,7 +76585,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76670
76585
|
src.push(" if (dist > 0.0) { discard; }");
|
|
76671
76586
|
src.push(" }");
|
|
76672
76587
|
}
|
|
76673
|
-
|
|
76588
|
+
{
|
|
76674
76589
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
76675
76590
|
}
|
|
76676
76591
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, uLayerNumber);");
|
|
@@ -76696,7 +76611,6 @@ const tempVec3c$6 = math.vec3();
|
|
|
76696
76611
|
const tempVec3d$3 = math.vec3();
|
|
76697
76612
|
const tempVec3e = math.vec3();
|
|
76698
76613
|
const tempMat4a$2 = math.mat4();
|
|
76699
|
-
|
|
76700
76614
|
/**
|
|
76701
76615
|
* @private
|
|
76702
76616
|
*/
|
|
@@ -76800,7 +76714,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76800
76714
|
gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrixConjugate);
|
|
76801
76715
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
76802
76716
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
76803
|
-
|
|
76717
|
+
{
|
|
76804
76718
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
76805
76719
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
76806
76720
|
}
|
|
@@ -76879,7 +76793,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76879
76793
|
dir: program.getLocation("sectionPlaneDir" + i)
|
|
76880
76794
|
});
|
|
76881
76795
|
}
|
|
76882
|
-
|
|
76796
|
+
{
|
|
76883
76797
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
76884
76798
|
}
|
|
76885
76799
|
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
@@ -76951,7 +76865,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76951
76865
|
|
|
76952
76866
|
src.push("vec3 positions[3];");
|
|
76953
76867
|
|
|
76954
|
-
|
|
76868
|
+
{
|
|
76955
76869
|
src.push("uniform float logDepthBufFC;");
|
|
76956
76870
|
src.push("out float vFragDepth;");
|
|
76957
76871
|
src.push("out float isPerspective;");
|
|
@@ -77062,7 +76976,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77062
76976
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
77063
76977
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
77064
76978
|
src.push("clipPos.xyzw *= tmp;");
|
|
77065
|
-
|
|
76979
|
+
{
|
|
77066
76980
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
77067
76981
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
77068
76982
|
}
|
|
@@ -77086,7 +77000,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77086
77000
|
src.push("precision mediump float;");
|
|
77087
77001
|
src.push("precision mediump int;");
|
|
77088
77002
|
src.push("#endif");
|
|
77089
|
-
|
|
77003
|
+
{
|
|
77090
77004
|
src.push("in float isPerspective;");
|
|
77091
77005
|
src.push("uniform float logDepthBufFC;");
|
|
77092
77006
|
src.push("in float vFragDepth;");
|
|
@@ -77117,7 +77031,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77117
77031
|
src.push(" if (dist > 0.0) { discard; }");
|
|
77118
77032
|
src.push(" }");
|
|
77119
77033
|
}
|
|
77120
|
-
|
|
77034
|
+
{
|
|
77121
77035
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
77122
77036
|
}
|
|
77123
77037
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, - uLayerNumber);");
|
|
@@ -80413,7 +80327,7 @@ const MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE = 10;
|
|
|
80413
80327
|
|
|
80414
80328
|
const tempVec4a$5 = math.vec4([0, 0, 0, 1]);
|
|
80415
80329
|
const tempVec4b$5 = math.vec4([0, 0, 0, 1]);
|
|
80416
|
-
|
|
80330
|
+
math.vec4([0, 0, 0, 1]);
|
|
80417
80331
|
const tempUint8Array4 = new Uint8Array(4);
|
|
80418
80332
|
const tempFloat32Array3 = new Float32Array(3);
|
|
80419
80333
|
|
|
@@ -80551,8 +80465,7 @@ class TrianglesDataTextureLayer {
|
|
|
80551
80465
|
* @param portionCfg.metallic Metalness factor [0..255]
|
|
80552
80466
|
* @param portionCfg.roughness Roughness factor [0..255]
|
|
80553
80467
|
* @param portionCfg.opacity Opacity [0..255]
|
|
80554
|
-
* @param [portionCfg.meshMatrix] Flat float 4x4 matrix
|
|
80555
|
-
* @param [portionCfg.sceneModelMatrix] Flat float 4x4 matrix
|
|
80468
|
+
* @param [portionCfg.meshMatrix] Flat float 4x4 matrix - transforms the portion within the coordinate system that's local to the SceneModel
|
|
80556
80469
|
* @param portionCfg.worldAABB Flat float AABB World-space AABB
|
|
80557
80470
|
* @param portionCfg.pickColor Quantized pick color
|
|
80558
80471
|
* @returns {number} Portion ID
|
|
@@ -80704,7 +80617,6 @@ class TrianglesDataTextureLayer {
|
|
|
80704
80617
|
const colors = portionCfg.colors;
|
|
80705
80618
|
const opacity = portionCfg.opacity;
|
|
80706
80619
|
const meshMatrix = portionCfg.meshMatrix;
|
|
80707
|
-
const sceneModelMatrix = portionCfg.sceneModelMatrix;
|
|
80708
80620
|
const pickColor = portionCfg.pickColor;
|
|
80709
80621
|
const buffer = this._buffer;
|
|
80710
80622
|
const state = this._state;
|
|
@@ -80712,7 +80624,8 @@ class TrianglesDataTextureLayer {
|
|
|
80712
80624
|
buffer.perObjectPositionsDecodeMatrices.push(portionCfg.positionsDecodeMatrix);
|
|
80713
80625
|
buffer.perObjectInstancePositioningMatrices.push(meshMatrix || DEFAULT_MATRIX$1);
|
|
80714
80626
|
|
|
80715
|
-
if (meshMatrix
|
|
80627
|
+
if (meshMatrix) { // NB: SceneModel world matrix is used in shaders and SceneModelMesh.aabb
|
|
80628
|
+
|
|
80716
80629
|
if (!bucketGeometry.obb) {
|
|
80717
80630
|
bucketGeometry.obb = math.AABB3ToOBB3(bucketGeometry.aabb);
|
|
80718
80631
|
}
|
|
@@ -80725,12 +80638,7 @@ class TrianglesDataTextureLayer {
|
|
|
80725
80638
|
if (meshMatrix) {
|
|
80726
80639
|
math.transformPoint4(meshMatrix, tempVec4a$5, tempVec4b$5);
|
|
80727
80640
|
}
|
|
80728
|
-
|
|
80729
|
-
math.transformPoint4(sceneModelMatrix, tempVec4b$5, tempVec4c$2);
|
|
80730
|
-
math.expandAABB3Point3(subPortionAABB, tempVec4c$2);
|
|
80731
|
-
} else {
|
|
80732
|
-
math.expandAABB3Point3(subPortionAABB, tempVec4b$5);
|
|
80733
|
-
}
|
|
80641
|
+
math.expandAABB3Point3(subPortionAABB, tempVec4b$5);
|
|
80734
80642
|
}
|
|
80735
80643
|
} else {
|
|
80736
80644
|
math.expandAABB3(subPortionAABB, bucketGeometry.aabb);
|
|
@@ -80830,10 +80738,6 @@ class TrianglesDataTextureLayer {
|
|
|
80830
80738
|
return subPortionId;
|
|
80831
80739
|
}
|
|
80832
80740
|
|
|
80833
|
-
// updatePickCameratexture(pickViewMatrix, pickCameraMatrix) {
|
|
80834
|
-
// this._dataTextureState.texturePickCameraMatrices.updateViewMatrix(pickViewMatrix, pickCameraMatrix);
|
|
80835
|
-
// }
|
|
80836
|
-
|
|
80837
80741
|
/**
|
|
80838
80742
|
* Builds data textures from the appended geometries and loads them into the GPU.
|
|
80839
80743
|
*
|
|
@@ -81564,6 +81468,13 @@ class TrianglesDataTextureLayer {
|
|
|
81564
81468
|
// ---------------------- EDGES RENDERING -----------------------------------
|
|
81565
81469
|
|
|
81566
81470
|
drawEdgesColorOpaque(renderFlags, frameCtx) {
|
|
81471
|
+
if (this.model.scene.logarithmicDepthBufferEnabled) {
|
|
81472
|
+
if (!this.model.scene._loggedWarning) {
|
|
81473
|
+
console.log("Edge enhancement for SceneModel data texture layers currently disabled with logarithmic depth buffer");
|
|
81474
|
+
this.model.scene._loggedWarning = true;
|
|
81475
|
+
}
|
|
81476
|
+
return;
|
|
81477
|
+
}
|
|
81567
81478
|
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0) {
|
|
81568
81479
|
return;
|
|
81569
81480
|
}
|
|
@@ -83224,6 +83135,7 @@ class SceneModel extends Component {
|
|
|
83224
83135
|
_setWorldMatrixDirty() {
|
|
83225
83136
|
this._matrixDirty = true;
|
|
83226
83137
|
}
|
|
83138
|
+
|
|
83227
83139
|
_setLocalAABBDirty() {
|
|
83228
83140
|
for (let i = 0, len = this._entityList.length; i < len; i++) {
|
|
83229
83141
|
this._entityList[i]._setLocalAABBDirty(); // Entities need to rebuild their Local AABBs from their Mesh's local AABBs
|
|
@@ -83238,7 +83150,7 @@ class SceneModel extends Component {
|
|
|
83238
83150
|
this._entityList[i]._setWorldAABBDirty(); // Entities need to retransform their World AABBs by SceneModel's worldMatrix
|
|
83239
83151
|
}
|
|
83240
83152
|
}
|
|
83241
|
-
|
|
83153
|
+
|
|
83242
83154
|
/**
|
|
83243
83155
|
* Gets the SceneModel's World matrix.
|
|
83244
83156
|
*
|
|
@@ -84276,14 +84188,10 @@ class SceneModel extends Component {
|
|
|
84276
84188
|
const instancing = (cfg.geometryId !== undefined);
|
|
84277
84189
|
const batching = !instancing;
|
|
84278
84190
|
|
|
84279
|
-
cfg.sceneModelMatrix = this._matrixNonIdentity ? this._matrix : null;
|
|
84280
|
-
|
|
84281
84191
|
if (batching) {
|
|
84282
84192
|
|
|
84283
84193
|
// Batched geometry
|
|
84284
84194
|
|
|
84285
|
-
const useDTX = !!this._dtxEnabled;
|
|
84286
|
-
|
|
84287
84195
|
if (cfg.primitive === undefined || cfg.primitive === null) {
|
|
84288
84196
|
cfg.primitive = "triangles";
|
|
84289
84197
|
}
|
|
@@ -84316,6 +84224,8 @@ class SceneModel extends Component {
|
|
|
84316
84224
|
return null;
|
|
84317
84225
|
}
|
|
84318
84226
|
|
|
84227
|
+
const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface"));
|
|
84228
|
+
|
|
84319
84229
|
cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
|
|
84320
84230
|
|
|
84321
84231
|
// MATRIX - optional for batching
|
|
@@ -84458,7 +84368,7 @@ class SceneModel extends Component {
|
|
|
84458
84368
|
cfg.meshMatrix = math.composeMat4(position, DEFAULT_QUATERNION, scale, math.mat4());
|
|
84459
84369
|
}
|
|
84460
84370
|
|
|
84461
|
-
const useDTX = !!this._dtxEnabled
|
|
84371
|
+
const useDTX = (!!this._dtxEnabled && (cfg.geometry.primitive === "triangles" || cfg.geometry.primitive === "solid" || cfg.geometry.primitive === "surface"));
|
|
84462
84372
|
|
|
84463
84373
|
if (useDTX) {
|
|
84464
84374
|
|
|
@@ -84984,6 +84894,15 @@ class SceneModel extends Component {
|
|
|
84984
84894
|
if (this.scene.lod.enabled) {
|
|
84985
84895
|
this._lodManager = this.scene.lod.getLODManager(this);
|
|
84986
84896
|
}
|
|
84897
|
+
|
|
84898
|
+
this._viewMatrixDirty = true;
|
|
84899
|
+
this._matrixDirty = true;
|
|
84900
|
+
this._aabbDirty = true;
|
|
84901
|
+
|
|
84902
|
+
this._setWorldMatrixDirty();
|
|
84903
|
+
this._setWorldAABBDirty();
|
|
84904
|
+
|
|
84905
|
+
this.position = this._position;
|
|
84987
84906
|
}
|
|
84988
84907
|
|
|
84989
84908
|
/** @private */
|
|
@@ -98734,9 +98653,9 @@ class Viewer {
|
|
|
98734
98653
|
* @param {Boolean} [cfg.alphaDepthMask=true] Whether writing into the depth buffer is enabled or disabled when rendering transparent objects.
|
|
98735
98654
|
* @param {Boolean} [cfg.entityOffsetsEnabled=false] Whether to enable {@link Entity#offset}. For best performance, only set this ````true```` when you need to use {@link Entity#offset}.
|
|
98736
98655
|
* @param {Boolean} [cfg.pickSurfacePrecisionEnabled=false] Whether to enable full-precision accuracy when surface picking with {@link Scene#pick}. Note that when ````true````, this configuration will increase the amount of browser memory used by the Viewer. The ````pickSurfacePrecision```` option for ````Scene#pick```` only works if this is set ````true````.
|
|
98737
|
-
* @param {Boolean} [cfg.logarithmicDepthBufferEnabled=
|
|
98656
|
+
* @param {Boolean} [cfg.logarithmicDepthBufferEnabled=false] Whether to enable logarithmic depth buffer. When this is true,
|
|
98738
98657
|
* you can set huge values for {@link Perspective#far} and {@link Ortho#far}, to push the far clipping plane back so
|
|
98739
|
-
* that it does not clip huge models.
|
|
98658
|
+
* that it does not clip huge models.
|
|
98740
98659
|
* @param {Boolean} [cfg.colorTextureEnabled=true] Whether to enable base color texture rendering.
|
|
98741
98660
|
* @param {Boolean} [cfg.pbrEnabled=false] Whether to enable physically-based rendering.
|
|
98742
98661
|
* @param {LocaleService} [cfg.localeService=null] Optional locale-based translation service.
|
|
@@ -98798,7 +98717,7 @@ class Viewer {
|
|
|
98798
98717
|
alphaDepthMask: (cfg.alphaDepthMask !== false),
|
|
98799
98718
|
entityOffsetsEnabled: (!!cfg.entityOffsetsEnabled),
|
|
98800
98719
|
pickSurfacePrecisionEnabled: (!!cfg.pickSurfacePrecisionEnabled),
|
|
98801
|
-
logarithmicDepthBufferEnabled: (cfg.logarithmicDepthBufferEnabled
|
|
98720
|
+
logarithmicDepthBufferEnabled: (!!cfg.logarithmicDepthBufferEnabled),
|
|
98802
98721
|
pbrEnabled: (!!cfg.pbrEnabled),
|
|
98803
98722
|
lodEnabled: (!!cfg.lodEnabled),
|
|
98804
98723
|
vfcCulling: (!!cfg.vfcEnabled),
|