@xeokit/xeokit-sdk 2.4.2-beta-43 → 2.4.2-beta-45
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 +132 -84
- package/dist/xeokit-sdk.es.js +132 -84
- package/dist/xeokit-sdk.es5.js +77 -62
- 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 +4 -4
- package/package.json +1 -1
- package/src/viewer/Configs.js +49 -0
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js +4 -1
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingBuffer.js +7 -8
package/package.json
CHANGED
package/src/viewer/Configs.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {math} from "./scene/math/math.js";
|
|
2
2
|
|
|
3
|
+
let maxDataTextureHeight = 1 << 16;
|
|
4
|
+
let maxGeometryBatchSize = 4096
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* Manages global configurations for all {@link Viewer}s.
|
|
5
8
|
*
|
|
@@ -74,6 +77,52 @@ class Configs {
|
|
|
74
77
|
get doublePrecisionEnabled() {
|
|
75
78
|
return math.getDoublePrecisionEnabled();
|
|
76
79
|
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Sets the maximum data texture height.
|
|
83
|
+
*
|
|
84
|
+
* Should be a multiple of 1024. Default is 4096, which is the maximum allowed value.
|
|
85
|
+
*/
|
|
86
|
+
set maxDataTextureHeight(value) {
|
|
87
|
+
value = Math.ceil(value / 1024) * 1024;
|
|
88
|
+
if (value > 4096) {
|
|
89
|
+
value = 4096;
|
|
90
|
+
} else if (value < 1024) {
|
|
91
|
+
value = 1024;
|
|
92
|
+
}
|
|
93
|
+
maxDataTextureHeight = value;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Sets maximum data texture height.
|
|
98
|
+
* @returns {*|number}
|
|
99
|
+
*/
|
|
100
|
+
get maxDataTextureHeight() {
|
|
101
|
+
return maxDataTextureHeight;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Sets the maximum batched geometry VBO size.
|
|
106
|
+
*
|
|
107
|
+
* Default value is 5000000, which is the maximum size.
|
|
108
|
+
*
|
|
109
|
+
* Minimum size is 100000.
|
|
110
|
+
*/
|
|
111
|
+
set maxGeometryBatchSize(value) {
|
|
112
|
+
if (value < 100000) {
|
|
113
|
+
value = 100000;
|
|
114
|
+
} else if (value > 5000000) {
|
|
115
|
+
value = 5000000;
|
|
116
|
+
}
|
|
117
|
+
maxGeometryBatchSize = value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Gets the maximum batched geometry VBO size.
|
|
122
|
+
*/
|
|
123
|
+
get maxGeometryBatchSize() {
|
|
124
|
+
return maxGeometryBatchSize;
|
|
125
|
+
}
|
|
77
126
|
}
|
|
78
127
|
|
|
79
128
|
export {Configs};
|
|
@@ -7,6 +7,9 @@ import {TrianglesDataTextureBuffer} from "./TrianglesDataTextureBuffer.js";
|
|
|
7
7
|
import {DataTextureState} from "./DataTextureState.js"
|
|
8
8
|
import {DataTextureGenerator} from "./DataTextureGenerator.js";
|
|
9
9
|
import {dataTextureRamStats} from "./dataTextureRamStats.js";
|
|
10
|
+
import {Configs} from "../../../../Configs";
|
|
11
|
+
|
|
12
|
+
const configs = new Configs();
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* 12-bits allowed for object ids.
|
|
@@ -18,7 +21,7 @@ const MAX_NUMBER_OF_OBJECTS_IN_LAYER = (1 << 16);
|
|
|
18
21
|
* 4096 is max data texture height.
|
|
19
22
|
* Limits the aggregated geometry texture height in the layer.
|
|
20
23
|
*/
|
|
21
|
-
const MAX_DATA_TEXTURE_HEIGHT =
|
|
24
|
+
const MAX_DATA_TEXTURE_HEIGHT = configs.maxDataTextureHeight;
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* Align `indices` and `edgeIndices` memory layout to 8 elements.
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import {Configs} from "../../../../Configs";
|
|
2
|
+
|
|
3
|
+
const configs = new Configs();
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* @private
|
|
3
7
|
*/
|
|
4
8
|
class TrianglesBatchingBuffer {
|
|
5
9
|
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
maxGeometryBatchSize = 5000000;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
this.maxVerts = maxGeometryBatchSize;
|
|
13
|
-
this.maxIndices = maxGeometryBatchSize * 3; // Rough rule-of-thumb
|
|
10
|
+
constructor() {
|
|
11
|
+
this.maxVerts = configs.maxGeometryBatchSize;
|
|
12
|
+
this.maxIndices = configs.maxGeometryBatchSize * 3; // Rough rule-of-thumb
|
|
14
13
|
this.positions = [];
|
|
15
14
|
this.colors = [];
|
|
16
15
|
this.uv = [];
|