@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.es.js
CHANGED
|
@@ -11510,7 +11510,7 @@ class Annotation extends Marker {
|
|
|
11510
11510
|
}
|
|
11511
11511
|
|
|
11512
11512
|
const tempVec3a$D = math.vec3();
|
|
11513
|
-
const tempVec3b$
|
|
11513
|
+
const tempVec3b$q = math.vec3();
|
|
11514
11514
|
const tempVec3c$m = math.vec3();
|
|
11515
11515
|
|
|
11516
11516
|
/**
|
|
@@ -11996,7 +11996,7 @@ class AnnotationsPlugin extends Plugin {
|
|
|
11996
11996
|
this.error("Param 'pickResult' does not have both worldPos and worldNormal");
|
|
11997
11997
|
} else {
|
|
11998
11998
|
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$D);
|
|
11999
|
-
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$
|
|
11999
|
+
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$q);
|
|
12000
12000
|
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$m);
|
|
12001
12001
|
worldPos = offsetWorldPos;
|
|
12002
12002
|
entity = pickResult.entity;
|
|
@@ -19881,14 +19881,14 @@ class CustomProjection extends Component {
|
|
|
19881
19881
|
}
|
|
19882
19882
|
|
|
19883
19883
|
const tempVec3$7 = math.vec3();
|
|
19884
|
-
const tempVec3b$
|
|
19884
|
+
const tempVec3b$p = math.vec3();
|
|
19885
19885
|
const tempVec3c$l = math.vec3();
|
|
19886
19886
|
const tempVec3d$f = math.vec3();
|
|
19887
19887
|
const tempVec3e$8 = math.vec3();
|
|
19888
19888
|
const tempVec3f$2 = math.vec3();
|
|
19889
19889
|
const tempVec4a$d = math.vec4();
|
|
19890
19890
|
const tempVec4b$c = math.vec4();
|
|
19891
|
-
const tempVec4c$
|
|
19891
|
+
const tempVec4c$2 = math.vec4();
|
|
19892
19892
|
const tempMat = math.mat4();
|
|
19893
19893
|
const tempMatb = math.mat4();
|
|
19894
19894
|
const eyeLookVec = math.vec3();
|
|
@@ -20194,7 +20194,7 @@ class Camera extends Component {
|
|
|
20194
20194
|
orbitYaw(angleInc) {
|
|
20195
20195
|
let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20196
20196
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20197
|
-
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$
|
|
20197
|
+
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$p);
|
|
20198
20198
|
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$l); // Set eye position as 'look' plus 'eye' vector
|
|
20199
20199
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f); // Rotate 'up' vector
|
|
20200
20200
|
}
|
|
@@ -20212,7 +20212,7 @@ class Camera extends Component {
|
|
|
20212
20212
|
}
|
|
20213
20213
|
}
|
|
20214
20214
|
let eye2 = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20215
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$
|
|
20215
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
|
|
20216
20216
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20217
20217
|
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$f);
|
|
20218
20218
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3e$8);
|
|
@@ -20227,7 +20227,7 @@ class Camera extends Component {
|
|
|
20227
20227
|
yaw(angleInc) {
|
|
20228
20228
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20229
20229
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20230
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3b$
|
|
20230
|
+
look2 = math.transformPoint3(tempMat, look2, tempVec3b$p);
|
|
20231
20231
|
this.look = math.addVec3(look2, this._eye, tempVec3c$l);
|
|
20232
20232
|
if (this._gimbalLock) {
|
|
20233
20233
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f);
|
|
@@ -20247,7 +20247,7 @@ class Camera extends Component {
|
|
|
20247
20247
|
}
|
|
20248
20248
|
}
|
|
20249
20249
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20250
|
-
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$
|
|
20250
|
+
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
|
|
20251
20251
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20252
20252
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
|
|
20253
20253
|
look2 = math.transformPoint3(tempMat, look2, tempVec3d$f);
|
|
@@ -20264,7 +20264,7 @@ class Camera extends Component {
|
|
|
20264
20264
|
const vec = [0, 0, 0];
|
|
20265
20265
|
let v;
|
|
20266
20266
|
if (pan[0] !== 0) {
|
|
20267
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$
|
|
20267
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$p));
|
|
20268
20268
|
v = math.mulVec3Scalar(left, pan[0]);
|
|
20269
20269
|
vec[0] += v[0];
|
|
20270
20270
|
vec[1] += v[1];
|
|
@@ -20293,7 +20293,7 @@ class Camera extends Component {
|
|
|
20293
20293
|
*/
|
|
20294
20294
|
zoom(delta) {
|
|
20295
20295
|
const vec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20296
|
-
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$
|
|
20296
|
+
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$p));
|
|
20297
20297
|
const newLenLook = Math.abs(lenLook + delta);
|
|
20298
20298
|
if (newLenLook < 0.5) {
|
|
20299
20299
|
return;
|
|
@@ -20754,7 +20754,7 @@ class Camera extends Component {
|
|
|
20754
20754
|
projectWorldPos(worldPos) {
|
|
20755
20755
|
const _worldPos = tempVec4a$d;
|
|
20756
20756
|
const viewPos = tempVec4b$c;
|
|
20757
|
-
const screenPos = tempVec4c$
|
|
20757
|
+
const screenPos = tempVec4c$2;
|
|
20758
20758
|
_worldPos[0] = worldPos[0];
|
|
20759
20759
|
_worldPos[1] = worldPos[1];
|
|
20760
20760
|
_worldPos[2] = worldPos[2];
|
|
@@ -25963,7 +25963,7 @@ class LinesMaterial extends Material {
|
|
|
25963
25963
|
}
|
|
25964
25964
|
|
|
25965
25965
|
const tempVec3a$B = math.vec3();
|
|
25966
|
-
const tempVec3b$
|
|
25966
|
+
const tempVec3b$o = math.vec3();
|
|
25967
25967
|
const tempMat4a$f = math.mat4();
|
|
25968
25968
|
|
|
25969
25969
|
/**
|
|
@@ -26041,7 +26041,7 @@ function frustumIntersectsAABB3(frustum, aabb) {
|
|
|
26041
26041
|
let ret = Frustum.INSIDE;
|
|
26042
26042
|
|
|
26043
26043
|
const min = tempVec3a$B;
|
|
26044
|
-
const max = tempVec3b$
|
|
26044
|
+
const max = tempVec3b$o;
|
|
26045
26045
|
|
|
26046
26046
|
min[0] = aabb[0];
|
|
26047
26047
|
min[1] = aabb[1];
|
|
@@ -48422,7 +48422,7 @@ class LineSet extends Component {
|
|
|
48422
48422
|
|
|
48423
48423
|
const tempVec3$5 = math.vec3();
|
|
48424
48424
|
const tempVec3a$u = math.vec3();
|
|
48425
|
-
const tempVec3b$
|
|
48425
|
+
const tempVec3b$n = math.vec3();
|
|
48426
48426
|
const tempVec3c$k = math.vec3();
|
|
48427
48427
|
|
|
48428
48428
|
/**
|
|
@@ -49103,7 +49103,7 @@ class BCFViewpointsPlugin extends Plugin {
|
|
|
49103
49103
|
const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
|
|
49104
49104
|
const bitmap_data = e.bitmap_data; // base64
|
|
49105
49105
|
let location = xyzObjectToArray(e.location, tempVec3a$u);
|
|
49106
|
-
let normal = xyzObjectToArray(e.normal, tempVec3b$
|
|
49106
|
+
let normal = xyzObjectToArray(e.normal, tempVec3b$n);
|
|
49107
49107
|
let up = xyzObjectToArray(e.up, tempVec3c$k);
|
|
49108
49108
|
let height = e.height || 1;
|
|
49109
49109
|
if (!bitmap_type) {
|
|
@@ -52179,7 +52179,7 @@ CameraPathAnimation.PLAYING = 2;
|
|
|
52179
52179
|
CameraPathAnimation.PLAYING_TO = 3;
|
|
52180
52180
|
|
|
52181
52181
|
const tempVec3$3 = math.vec3();
|
|
52182
|
-
const tempVec3b$
|
|
52182
|
+
const tempVec3b$m = math.vec3();
|
|
52183
52183
|
math.vec3();
|
|
52184
52184
|
const zeroVec$2 = math.vec3([0, -1, 0]);
|
|
52185
52185
|
const tempQuat = math.vec4([0, 0, 0, 1]);
|
|
@@ -52607,7 +52607,7 @@ class ImagePlane extends Component {
|
|
|
52607
52607
|
const dist = -math.dotVec3(negDir, tempVec3$3);
|
|
52608
52608
|
|
|
52609
52609
|
math.normalizeVec3(negDir);
|
|
52610
|
-
math.mulVec3Scalar(negDir, dist, tempVec3b$
|
|
52610
|
+
math.mulVec3Scalar(negDir, dist, tempVec3b$m);
|
|
52611
52611
|
math.vec3PairToQuaternion(zeroVec$2, dir, tempQuat);
|
|
52612
52612
|
|
|
52613
52613
|
this._node.quaternion = tempQuat;
|
|
@@ -55326,7 +55326,7 @@ const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
|
|
|
55326
55326
|
|
|
55327
55327
|
const tempVec4 = math.vec4();
|
|
55328
55328
|
const tempVec3a$s = math.vec3();
|
|
55329
|
-
|
|
55329
|
+
math.vec3();
|
|
55330
55330
|
const tempVec3c$j = math.vec3();
|
|
55331
55331
|
const tempMat4a$e = math.mat4();
|
|
55332
55332
|
|
|
@@ -55770,22 +55770,24 @@ class VBOSceneModelRenderer {
|
|
|
55770
55770
|
|
|
55771
55771
|
this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
|
|
55772
55772
|
|
|
55773
|
-
|
|
55774
|
-
|
|
55775
|
-
|
|
55773
|
+
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
55774
|
+
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
55775
|
+
if (gotOrigin || gotPosition) {
|
|
55776
|
+
const rtcOrigin = tempVec3a$s;
|
|
55777
|
+
if (gotOrigin) {
|
|
55776
55778
|
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$j);
|
|
55777
|
-
|
|
55778
|
-
|
|
55779
|
-
|
|
55779
|
+
rtcOrigin[0] = rotatedOrigin[0];
|
|
55780
|
+
rtcOrigin[1] = rotatedOrigin[1];
|
|
55781
|
+
rtcOrigin[2] = rotatedOrigin[2];
|
|
55780
55782
|
} else {
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
}
|
|
55785
|
-
|
|
55786
|
-
|
|
55787
|
-
|
|
55788
|
-
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix,
|
|
55783
|
+
rtcOrigin[0] = 0;
|
|
55784
|
+
rtcOrigin[1] = 0;
|
|
55785
|
+
rtcOrigin[2] = 0;
|
|
55786
|
+
}
|
|
55787
|
+
rtcOrigin[0] += position[0];
|
|
55788
|
+
rtcOrigin[1] += position[1];
|
|
55789
|
+
rtcOrigin[2] += position[2];
|
|
55790
|
+
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$e), offset += mat4Size);
|
|
55789
55791
|
} else {
|
|
55790
55792
|
this._matricesUniformBlockBufferData.set(viewMatrix, offset += mat4Size);
|
|
55791
55793
|
}
|
|
@@ -59353,7 +59355,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59353
59355
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
59354
59356
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
59355
59357
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
59356
|
-
|
|
59358
|
+
{
|
|
59357
59359
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix?
|
|
59358
59360
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
59359
59361
|
}
|
|
@@ -59423,7 +59425,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59423
59425
|
this._aPosition = program.getAttribute("position");
|
|
59424
59426
|
this._aOffset = program.getAttribute("offset");
|
|
59425
59427
|
this._aFlags = program.getAttribute("flags");
|
|
59426
|
-
|
|
59428
|
+
{
|
|
59427
59429
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
59428
59430
|
}
|
|
59429
59431
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -59478,7 +59480,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59478
59480
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
59479
59481
|
src.push("uniform vec2 snapVectorA;");
|
|
59480
59482
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
59481
|
-
|
|
59483
|
+
{
|
|
59482
59484
|
src.push("uniform float logDepthBufFC;");
|
|
59483
59485
|
src.push("out float vFragDepth;");
|
|
59484
59486
|
src.push("out float isPerspective;");
|
|
@@ -59519,7 +59521,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59519
59521
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
59520
59522
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
59521
59523
|
src.push("clipPos.xyzw *= tmp;");
|
|
59522
|
-
|
|
59524
|
+
{
|
|
59523
59525
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
59524
59526
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59525
59527
|
}
|
|
@@ -59543,7 +59545,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59543
59545
|
src.push("precision mediump float;");
|
|
59544
59546
|
src.push("precision mediump int;");
|
|
59545
59547
|
src.push("#endif");
|
|
59546
|
-
|
|
59548
|
+
{
|
|
59547
59549
|
src.push("in float isPerspective;");
|
|
59548
59550
|
src.push("uniform float logDepthBufFC;");
|
|
59549
59551
|
src.push("in float vFragDepth;");
|
|
@@ -59574,7 +59576,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59574
59576
|
src.push(" if (dist > 0.0) { discard; }");
|
|
59575
59577
|
src.push(" }");
|
|
59576
59578
|
}
|
|
59577
|
-
|
|
59579
|
+
{
|
|
59578
59580
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
59579
59581
|
}
|
|
59580
59582
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
@@ -59698,7 +59700,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59698
59700
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
59699
59701
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
59700
59702
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
59701
|
-
|
|
59703
|
+
{
|
|
59702
59704
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix?
|
|
59703
59705
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
59704
59706
|
}
|
|
@@ -59779,7 +59781,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59779
59781
|
this._aOffset = program.getAttribute("offset");
|
|
59780
59782
|
this._aFlags = program.getAttribute("flags");
|
|
59781
59783
|
|
|
59782
|
-
|
|
59784
|
+
{
|
|
59783
59785
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
59784
59786
|
}
|
|
59785
59787
|
|
|
@@ -59835,7 +59837,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59835
59837
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
59836
59838
|
src.push("uniform vec2 snapVectorA;");
|
|
59837
59839
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
59838
|
-
|
|
59840
|
+
{
|
|
59839
59841
|
src.push("uniform float logDepthBufFC;");
|
|
59840
59842
|
src.push("out float vFragDepth;");
|
|
59841
59843
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -59877,7 +59879,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59877
59879
|
src.push("clipPos.xyzw /= tmp;");
|
|
59878
59880
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
59879
59881
|
src.push("clipPos.xyzw *= tmp;");
|
|
59880
|
-
|
|
59882
|
+
{
|
|
59881
59883
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
59882
59884
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59883
59885
|
}
|
|
@@ -59902,7 +59904,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59902
59904
|
src.push("precision mediump float;");
|
|
59903
59905
|
src.push("precision mediump int;");
|
|
59904
59906
|
src.push("#endif");
|
|
59905
|
-
|
|
59907
|
+
{
|
|
59906
59908
|
src.push("in float isPerspective;");
|
|
59907
59909
|
src.push("uniform float logDepthBufFC;");
|
|
59908
59910
|
src.push("in float vFragDepth;");
|
|
@@ -59933,7 +59935,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59933
59935
|
src.push(" if (dist > 0.0) { discard; }");
|
|
59934
59936
|
src.push(" }");
|
|
59935
59937
|
}
|
|
59936
|
-
|
|
59938
|
+
{
|
|
59937
59939
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
59938
59940
|
}
|
|
59939
59941
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
@@ -60024,8 +60026,8 @@ const tempMat4$1 = math.mat4();
|
|
|
60024
60026
|
const tempMat4b = math.mat4();
|
|
60025
60027
|
const tempVec4a$c = math.vec4([0, 0, 0, 1]);
|
|
60026
60028
|
const tempVec4b$b = math.vec4([0, 0, 0, 1]);
|
|
60027
|
-
|
|
60028
|
-
|
|
60029
|
+
math.vec4([0, 0, 0, 1]);
|
|
60030
|
+
math.OBB3();
|
|
60029
60031
|
|
|
60030
60032
|
const tempVec3a$p = math.vec3();
|
|
60031
60033
|
const tempVec3b$j = math.vec3();
|
|
@@ -60098,7 +60100,7 @@ class TrianglesBatchingLayer {
|
|
|
60098
60100
|
flagsBuf: null,
|
|
60099
60101
|
indicesBuf: null,
|
|
60100
60102
|
edgeIndicesBuf: null,
|
|
60101
|
-
positionsDecodeMatrix:null,
|
|
60103
|
+
positionsDecodeMatrix: null,
|
|
60102
60104
|
uvDecodeMatrix: null,
|
|
60103
60105
|
textureSet: cfg.textureSet,
|
|
60104
60106
|
pbrSupported: false // Set in #finalize if we have enough to support quality rendering
|
|
@@ -60184,7 +60186,6 @@ class TrianglesBatchingLayer {
|
|
|
60184
60186
|
* @param cfg.roughness Roughness factor [0..255]
|
|
60185
60187
|
* @param cfg.opacity Opacity [0..255]
|
|
60186
60188
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
60187
|
-
* @param [cfg.sceneModelMatrix] Flat float 4x4 matrix
|
|
60188
60189
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
60189
60190
|
* @param cfg.pickColor Quantized pick color
|
|
60190
60191
|
* @returns {number} Portion ID
|
|
@@ -60210,7 +60211,6 @@ class TrianglesBatchingLayer {
|
|
|
60210
60211
|
const roughness = cfg.roughness;
|
|
60211
60212
|
const opacity = cfg.opacity;
|
|
60212
60213
|
const meshMatrix = cfg.meshMatrix;
|
|
60213
|
-
const sceneModelMatrix = cfg.sceneModelMatrix;
|
|
60214
60214
|
const worldAABB = cfg.worldAABB;
|
|
60215
60215
|
const pickColor = cfg.pickColor;
|
|
60216
60216
|
|
|
@@ -60245,12 +60245,6 @@ class TrianglesBatchingLayer {
|
|
|
60245
60245
|
worldAABB[4] = max[1];
|
|
60246
60246
|
worldAABB[5] = max[2];
|
|
60247
60247
|
|
|
60248
|
-
if (sceneModelMatrix) {
|
|
60249
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3$2);
|
|
60250
|
-
math.transformOBB3(sceneModelMatrix, tempOBB3$2);
|
|
60251
|
-
math.OBB3ToAABB3(tempOBB3$2, worldAABB);
|
|
60252
|
-
}
|
|
60253
|
-
|
|
60254
60248
|
} else {
|
|
60255
60249
|
|
|
60256
60250
|
if (!positions) {
|
|
@@ -60282,13 +60276,7 @@ class TrianglesBatchingLayer {
|
|
|
60282
60276
|
buffer.positions[i + 2] = tempVec4b$b[2];
|
|
60283
60277
|
|
|
60284
60278
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$b);
|
|
60285
|
-
|
|
60286
|
-
if (sceneModelMatrix) {
|
|
60287
|
-
math.transformPoint4(sceneModelMatrix, tempVec4b$b, tempVec4c$8);
|
|
60288
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$8);
|
|
60289
|
-
} else {
|
|
60290
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60291
|
-
}
|
|
60279
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60292
60280
|
}
|
|
60293
60281
|
|
|
60294
60282
|
} else {
|
|
@@ -60300,13 +60288,7 @@ class TrianglesBatchingLayer {
|
|
|
60300
60288
|
tempVec4a$c[2] = buffer.positions[i + 2];
|
|
60301
60289
|
|
|
60302
60290
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$c);
|
|
60303
|
-
|
|
60304
|
-
if (sceneModelMatrix) {
|
|
60305
|
-
math.transformPoint4(sceneModelMatrix, tempVec4a$c, tempVec4b$b);
|
|
60306
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$b);
|
|
60307
|
-
} else {
|
|
60308
|
-
math.expandAABB3Point3(worldAABB, tempVec4a$c);
|
|
60309
|
-
}
|
|
60291
|
+
math.expandAABB3Point3(worldAABB, tempVec4a$c);
|
|
60310
60292
|
}
|
|
60311
60293
|
}
|
|
60312
60294
|
}
|
|
@@ -60936,7 +60918,7 @@ class TrianglesBatchingLayer {
|
|
|
60936
60918
|
offset = portion.indicesBaseIndex;
|
|
60937
60919
|
}
|
|
60938
60920
|
|
|
60939
|
-
return {
|
|
60921
|
+
return {count, offset}
|
|
60940
60922
|
}
|
|
60941
60923
|
|
|
60942
60924
|
// ---------------------- COLOR RENDERING -----------------------------------
|
|
@@ -64495,7 +64477,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64495
64477
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
64496
64478
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
64497
64479
|
|
|
64498
|
-
|
|
64480
|
+
{
|
|
64499
64481
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
64500
64482
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
64501
64483
|
}
|
|
@@ -64590,7 +64572,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64590
64572
|
this._aModelMatrixCol0 = program.getAttribute("modelMatrixCol0");
|
|
64591
64573
|
this._aModelMatrixCol1 = program.getAttribute("modelMatrixCol1");
|
|
64592
64574
|
this._aModelMatrixCol2 = program.getAttribute("modelMatrixCol2");
|
|
64593
|
-
|
|
64575
|
+
{
|
|
64594
64576
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
64595
64577
|
}
|
|
64596
64578
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -64649,7 +64631,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64649
64631
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
64650
64632
|
src.push("uniform vec2 snapVectorA;");
|
|
64651
64633
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
64652
|
-
|
|
64634
|
+
{
|
|
64653
64635
|
src.push("uniform float logDepthBufFC;");
|
|
64654
64636
|
src.push("out float vFragDepth;");
|
|
64655
64637
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -64691,7 +64673,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64691
64673
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
64692
64674
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
64693
64675
|
src.push("clipPos.xyzw *= tmp;");
|
|
64694
|
-
|
|
64676
|
+
{
|
|
64695
64677
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
64696
64678
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
64697
64679
|
}
|
|
@@ -64715,7 +64697,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64715
64697
|
src.push("precision mediump float;");
|
|
64716
64698
|
src.push("precision mediump int;");
|
|
64717
64699
|
src.push("#endif");
|
|
64718
|
-
|
|
64700
|
+
{
|
|
64719
64701
|
src.push("in float isPerspective;");
|
|
64720
64702
|
src.push("uniform float logDepthBufFC;");
|
|
64721
64703
|
src.push("in float vFragDepth;");
|
|
@@ -64746,7 +64728,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64746
64728
|
src.push("if (dist > 0.0) { discard; }");
|
|
64747
64729
|
src.push("}");
|
|
64748
64730
|
}
|
|
64749
|
-
|
|
64731
|
+
{
|
|
64750
64732
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
64751
64733
|
}
|
|
64752
64734
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
@@ -64869,7 +64851,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64869
64851
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
64870
64852
|
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
64871
64853
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
64872
|
-
|
|
64854
|
+
{
|
|
64873
64855
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2); // TODO: Far from pick project matrix
|
|
64874
64856
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
64875
64857
|
}
|
|
@@ -64957,7 +64939,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64957
64939
|
this._aModelMatrixCol0 = program.getAttribute("modelMatrixCol0");
|
|
64958
64940
|
this._aModelMatrixCol1 = program.getAttribute("modelMatrixCol1");
|
|
64959
64941
|
this._aModelMatrixCol2 = program.getAttribute("modelMatrixCol2");
|
|
64960
|
-
|
|
64942
|
+
{
|
|
64961
64943
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
64962
64944
|
}
|
|
64963
64945
|
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
@@ -65016,7 +64998,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65016
64998
|
src.push("uniform vec3 uCameraEyeRtc;");
|
|
65017
64999
|
src.push("uniform vec2 snapVectorA;");
|
|
65018
65000
|
src.push("uniform vec2 snapInvVectorAB;");
|
|
65019
|
-
|
|
65001
|
+
{
|
|
65020
65002
|
src.push("uniform float logDepthBufFC;");
|
|
65021
65003
|
src.push("out float vFragDepth;");
|
|
65022
65004
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -65057,7 +65039,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65057
65039
|
src.push("clipPos.xyzw /= tmp;");
|
|
65058
65040
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
65059
65041
|
src.push("clipPos.xyzw *= tmp;");
|
|
65060
|
-
|
|
65042
|
+
{
|
|
65061
65043
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
65062
65044
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
65063
65045
|
}
|
|
@@ -65082,7 +65064,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65082
65064
|
src.push("precision mediump float;");
|
|
65083
65065
|
src.push("precision mediump int;");
|
|
65084
65066
|
src.push("#endif");
|
|
65085
|
-
|
|
65067
|
+
{
|
|
65086
65068
|
src.push("in float isPerspective;");
|
|
65087
65069
|
src.push("uniform float logDepthBufFC;");
|
|
65088
65070
|
src.push("in float vFragDepth;");
|
|
@@ -65113,7 +65095,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65113
65095
|
src.push("if (dist > 0.0) { discard; }");
|
|
65114
65096
|
src.push("}");
|
|
65115
65097
|
}
|
|
65116
|
-
|
|
65098
|
+
{
|
|
65117
65099
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65118
65100
|
}
|
|
65119
65101
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
@@ -65204,7 +65186,7 @@ const tempUint8Vec4$2 = new Uint8Array(4);
|
|
|
65204
65186
|
const tempFloat32$2 = new Float32Array(1);
|
|
65205
65187
|
const tempVec4a$b = math.vec4([0, 0, 0, 1]);
|
|
65206
65188
|
const tempVec4b$a = math.vec4([0, 0, 0, 1]);
|
|
65207
|
-
|
|
65189
|
+
math.vec4([0, 0, 0, 1]);
|
|
65208
65190
|
const tempVec3fa$2 = new Float32Array(3);
|
|
65209
65191
|
|
|
65210
65192
|
const tempVec3a$m = math.vec3();
|
|
@@ -65347,7 +65329,6 @@ class TrianglesInstancingLayer {
|
|
|
65347
65329
|
* @param cfg.roughness Roughness factor [0..255]
|
|
65348
65330
|
* @param cfg.opacity Opacity [0..255].
|
|
65349
65331
|
* @param cfg.meshMatrix Flat float 4x4 matrix.
|
|
65350
|
-
* @param [cfg.sceneModelMatrix] Flat float 4x4 matrix.
|
|
65351
65332
|
* @param [cfg.worldMatrix] Flat float 4x4 matrix.
|
|
65352
65333
|
* @param cfg.worldAABB Flat float AABB.
|
|
65353
65334
|
* @param cfg.pickColor Quantized pick color
|
|
@@ -65360,7 +65341,6 @@ class TrianglesInstancingLayer {
|
|
|
65360
65341
|
const roughness = cfg.roughness;
|
|
65361
65342
|
const opacity = cfg.opacity !== null && cfg.opacity !== undefined ? cfg.opacity : 255;
|
|
65362
65343
|
const meshMatrix = cfg.meshMatrix;
|
|
65363
|
-
const sceneModelMatrix = cfg.sceneModelMatrix;
|
|
65364
65344
|
const worldAABB = cfg.aabb;
|
|
65365
65345
|
const pickColor = cfg.pickColor;
|
|
65366
65346
|
|
|
@@ -65444,12 +65424,7 @@ class TrianglesInstancingLayer {
|
|
|
65444
65424
|
tempVec4a$b[2] = positions[i + 2];
|
|
65445
65425
|
math.transformPoint4(positionsDecodeMatrix, tempVec4a$b, tempVec4b$a);
|
|
65446
65426
|
math.transformPoint4(meshMatrix, tempVec4b$a, tempVec4a$b);
|
|
65447
|
-
if (sceneModelMatrix) {
|
|
65448
|
-
math.transformPoint4(sceneModelMatrix, tempVec4a$b, tempVec4c$7);
|
|
65449
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$7);
|
|
65450
|
-
} else {
|
|
65451
65427
|
math.expandAABB3Point3(worldAABB, tempVec4a$b);
|
|
65452
|
-
}
|
|
65453
65428
|
}
|
|
65454
65429
|
|
|
65455
65430
|
if (this._state.origin) {
|
|
@@ -66689,8 +66664,8 @@ class LinesBatchingBuffer {
|
|
|
66689
66664
|
|
|
66690
66665
|
const tempVec4a$a = math.vec4([0, 0, 0, 1]);
|
|
66691
66666
|
const tempVec4b$9 = math.vec4([0, 0, 0, 1]);
|
|
66692
|
-
|
|
66693
|
-
|
|
66667
|
+
math.vec4([0, 0, 0, 1]);
|
|
66668
|
+
math.OBB3();
|
|
66694
66669
|
|
|
66695
66670
|
/**
|
|
66696
66671
|
* @private
|
|
@@ -66791,7 +66766,6 @@ class LinesBatchingLayer {
|
|
|
66791
66766
|
* @param cfg.color Quantized RGB color [0..255,0..255,0..255,0..255]
|
|
66792
66767
|
* @param cfg.opacity Opacity [0..255]
|
|
66793
66768
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
66794
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix
|
|
66795
66769
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
66796
66770
|
* @param cfg.pickColor Quantized pick color
|
|
66797
66771
|
* @returns {number} Portion ID
|
|
@@ -66808,7 +66782,6 @@ class LinesBatchingLayer {
|
|
|
66808
66782
|
const color = cfg.color;
|
|
66809
66783
|
const opacity = cfg.opacity;
|
|
66810
66784
|
const meshMatrix = cfg.meshMatrix;
|
|
66811
|
-
const worldMatrix = cfg.worldMatrix;
|
|
66812
66785
|
const worldAABB = cfg.worldAABB;
|
|
66813
66786
|
cfg.pickColor;
|
|
66814
66787
|
|
|
@@ -66843,12 +66816,6 @@ class LinesBatchingLayer {
|
|
|
66843
66816
|
worldAABB[4] = max[1];
|
|
66844
66817
|
worldAABB[5] = max[2];
|
|
66845
66818
|
|
|
66846
|
-
if (worldMatrix) {
|
|
66847
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3$1);
|
|
66848
|
-
math.transformOBB3(worldMatrix, tempOBB3$1);
|
|
66849
|
-
math.OBB3ToAABB3(tempOBB3$1, worldAABB);
|
|
66850
|
-
}
|
|
66851
|
-
|
|
66852
66819
|
} else {
|
|
66853
66820
|
|
|
66854
66821
|
if (!positions) {
|
|
@@ -66880,13 +66847,7 @@ class LinesBatchingLayer {
|
|
|
66880
66847
|
buffer.positions[i + 2] = tempVec4b$9[2];
|
|
66881
66848
|
|
|
66882
66849
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$9);
|
|
66883
|
-
|
|
66884
|
-
if (worldMatrix) {
|
|
66885
|
-
math.transformPoint4(worldMatrix, tempVec4b$9, tempVec4c$6);
|
|
66886
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$6);
|
|
66887
|
-
} else {
|
|
66888
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66889
|
-
}
|
|
66850
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66890
66851
|
}
|
|
66891
66852
|
|
|
66892
66853
|
} else {
|
|
@@ -66898,13 +66859,7 @@ class LinesBatchingLayer {
|
|
|
66898
66859
|
tempVec4a$a[2] = buffer.positions[i + 2];
|
|
66899
66860
|
|
|
66900
66861
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$a);
|
|
66901
|
-
|
|
66902
|
-
if (worldMatrix) {
|
|
66903
|
-
math.transformPoint4(worldMatrix, tempVec4a$a, tempVec4b$9);
|
|
66904
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$9);
|
|
66905
|
-
} else {
|
|
66906
|
-
math.expandAABB3Point3(worldAABB, tempVec4a$a);
|
|
66907
|
-
}
|
|
66862
|
+
math.expandAABB3Point3(worldAABB, tempVec4a$a);
|
|
66908
66863
|
}
|
|
66909
66864
|
}
|
|
66910
66865
|
}
|
|
@@ -67783,7 +67738,7 @@ const tempFloat32$1 = new Float32Array(1);
|
|
|
67783
67738
|
|
|
67784
67739
|
const tempVec4a$9 = math.vec4([0, 0, 0, 1]);
|
|
67785
67740
|
const tempVec4b$8 = math.vec4([0, 0, 0, 1]);
|
|
67786
|
-
|
|
67741
|
+
math.vec4([0, 0, 0, 1]);
|
|
67787
67742
|
|
|
67788
67743
|
const tempVec3fa$1 = new Float32Array(3);
|
|
67789
67744
|
|
|
@@ -67895,7 +67850,6 @@ class LinesInstancingLayer {
|
|
|
67895
67850
|
* @param cfg.color Color [0..255,0..255,0..255]
|
|
67896
67851
|
* @param cfg.opacity Opacity [0..255].
|
|
67897
67852
|
* @param cfg.meshMatrix Flat float 4x4 matrix.
|
|
67898
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix.
|
|
67899
67853
|
* @param cfg.aabb Flat float AABB.
|
|
67900
67854
|
* @returns {number} Portion ID.
|
|
67901
67855
|
*/
|
|
@@ -67904,7 +67858,6 @@ class LinesInstancingLayer {
|
|
|
67904
67858
|
const color = cfg.color;
|
|
67905
67859
|
const opacity = cfg.opacity;
|
|
67906
67860
|
const meshMatrix = cfg.meshMatrix;
|
|
67907
|
-
const worldMatrix = cfg.worldMatrix;
|
|
67908
67861
|
const worldAABB = cfg.aabb;
|
|
67909
67862
|
|
|
67910
67863
|
if (this._finalized) {
|
|
@@ -67954,12 +67907,7 @@ class LinesInstancingLayer {
|
|
|
67954
67907
|
tempVec4a$9[1] = obb[i + 1];
|
|
67955
67908
|
tempVec4a$9[2] = obb[i + 2];
|
|
67956
67909
|
math.transformPoint4(meshMatrix, tempVec4a$9, tempVec4b$8);
|
|
67957
|
-
|
|
67958
|
-
math.transformPoint4(worldMatrix, tempVec4b$8, tempVec4c$5);
|
|
67959
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$5);
|
|
67960
|
-
} else {
|
|
67961
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$8);
|
|
67962
|
-
}
|
|
67910
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$8);
|
|
67963
67911
|
}
|
|
67964
67912
|
|
|
67965
67913
|
if (this._state.origin) {
|
|
@@ -69297,8 +69245,8 @@ const tempVec3a$l = math.vec4();
|
|
|
69297
69245
|
const tempVec3b$f = math.vec4();
|
|
69298
69246
|
const tempVec4a$8 = math.vec4([0, 0, 0, 1]);
|
|
69299
69247
|
const tempVec4b$7 = math.vec4([0, 0, 0, 1]);
|
|
69300
|
-
|
|
69301
|
-
|
|
69248
|
+
math.vec4([0, 0, 0, 1]);
|
|
69249
|
+
math.OBB3();
|
|
69302
69250
|
|
|
69303
69251
|
/**
|
|
69304
69252
|
* @private
|
|
@@ -69406,7 +69354,6 @@ class PointsBatchingLayer {
|
|
|
69406
69354
|
* @param [cfg.colors] Flat float colors array.
|
|
69407
69355
|
* @param cfg.color Float RGB color [0..1,0..1,0..1]
|
|
69408
69356
|
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
69409
|
-
* @param [cfg.worldMatrix] Flat float 4x4 matrix
|
|
69410
69357
|
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
69411
69358
|
* @param cfg.pickColor Quantized pick color
|
|
69412
69359
|
* @returns {number} Portion ID
|
|
@@ -69423,7 +69370,6 @@ class PointsBatchingLayer {
|
|
|
69423
69370
|
const colorsCompressed = cfg.colorsCompressed;
|
|
69424
69371
|
const colors = cfg.colors;
|
|
69425
69372
|
const meshMatrix = cfg.meshMatrix;
|
|
69426
|
-
const worldMatrix = cfg.worldMatrix;
|
|
69427
69373
|
const worldAABB = cfg.worldAABB;
|
|
69428
69374
|
const pickColor = cfg.pickColor;
|
|
69429
69375
|
|
|
@@ -69455,12 +69401,6 @@ class PointsBatchingLayer {
|
|
|
69455
69401
|
worldAABB[4] = max[1];
|
|
69456
69402
|
worldAABB[5] = max[2];
|
|
69457
69403
|
|
|
69458
|
-
if (worldMatrix) {
|
|
69459
|
-
math.AABB3ToOBB3(worldAABB, tempOBB3);
|
|
69460
|
-
math.transformOBB3(worldMatrix, tempOBB3);
|
|
69461
|
-
math.OBB3ToAABB3(tempOBB3, worldAABB);
|
|
69462
|
-
}
|
|
69463
|
-
|
|
69464
69404
|
numVerts = positionsCompressed.length / 3;
|
|
69465
69405
|
|
|
69466
69406
|
} else {
|
|
@@ -69493,13 +69433,7 @@ class PointsBatchingLayer {
|
|
|
69493
69433
|
buffer.positions[i + 2] = tempVec4b$7[2];
|
|
69494
69434
|
|
|
69495
69435
|
math.expandAABB3Point3(this._modelAABB, tempVec4b$7);
|
|
69496
|
-
|
|
69497
|
-
if (worldMatrix) {
|
|
69498
|
-
math.transformPoint4(worldMatrix, tempVec4b$7, tempVec4c$4);
|
|
69499
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$4);
|
|
69500
|
-
} else {
|
|
69501
69436
|
math.expandAABB3Point3(worldAABB, tempVec4b$7);
|
|
69502
|
-
}
|
|
69503
69437
|
}
|
|
69504
69438
|
|
|
69505
69439
|
} else {
|
|
@@ -69511,17 +69445,9 @@ class PointsBatchingLayer {
|
|
|
69511
69445
|
tempVec4a$8[2] = buffer.positions[i + 2];
|
|
69512
69446
|
|
|
69513
69447
|
math.expandAABB3Point3(this._modelAABB, tempVec4a$8);
|
|
69514
|
-
|
|
69515
|
-
if (worldMatrix) {
|
|
69516
|
-
math.transformPoint4(worldMatrix, tempVec4a$8, tempVec4b$7);
|
|
69517
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$7);
|
|
69518
|
-
} else {
|
|
69519
69448
|
math.expandAABB3Point3(worldAABB, tempVec4a$8);
|
|
69520
|
-
}
|
|
69521
69449
|
}
|
|
69522
69450
|
}
|
|
69523
|
-
|
|
69524
|
-
|
|
69525
69451
|
}
|
|
69526
69452
|
|
|
69527
69453
|
if (this._state.origin) {
|
|
@@ -71252,7 +71178,7 @@ const tempUint8Vec4 = new Uint8Array(4);
|
|
|
71252
71178
|
const tempFloat32 = new Float32Array(1);
|
|
71253
71179
|
const tempVec4a$7 = math.vec4([0, 0, 0, 1]);
|
|
71254
71180
|
const tempVec4b$6 = math.vec4([0, 0, 0, 1]);
|
|
71255
|
-
|
|
71181
|
+
math.vec4([0, 0, 0, 1]);
|
|
71256
71182
|
const tempVec3fa = new Float32Array(3);
|
|
71257
71183
|
|
|
71258
71184
|
/**
|
|
@@ -71363,7 +71289,6 @@ class PointsInstancingLayer {
|
|
|
71363
71289
|
createPortion(cfg) {
|
|
71364
71290
|
|
|
71365
71291
|
const meshMatrix = cfg.meshMatrix;
|
|
71366
|
-
const worldMatrix = cfg.worldMatrix;
|
|
71367
71292
|
const worldAABB = cfg.aabb;
|
|
71368
71293
|
const pickColor = cfg.pickColor;
|
|
71369
71294
|
|
|
@@ -71409,12 +71334,7 @@ class PointsInstancingLayer {
|
|
|
71409
71334
|
tempVec4a$7[1] = obb[i + 1];
|
|
71410
71335
|
tempVec4a$7[2] = obb[i + 2];
|
|
71411
71336
|
math.transformPoint4(meshMatrix, tempVec4a$7, tempVec4b$6);
|
|
71412
|
-
|
|
71413
|
-
math.transformPoint4(worldMatrix, tempVec4b$6, tempVec4c$3);
|
|
71414
|
-
math.expandAABB3Point3(worldAABB, tempVec4c$3);
|
|
71415
|
-
} else {
|
|
71416
|
-
math.expandAABB3Point3(worldAABB, tempVec4b$6);
|
|
71417
|
-
}
|
|
71337
|
+
math.expandAABB3Point3(worldAABB, tempVec4b$6);
|
|
71418
71338
|
}
|
|
71419
71339
|
|
|
71420
71340
|
if (this._state.origin) {
|
|
@@ -74994,7 +74914,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74994
74914
|
const viewMatrix = camera.viewMatrix;
|
|
74995
74915
|
|
|
74996
74916
|
if (!this._program) {
|
|
74997
|
-
this._allocate(
|
|
74917
|
+
this._allocate();
|
|
74998
74918
|
if (this.errors) {
|
|
74999
74919
|
return;
|
|
75000
74920
|
}
|
|
@@ -75123,7 +75043,6 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75123
75043
|
|
|
75124
75044
|
this._uRenderPass = program.getLocation("renderPass");
|
|
75125
75045
|
this._uSceneModelWorldMatrix = program.getLocation("sceneModelWorldMatrix");
|
|
75126
|
-
this._uWorldMatrix = program.getLocation("worldMatrix");
|
|
75127
75046
|
this._uViewMatrix = program.getLocation("viewMatrix");
|
|
75128
75047
|
this._uProjMatrix = program.getLocation("projMatrix");
|
|
75129
75048
|
this._uSectionPlanes = [];
|
|
@@ -75142,13 +75061,13 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75142
75061
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
75143
75062
|
}
|
|
75144
75063
|
|
|
75145
|
-
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
75146
|
-
this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
|
|
75147
|
-
this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
|
|
75148
|
-
this._uTexturePerPolygonIdEdgeIndices = "uTexturePerPolygonIdEdgeIndices";
|
|
75064
|
+
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
75065
|
+
this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
|
|
75066
|
+
this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
|
|
75067
|
+
this._uTexturePerPolygonIdEdgeIndices = "uTexturePerPolygonIdEdgeIndices";
|
|
75149
75068
|
this._uTexturePerEdgeIdPortionIds = "uTexturePerEdgeIdPortionIds";
|
|
75150
|
-
this._uTextureModelMatrices = "uTextureModelMatrices";
|
|
75151
|
-
this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
|
|
75069
|
+
this._uTextureModelMatrices = "uTextureModelMatrices";
|
|
75070
|
+
this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
|
|
75152
75071
|
}
|
|
75153
75072
|
|
|
75154
75073
|
_bindProgram() {
|
|
@@ -75179,7 +75098,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75179
75098
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
75180
75099
|
const src = [];
|
|
75181
75100
|
src.push("#version 300 es");
|
|
75182
|
-
src.push("//
|
|
75101
|
+
src.push("// TrianglesDataTextureEdgesColorRenderer");
|
|
75183
75102
|
|
|
75184
75103
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
75185
75104
|
src.push("precision highp float;");
|
|
@@ -75197,20 +75116,18 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75197
75116
|
|
|
75198
75117
|
src.push("uniform int renderPass;");
|
|
75199
75118
|
|
|
75200
|
-
if (scene.entityOffsetsEnabled)
|
|
75201
|
-
src.push("in vec3 offset;");
|
|
75202
|
-
}
|
|
75119
|
+
if (scene.entityOffsetsEnabled) ;
|
|
75203
75120
|
|
|
75204
75121
|
src.push("uniform mat4 sceneModelWorldMatrix;");
|
|
75205
75122
|
src.push("uniform mat4 viewMatrix;");
|
|
75206
75123
|
src.push("uniform mat4 projMatrix;");
|
|
75207
75124
|
|
|
75208
|
-
src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
|
|
75209
|
-
src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
|
|
75210
|
-
src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
|
|
75211
|
-
src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
|
|
75212
|
-
src.push("uniform highp usampler2D uTexturePerPolygonIdEdgeIndices;");
|
|
75213
|
-
src.push("uniform mediump usampler2D uTexturePerEdgeIdPortionIds;");
|
|
75125
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
|
|
75126
|
+
src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
|
|
75127
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
|
|
75128
|
+
src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
|
|
75129
|
+
src.push("uniform highp usampler2D uTexturePerPolygonIdEdgeIndices;");
|
|
75130
|
+
src.push("uniform mediump usampler2D uTexturePerEdgeIdPortionIds;");
|
|
75214
75131
|
src.push("uniform highp sampler2D uTextureModelMatrices;");
|
|
75215
75132
|
|
|
75216
75133
|
// src.push("uniform vec4 color;");
|
|
@@ -75246,19 +75163,19 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75246
75163
|
src.push("ivec2 objectIndexCoords = ivec2(objectIndex % 512, objectIndex / 512);");
|
|
75247
75164
|
|
|
75248
75165
|
// get flags & flags2
|
|
75249
|
-
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75250
|
-
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75251
|
-
|
|
75166
|
+
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75167
|
+
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75168
|
+
|
|
75252
75169
|
// flags.z = NOT_RENDERED | EDGES_COLOR_OPAQUE | EDGES_COLOR_TRANSPARENT | EDGES_HIGHLIGHTED | EDGES_XRAYED | EDGES_SELECTED
|
|
75253
75170
|
// renderPass = EDGES_COLOR_OPAQUE | EDGES_COLOR_TRANSPARENT
|
|
75254
|
-
|
|
75171
|
+
|
|
75255
75172
|
src.push(`if (int(flags.z) != renderPass) {`);
|
|
75256
75173
|
src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
|
|
75257
75174
|
src.push(" return;"); // Cull vertex
|
|
75258
75175
|
src.push("} else {");
|
|
75259
75176
|
|
|
75260
75177
|
// get vertex base
|
|
75261
|
-
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
|
|
75178
|
+
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
|
|
75262
75179
|
|
|
75263
75180
|
src.push("ivec4 packedEdgeIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+6, objectIndexCoords.y), 0));");
|
|
75264
75181
|
|
|
@@ -75269,21 +75186,21 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75269
75186
|
|
|
75270
75187
|
src.push("ivec3 vertexIndices = ivec3(texelFetch(uTexturePerPolygonIdEdgeIndices, ivec2(h_index, v_index), 0));");
|
|
75271
75188
|
src.push("ivec3 uniqueVertexIndexes = vertexIndices + (packedVertexBase.r << 24) + (packedVertexBase.g << 16) + (packedVertexBase.b << 8) + packedVertexBase.a;");
|
|
75272
|
-
|
|
75189
|
+
|
|
75273
75190
|
src.push("int indexPositionH = uniqueVertexIndexes[gl_VertexID % 2] & 4095;");
|
|
75274
75191
|
src.push("int indexPositionV = uniqueVertexIndexes[gl_VertexID % 2] >> 12;");
|
|
75275
75192
|
|
|
75276
75193
|
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));");
|
|
75277
75194
|
|
|
75278
75195
|
// get flags & flags2
|
|
75279
|
-
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75280
|
-
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75281
|
-
|
|
75196
|
+
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
75197
|
+
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
75198
|
+
|
|
75282
75199
|
// get position
|
|
75283
75200
|
src.push("vec3 position = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH, indexPositionV), 0));");
|
|
75284
75201
|
|
|
75285
75202
|
// get color
|
|
75286
|
-
src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
|
|
75203
|
+
src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
|
|
75287
75204
|
|
|
75288
75205
|
src.push(`if (color.a == 0u) {`);
|
|
75289
75206
|
src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
|
|
@@ -75295,7 +75212,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75295
75212
|
// get XYZ offset
|
|
75296
75213
|
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
75297
75214
|
|
|
75298
|
-
|
|
75215
|
+
// src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
75299
75216
|
|
|
75300
75217
|
src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
75301
75218
|
|
|
@@ -75324,10 +75241,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75324
75241
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
75325
75242
|
const src = [];
|
|
75326
75243
|
src.push ('#version 300 es');
|
|
75327
|
-
src.push("//
|
|
75328
|
-
if (scene.logarithmicDepthBufferEnabled) {
|
|
75329
|
-
src.push("#extension GL_EXT_frag_depth : enable");
|
|
75330
|
-
}
|
|
75244
|
+
src.push("// TrianglesDataTextureEdgesColorRenderer");
|
|
75331
75245
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
75332
75246
|
src.push("precision highp float;");
|
|
75333
75247
|
src.push("precision highp int;");
|
|
@@ -75365,6 +75279,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75365
75279
|
src.push("}");
|
|
75366
75280
|
}
|
|
75367
75281
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
75282
|
+
// src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
75368
75283
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
75369
75284
|
}
|
|
75370
75285
|
src.push(" outColor = vColor;");
|
|
@@ -76382,7 +76297,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76382
76297
|
gl.uniformMatrix4fv(this._uSceneModelWorldMatrix, false, rotationMatrixConjugate);
|
|
76383
76298
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
76384
76299
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
76385
|
-
|
|
76300
|
+
{
|
|
76386
76301
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
76387
76302
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
76388
76303
|
}
|
|
@@ -76462,7 +76377,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76462
76377
|
dir: program.getLocation("sectionPlaneDir" + i)
|
|
76463
76378
|
});
|
|
76464
76379
|
}
|
|
76465
|
-
|
|
76380
|
+
{
|
|
76466
76381
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
76467
76382
|
}
|
|
76468
76383
|
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
@@ -76535,7 +76450,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76535
76450
|
|
|
76536
76451
|
src.push("vec3 positions[3];");
|
|
76537
76452
|
|
|
76538
|
-
|
|
76453
|
+
{
|
|
76539
76454
|
src.push("uniform float logDepthBufFC;");
|
|
76540
76455
|
src.push("out float vFragDepth;");
|
|
76541
76456
|
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
@@ -76609,7 +76524,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76609
76524
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
76610
76525
|
src.push("clipPos.xyzw *= tmp;");
|
|
76611
76526
|
src.push("vViewPosition = clipPos;");
|
|
76612
|
-
|
|
76527
|
+
{
|
|
76613
76528
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
76614
76529
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
76615
76530
|
}
|
|
@@ -76635,7 +76550,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76635
76550
|
src.push("precision mediump float;");
|
|
76636
76551
|
src.push("precision mediump int;");
|
|
76637
76552
|
src.push("#endif");
|
|
76638
|
-
|
|
76553
|
+
{
|
|
76639
76554
|
src.push("in float isPerspective;");
|
|
76640
76555
|
src.push("uniform float logDepthBufFC;");
|
|
76641
76556
|
src.push("in float vFragDepth;");
|
|
@@ -76666,7 +76581,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76666
76581
|
src.push(" if (dist > 0.0) { discard; }");
|
|
76667
76582
|
src.push(" }");
|
|
76668
76583
|
}
|
|
76669
|
-
|
|
76584
|
+
{
|
|
76670
76585
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
76671
76586
|
}
|
|
76672
76587
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, uLayerNumber);");
|
|
@@ -76692,7 +76607,6 @@ const tempVec3c$6 = math.vec3();
|
|
|
76692
76607
|
const tempVec3d$3 = math.vec3();
|
|
76693
76608
|
const tempVec3e = math.vec3();
|
|
76694
76609
|
const tempMat4a$2 = math.mat4();
|
|
76695
|
-
|
|
76696
76610
|
/**
|
|
76697
76611
|
* @private
|
|
76698
76612
|
*/
|
|
@@ -76796,7 +76710,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76796
76710
|
gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrixConjugate);
|
|
76797
76711
|
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
76798
76712
|
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
76799
|
-
|
|
76713
|
+
{
|
|
76800
76714
|
const logDepthBufFC = 2.0 / (Math.log(frameCtx.pickZFar + 1.0) / Math.LN2);
|
|
76801
76715
|
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
76802
76716
|
}
|
|
@@ -76875,7 +76789,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76875
76789
|
dir: program.getLocation("sectionPlaneDir" + i)
|
|
76876
76790
|
});
|
|
76877
76791
|
}
|
|
76878
|
-
|
|
76792
|
+
{
|
|
76879
76793
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
76880
76794
|
}
|
|
76881
76795
|
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
@@ -76947,7 +76861,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76947
76861
|
|
|
76948
76862
|
src.push("vec3 positions[3];");
|
|
76949
76863
|
|
|
76950
|
-
|
|
76864
|
+
{
|
|
76951
76865
|
src.push("uniform float logDepthBufFC;");
|
|
76952
76866
|
src.push("out float vFragDepth;");
|
|
76953
76867
|
src.push("out float isPerspective;");
|
|
@@ -77058,7 +76972,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77058
76972
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
77059
76973
|
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
77060
76974
|
src.push("clipPos.xyzw *= tmp;");
|
|
77061
|
-
|
|
76975
|
+
{
|
|
77062
76976
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
77063
76977
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
77064
76978
|
}
|
|
@@ -77082,7 +76996,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77082
76996
|
src.push("precision mediump float;");
|
|
77083
76997
|
src.push("precision mediump int;");
|
|
77084
76998
|
src.push("#endif");
|
|
77085
|
-
|
|
76999
|
+
{
|
|
77086
77000
|
src.push("in float isPerspective;");
|
|
77087
77001
|
src.push("uniform float logDepthBufFC;");
|
|
77088
77002
|
src.push("in float vFragDepth;");
|
|
@@ -77113,7 +77027,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77113
77027
|
src.push(" if (dist > 0.0) { discard; }");
|
|
77114
77028
|
src.push(" }");
|
|
77115
77029
|
}
|
|
77116
|
-
|
|
77030
|
+
{
|
|
77117
77031
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
77118
77032
|
}
|
|
77119
77033
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, - uLayerNumber);");
|
|
@@ -80409,7 +80323,7 @@ const MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE = 10;
|
|
|
80409
80323
|
|
|
80410
80324
|
const tempVec4a$5 = math.vec4([0, 0, 0, 1]);
|
|
80411
80325
|
const tempVec4b$5 = math.vec4([0, 0, 0, 1]);
|
|
80412
|
-
|
|
80326
|
+
math.vec4([0, 0, 0, 1]);
|
|
80413
80327
|
const tempUint8Array4 = new Uint8Array(4);
|
|
80414
80328
|
const tempFloat32Array3 = new Float32Array(3);
|
|
80415
80329
|
|
|
@@ -80547,8 +80461,7 @@ class TrianglesDataTextureLayer {
|
|
|
80547
80461
|
* @param portionCfg.metallic Metalness factor [0..255]
|
|
80548
80462
|
* @param portionCfg.roughness Roughness factor [0..255]
|
|
80549
80463
|
* @param portionCfg.opacity Opacity [0..255]
|
|
80550
|
-
* @param [portionCfg.meshMatrix] Flat float 4x4 matrix
|
|
80551
|
-
* @param [portionCfg.sceneModelMatrix] Flat float 4x4 matrix
|
|
80464
|
+
* @param [portionCfg.meshMatrix] Flat float 4x4 matrix - transforms the portion within the coordinate system that's local to the SceneModel
|
|
80552
80465
|
* @param portionCfg.worldAABB Flat float AABB World-space AABB
|
|
80553
80466
|
* @param portionCfg.pickColor Quantized pick color
|
|
80554
80467
|
* @returns {number} Portion ID
|
|
@@ -80700,7 +80613,6 @@ class TrianglesDataTextureLayer {
|
|
|
80700
80613
|
const colors = portionCfg.colors;
|
|
80701
80614
|
const opacity = portionCfg.opacity;
|
|
80702
80615
|
const meshMatrix = portionCfg.meshMatrix;
|
|
80703
|
-
const sceneModelMatrix = portionCfg.sceneModelMatrix;
|
|
80704
80616
|
const pickColor = portionCfg.pickColor;
|
|
80705
80617
|
const buffer = this._buffer;
|
|
80706
80618
|
const state = this._state;
|
|
@@ -80708,7 +80620,8 @@ class TrianglesDataTextureLayer {
|
|
|
80708
80620
|
buffer.perObjectPositionsDecodeMatrices.push(portionCfg.positionsDecodeMatrix);
|
|
80709
80621
|
buffer.perObjectInstancePositioningMatrices.push(meshMatrix || DEFAULT_MATRIX$1);
|
|
80710
80622
|
|
|
80711
|
-
if (meshMatrix
|
|
80623
|
+
if (meshMatrix) { // NB: SceneModel world matrix is used in shaders and SceneModelMesh.aabb
|
|
80624
|
+
|
|
80712
80625
|
if (!bucketGeometry.obb) {
|
|
80713
80626
|
bucketGeometry.obb = math.AABB3ToOBB3(bucketGeometry.aabb);
|
|
80714
80627
|
}
|
|
@@ -80721,12 +80634,7 @@ class TrianglesDataTextureLayer {
|
|
|
80721
80634
|
if (meshMatrix) {
|
|
80722
80635
|
math.transformPoint4(meshMatrix, tempVec4a$5, tempVec4b$5);
|
|
80723
80636
|
}
|
|
80724
|
-
|
|
80725
|
-
math.transformPoint4(sceneModelMatrix, tempVec4b$5, tempVec4c$2);
|
|
80726
|
-
math.expandAABB3Point3(subPortionAABB, tempVec4c$2);
|
|
80727
|
-
} else {
|
|
80728
|
-
math.expandAABB3Point3(subPortionAABB, tempVec4b$5);
|
|
80729
|
-
}
|
|
80637
|
+
math.expandAABB3Point3(subPortionAABB, tempVec4b$5);
|
|
80730
80638
|
}
|
|
80731
80639
|
} else {
|
|
80732
80640
|
math.expandAABB3(subPortionAABB, bucketGeometry.aabb);
|
|
@@ -80826,10 +80734,6 @@ class TrianglesDataTextureLayer {
|
|
|
80826
80734
|
return subPortionId;
|
|
80827
80735
|
}
|
|
80828
80736
|
|
|
80829
|
-
// updatePickCameratexture(pickViewMatrix, pickCameraMatrix) {
|
|
80830
|
-
// this._dataTextureState.texturePickCameraMatrices.updateViewMatrix(pickViewMatrix, pickCameraMatrix);
|
|
80831
|
-
// }
|
|
80832
|
-
|
|
80833
80737
|
/**
|
|
80834
80738
|
* Builds data textures from the appended geometries and loads them into the GPU.
|
|
80835
80739
|
*
|
|
@@ -81560,6 +81464,13 @@ class TrianglesDataTextureLayer {
|
|
|
81560
81464
|
// ---------------------- EDGES RENDERING -----------------------------------
|
|
81561
81465
|
|
|
81562
81466
|
drawEdgesColorOpaque(renderFlags, frameCtx) {
|
|
81467
|
+
if (this.model.scene.logarithmicDepthBufferEnabled) {
|
|
81468
|
+
if (!this.model.scene._loggedWarning) {
|
|
81469
|
+
console.log("Edge enhancement for SceneModel data texture layers currently disabled with logarithmic depth buffer");
|
|
81470
|
+
this.model.scene._loggedWarning = true;
|
|
81471
|
+
}
|
|
81472
|
+
return;
|
|
81473
|
+
}
|
|
81563
81474
|
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0) {
|
|
81564
81475
|
return;
|
|
81565
81476
|
}
|
|
@@ -83220,6 +83131,7 @@ class SceneModel extends Component {
|
|
|
83220
83131
|
_setWorldMatrixDirty() {
|
|
83221
83132
|
this._matrixDirty = true;
|
|
83222
83133
|
}
|
|
83134
|
+
|
|
83223
83135
|
_setLocalAABBDirty() {
|
|
83224
83136
|
for (let i = 0, len = this._entityList.length; i < len; i++) {
|
|
83225
83137
|
this._entityList[i]._setLocalAABBDirty(); // Entities need to rebuild their Local AABBs from their Mesh's local AABBs
|
|
@@ -83234,7 +83146,7 @@ class SceneModel extends Component {
|
|
|
83234
83146
|
this._entityList[i]._setWorldAABBDirty(); // Entities need to retransform their World AABBs by SceneModel's worldMatrix
|
|
83235
83147
|
}
|
|
83236
83148
|
}
|
|
83237
|
-
|
|
83149
|
+
|
|
83238
83150
|
/**
|
|
83239
83151
|
* Gets the SceneModel's World matrix.
|
|
83240
83152
|
*
|
|
@@ -84272,14 +84184,10 @@ class SceneModel extends Component {
|
|
|
84272
84184
|
const instancing = (cfg.geometryId !== undefined);
|
|
84273
84185
|
const batching = !instancing;
|
|
84274
84186
|
|
|
84275
|
-
cfg.sceneModelMatrix = this._matrixNonIdentity ? this._matrix : null;
|
|
84276
|
-
|
|
84277
84187
|
if (batching) {
|
|
84278
84188
|
|
|
84279
84189
|
// Batched geometry
|
|
84280
84190
|
|
|
84281
|
-
const useDTX = !!this._dtxEnabled;
|
|
84282
|
-
|
|
84283
84191
|
if (cfg.primitive === undefined || cfg.primitive === null) {
|
|
84284
84192
|
cfg.primitive = "triangles";
|
|
84285
84193
|
}
|
|
@@ -84312,6 +84220,8 @@ class SceneModel extends Component {
|
|
|
84312
84220
|
return null;
|
|
84313
84221
|
}
|
|
84314
84222
|
|
|
84223
|
+
const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface"));
|
|
84224
|
+
|
|
84315
84225
|
cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
|
|
84316
84226
|
|
|
84317
84227
|
// MATRIX - optional for batching
|
|
@@ -84454,7 +84364,7 @@ class SceneModel extends Component {
|
|
|
84454
84364
|
cfg.meshMatrix = math.composeMat4(position, DEFAULT_QUATERNION, scale, math.mat4());
|
|
84455
84365
|
}
|
|
84456
84366
|
|
|
84457
|
-
const useDTX = !!this._dtxEnabled
|
|
84367
|
+
const useDTX = (!!this._dtxEnabled && (cfg.geometry.primitive === "triangles" || cfg.geometry.primitive === "solid" || cfg.geometry.primitive === "surface"));
|
|
84458
84368
|
|
|
84459
84369
|
if (useDTX) {
|
|
84460
84370
|
|
|
@@ -84980,6 +84890,15 @@ class SceneModel extends Component {
|
|
|
84980
84890
|
if (this.scene.lod.enabled) {
|
|
84981
84891
|
this._lodManager = this.scene.lod.getLODManager(this);
|
|
84982
84892
|
}
|
|
84893
|
+
|
|
84894
|
+
this._viewMatrixDirty = true;
|
|
84895
|
+
this._matrixDirty = true;
|
|
84896
|
+
this._aabbDirty = true;
|
|
84897
|
+
|
|
84898
|
+
this._setWorldMatrixDirty();
|
|
84899
|
+
this._setWorldAABBDirty();
|
|
84900
|
+
|
|
84901
|
+
this.position = this._position;
|
|
84983
84902
|
}
|
|
84984
84903
|
|
|
84985
84904
|
/** @private */
|
|
@@ -98730,9 +98649,9 @@ class Viewer {
|
|
|
98730
98649
|
* @param {Boolean} [cfg.alphaDepthMask=true] Whether writing into the depth buffer is enabled or disabled when rendering transparent objects.
|
|
98731
98650
|
* @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}.
|
|
98732
98651
|
* @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````.
|
|
98733
|
-
* @param {Boolean} [cfg.logarithmicDepthBufferEnabled=
|
|
98652
|
+
* @param {Boolean} [cfg.logarithmicDepthBufferEnabled=false] Whether to enable logarithmic depth buffer. When this is true,
|
|
98734
98653
|
* you can set huge values for {@link Perspective#far} and {@link Ortho#far}, to push the far clipping plane back so
|
|
98735
|
-
* that it does not clip huge models.
|
|
98654
|
+
* that it does not clip huge models.
|
|
98736
98655
|
* @param {Boolean} [cfg.colorTextureEnabled=true] Whether to enable base color texture rendering.
|
|
98737
98656
|
* @param {Boolean} [cfg.pbrEnabled=false] Whether to enable physically-based rendering.
|
|
98738
98657
|
* @param {LocaleService} [cfg.localeService=null] Optional locale-based translation service.
|
|
@@ -98794,7 +98713,7 @@ class Viewer {
|
|
|
98794
98713
|
alphaDepthMask: (cfg.alphaDepthMask !== false),
|
|
98795
98714
|
entityOffsetsEnabled: (!!cfg.entityOffsetsEnabled),
|
|
98796
98715
|
pickSurfacePrecisionEnabled: (!!cfg.pickSurfacePrecisionEnabled),
|
|
98797
|
-
logarithmicDepthBufferEnabled: (cfg.logarithmicDepthBufferEnabled
|
|
98716
|
+
logarithmicDepthBufferEnabled: (!!cfg.logarithmicDepthBufferEnabled),
|
|
98798
98717
|
pbrEnabled: (!!cfg.pbrEnabled),
|
|
98799
98718
|
lodEnabled: (!!cfg.lodEnabled),
|
|
98800
98719
|
vfcCulling: (!!cfg.vfcEnabled),
|