@xeokit/xeokit-sdk 2.5.2-beta-2 → 2.5.2-beta-4
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 +123 -55
- package/dist/xeokit-sdk.es.js +123 -55
- package/dist/xeokit-sdk.es5.js +89 -76
- package/dist/xeokit-sdk.min.cjs.js +2 -2
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/extras/MarqueePicker/MarqueePickerMouseControl.js +1 -1
- package/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +2 -2
- package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +5 -4
- package/src/viewer/Configs.js +1 -2
- package/src/viewer/scene/LineSet/LineSet.js +1 -1
- package/src/viewer/scene/core.js +9 -0
- package/src/viewer/scene/model/SceneModel.js +2 -2
- package/src/viewer/scene/model/SceneModelEntity.js +10 -8
- package/src/viewer/scene/model/SceneModelTransform.js +1 -1
- package/src/viewer/scene/model/dtx/lines/DTXLinesLayer.js +1 -1
- package/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +2 -2
- package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +5 -2
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOSceneModelLineBatchingRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/VBOBatchingPointsRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsOcclusionRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickMeshRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsShadowRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +5 -5
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesBuffer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesEdgesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesFlatColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOSceneModelTriangleBatchingEdgesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsPickDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsShadowRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +5 -4
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingTrianglesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesColorTextureRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesEdgesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesEdgesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesFlatColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesFlatNormalsRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOSceneModelTriangleInstancingEdgesRenderer.js +1 -1
- package/src/viewer/scene/scene/Scene.js +58 -6
package/package.json
CHANGED
|
@@ -15,9 +15,9 @@ const EMPTY_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAA
|
|
|
15
15
|
/**
|
|
16
16
|
* @desc A {@link Viewer} plugin that provides methods for visualizing IfcBuildingStoreys.
|
|
17
17
|
*
|
|
18
|
-
* <a href="https://xeokit.github.io/xeokit-sdk/examples/#
|
|
18
|
+
* <a href="https://xeokit.github.io/xeokit-sdk/examples/navigation/#StoreyViewsPlugin_recipe3"><img src="http://xeokit.io/img/docs/StoreyViewsPlugin/minimap.gif"></a>
|
|
19
19
|
*
|
|
20
|
-
* [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#
|
|
20
|
+
* [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/navigation/#StoreyViewsPlugin_recipe3)]
|
|
21
21
|
*
|
|
22
22
|
* ## Overview
|
|
23
23
|
*
|
|
@@ -957,13 +957,14 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
957
957
|
sceneModel.once("destroyed", () => {
|
|
958
958
|
this.viewer.metaScene.destroyMetaModel(metaModel.id);
|
|
959
959
|
});
|
|
960
|
-
|
|
960
|
+
window.setTimeout(() => {
|
|
961
|
+
|
|
961
962
|
if (sceneModel.destroyed) {
|
|
962
963
|
return;
|
|
963
964
|
}
|
|
964
965
|
sceneModel.scene.fire("modelLoaded", sceneModel.id); // FIXME: Assumes listeners know order of these two events
|
|
965
966
|
sceneModel.fire("loaded", true, false); // Don't forget the event, for late subscribers
|
|
966
|
-
});
|
|
967
|
+
}, 100);
|
|
967
968
|
}
|
|
968
969
|
|
|
969
970
|
const error = (errMsg) => {
|
|
@@ -1041,7 +1042,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
1041
1042
|
globalizeObjectIds: options.globalizeObjectIds
|
|
1042
1043
|
});
|
|
1043
1044
|
i++;
|
|
1044
|
-
|
|
1045
|
+
window.setTimeout( loadNext, 100);
|
|
1045
1046
|
}, error);
|
|
1046
1047
|
}
|
|
1047
1048
|
}
|
|
@@ -1056,7 +1057,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
1056
1057
|
this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
|
|
1057
1058
|
this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
|
|
1058
1059
|
i++;
|
|
1059
|
-
|
|
1060
|
+
window.setTimeout(loadNext, 100);
|
|
1060
1061
|
}, error);
|
|
1061
1062
|
}
|
|
1062
1063
|
}
|
package/src/viewer/Configs.js
CHANGED
package/src/viewer/scene/core.js
CHANGED
|
@@ -230,4 +230,13 @@ function renderScenes() {
|
|
|
230
230
|
|
|
231
231
|
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
232
232
|
|
|
233
|
+
function compileScenes() {
|
|
234
|
+
|
|
235
|
+
for (let id in core.scenes) {
|
|
236
|
+
core.scenes[id].compile();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
window.setInterval(compileScenes, 1000 / 60);
|
|
241
|
+
|
|
233
242
|
export {core};
|
|
@@ -9,7 +9,7 @@ import {VBOBatchingLinesLayer} from './vbo/batching/lines/VBOBatchingLinesLayer.
|
|
|
9
9
|
import {VBOInstancingLinesLayer} from './vbo/instancing/lines/VBOInstancingLinesLayer.js';
|
|
10
10
|
import {VBOBatchingPointsLayer} from './vbo/batching/points/VBOBatchingPointsLayer.js';
|
|
11
11
|
import {VBOInstancingPointsLayer} from './vbo/instancing/points/VBOInstancingPointsLayer.js';
|
|
12
|
-
import {DTXLinesLayer} from "./dtx/lines/DTXLinesLayer";
|
|
12
|
+
import {DTXLinesLayer} from "./dtx/lines/DTXLinesLayer.js";
|
|
13
13
|
import {DTXTrianglesLayer} from "./dtx/triangles/DTXTrianglesLayer.js";
|
|
14
14
|
import {ENTITY_FLAGS} from './ENTITY_FLAGS.js';
|
|
15
15
|
import {RenderFlags} from "../webgl/RenderFlags.js";
|
|
@@ -37,7 +37,7 @@ import {uniquifyPositions} from "./calculateUniquePositions.js";
|
|
|
37
37
|
import {rebucketPositions} from "./rebucketPositions.js";
|
|
38
38
|
import {SceneModelEntity} from "./SceneModelEntity.js";
|
|
39
39
|
import {geometryCompressionUtils} from "../math/geometryCompressionUtils.js";
|
|
40
|
-
import {SceneModelTransform} from "./SceneModelTransform";
|
|
40
|
+
import {SceneModelTransform} from "./SceneModelTransform.js";
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
const tempVec3a = math.vec3();
|
|
@@ -686,24 +686,26 @@ export class SceneModelEntity {
|
|
|
686
686
|
if (this._isObject) {
|
|
687
687
|
scene._deregisterObject(this);
|
|
688
688
|
if (this.visible) {
|
|
689
|
-
scene.
|
|
689
|
+
scene._deRegisterVisibleObject(this);
|
|
690
690
|
}
|
|
691
691
|
if (this.xrayed) {
|
|
692
|
-
scene.
|
|
692
|
+
scene._deRegisterXRayedObject(this);
|
|
693
693
|
}
|
|
694
694
|
if (this.selected) {
|
|
695
|
-
scene.
|
|
695
|
+
scene._deRegisterSelectedObject(this);
|
|
696
696
|
}
|
|
697
697
|
if (this.highlighted) {
|
|
698
|
-
scene.
|
|
698
|
+
scene._deRegisterHighlightedObject(this);
|
|
699
699
|
}
|
|
700
|
-
if (this.
|
|
701
|
-
this.scene.
|
|
700
|
+
if (this._colorizeUpdated) {
|
|
701
|
+
this.scene._deRegisterColorizedObject(this);
|
|
702
702
|
}
|
|
703
703
|
if (this._opacityUpdated) {
|
|
704
|
-
this.scene.
|
|
704
|
+
this.scene._deRegisterOpacityObject(this);
|
|
705
|
+
}
|
|
706
|
+
if (this._offset && (this._offset[0] !== 0 || this._offset[1] !== 0 || this._offset[2] !== 0)) {
|
|
707
|
+
this.scene._deRegisterOffsetObject(this);
|
|
705
708
|
}
|
|
706
|
-
this.scene._objectOffsetUpdated(this, false);
|
|
707
709
|
}
|
|
708
710
|
for (let i = 0, len = this.meshes.length; i < len; i++) {
|
|
709
711
|
this.meshes[i]._destroy();
|
|
@@ -7,7 +7,7 @@ import {DTXLinesBuffer} from "./DTXLinesBuffer.js";
|
|
|
7
7
|
import {DTXLinesState} from "./DTXLinesState.js"
|
|
8
8
|
import {DTXLinesTextureFactory} from "./DTXLinesTextureFactory.js";
|
|
9
9
|
import {dataTextureRamStats} from "./dataTextureRamStats.js";
|
|
10
|
-
import {Configs} from "../../../../Configs";
|
|
10
|
+
import {Configs} from "../../../../Configs.js";
|
|
11
11
|
|
|
12
12
|
const configs = new Configs();
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {math} from "../../../math/math.js";
|
|
2
2
|
import {RenderState} from "../../../webgl/RenderState.js";
|
|
3
|
-
import {Configs} from "../../../../Configs";
|
|
3
|
+
import {Configs} from "../../../../Configs.js";
|
|
4
4
|
import {ENTITY_FLAGS} from '../../ENTITY_FLAGS.js';
|
|
5
5
|
import {RENDER_PASSES} from '../../RENDER_PASSES.js';
|
|
6
6
|
import {getRenderers} from "./renderers/DTXTrianglesRenderers.js";
|
|
7
7
|
import {DTXTrianglesBuffer} from "./lib/DTXTrianglesBuffer.js";
|
|
8
8
|
import {DTXTrianglesState} from "./lib/DTXTrianglesState.js"
|
|
9
9
|
import {dataTextureRamStats} from "./lib/dataTextureRamStats.js";
|
|
10
|
-
import {DTXTrianglesTextureFactory} from "./lib/DTXTrianglesTextureFactory";
|
|
10
|
+
import {DTXTrianglesTextureFactory} from "./lib/DTXTrianglesTextureFactory.js";
|
|
11
11
|
|
|
12
12
|
const configs = new Configs();
|
|
13
13
|
|
|
@@ -229,7 +229,7 @@ export class DTXTrianglesSnapInitRenderer {
|
|
|
229
229
|
const clipping = scene._sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
230
230
|
const src = [];
|
|
231
231
|
src.push("#version 300 es");
|
|
232
|
-
src.push("//
|
|
232
|
+
src.push("// DTXTrianglesSnapInitRenderer vertex shader");
|
|
233
233
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
234
234
|
src.push("precision highp float;");
|
|
235
235
|
src.push("precision highp int;");
|
|
@@ -371,6 +371,9 @@ export class DTXTrianglesSnapInitRenderer {
|
|
|
371
371
|
src.push("vFlags2 = flags2.r;");
|
|
372
372
|
}
|
|
373
373
|
src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0));");
|
|
374
|
+
|
|
375
|
+
// TODO: Normalized color? See here:
|
|
376
|
+
//src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0)) /255.0;");
|
|
374
377
|
src.push("vec4 clipPos = projMatrix * viewPosition;");
|
|
375
378
|
src.push("float tmp = clipPos.w;")
|
|
376
379
|
src.push("clipPos.xyzw /= tmp;")
|
|
@@ -391,7 +394,7 @@ export class DTXTrianglesSnapInitRenderer {
|
|
|
391
394
|
const clipping = scene._sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
392
395
|
const src = [];
|
|
393
396
|
src.push('#version 300 es');
|
|
394
|
-
src.push("//
|
|
397
|
+
src.push("// DTXTrianglesSnapInitRenderer fragment shader");
|
|
395
398
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
396
399
|
src.push("precision highp float;");
|
|
397
400
|
src.push("precision highp int;");
|
package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {createRTCViewMat} from "../../../../../math/rtcCoords.js";
|
|
3
3
|
import {math} from "../../../../../math/math.js";
|
|
4
|
-
import {VBORenderer} from "../../../VBORenderer";
|
|
4
|
+
import {VBORenderer} from "../../../VBORenderer.js";
|
|
5
5
|
|
|
6
6
|
const tempVec3a = math.vec3();
|
|
7
7
|
const tempVec3b = math.vec3();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {VBOBatchingLinesColorRenderer} from "./VBOBatchingLinesColorRenderer.js";
|
|
2
2
|
import {VBOBatchingLinesSilhouetteRenderer} from "./VBOBatchingLinesSilhouetteRenderer.js";
|
|
3
|
-
import {VBOBatchingLinesSnapInitRenderer} from "./VBOBatchingLinesSnapInitRenderer";
|
|
4
|
-
import {VBOBatchingLinesSnapRenderer} from "./VBOBatchingLinesSnapRenderer";
|
|
3
|
+
import {VBOBatchingLinesSnapInitRenderer} from "./VBOBatchingLinesSnapInitRenderer.js";
|
|
4
|
+
import {VBOBatchingLinesSnapRenderer} from "./VBOBatchingLinesSnapRenderer.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @private
|
package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {createRTCViewMat} from "../../../../../math/rtcCoords.js";
|
|
3
3
|
import {math} from "../../../../../math/math.js";
|
|
4
|
-
import {VBORenderer} from "../../../VBORenderer";
|
|
4
|
+
import {VBORenderer} from "../../../VBORenderer.js";
|
|
5
5
|
|
|
6
6
|
const tempVec3a = math.vec3();
|
|
7
7
|
const tempVec3b = math.vec3();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {createRTCViewMat} from "../../../../../math/rtcCoords.js";
|
|
3
3
|
import {math} from "../../../../../math/math.js";
|
|
4
|
-
import {VBORenderer} from "../../../VBORenderer";
|
|
4
|
+
import {VBORenderer} from "../../../VBORenderer.js";
|
|
5
5
|
|
|
6
6
|
const tempVec3a = math.vec3();
|
|
7
7
|
const tempVec3b = math.vec3();
|
|
@@ -3,8 +3,8 @@ import {VBOBatchingPointsSilhouetteRenderer} from "./VBOBatchingPointsSilhouette
|
|
|
3
3
|
import {VBOBatchingPointsPickMeshRenderer} from "./VBOBatchingPointsPickMeshRenderer.js";
|
|
4
4
|
import {VBOBatchingPointsPickDepthRenderer} from "./VBOBatchingPointsPickDepthRenderer.js";
|
|
5
5
|
import {VBOBatchingPointsOcclusionRenderer} from "./VBOBatchingPointsOcclusionRenderer.js";
|
|
6
|
-
import {VBOBatchingPointsSnapInitRenderer} from "./VBOBatchingPointsSnapInitRenderer";
|
|
7
|
-
import {VBOBatchingPointsSnapRenderer} from "./VBOBatchingPointsSnapRenderer";
|
|
6
|
+
import {VBOBatchingPointsSnapInitRenderer} from "./VBOBatchingPointsSnapInitRenderer.js";
|
|
7
|
+
import {VBOBatchingPointsSnapRenderer} from "./VBOBatchingPointsSnapRenderer.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {createRTCViewMat} from "../../../../../math/rtcCoords.js";
|
|
3
3
|
import {math} from "../../../../../math/math.js";
|
|
4
|
-
import {VBORenderer} from "../../../VBORenderer";
|
|
4
|
+
import {VBORenderer} from "../../../VBORenderer.js";
|
|
5
5
|
|
|
6
6
|
const tempVec3a = math.vec3();
|
|
7
7
|
const tempVec3b = math.vec3();
|
|
@@ -287,10 +287,10 @@ export class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
|
|
|
287
287
|
}
|
|
288
288
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
289
289
|
|
|
290
|
-
src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");
|
|
291
|
-
src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");
|
|
292
|
-
src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");
|
|
293
|
-
|
|
290
|
+
// src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");
|
|
291
|
+
// src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");
|
|
292
|
+
// src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");
|
|
293
|
+
src.push(`outNormal = ivec4(1.0, 1.0, 1.0, 1.0);`);
|
|
294
294
|
src.push("outPickColor = uvec4(vPickColor);");
|
|
295
295
|
src.push("}");
|
|
296
296
|
return src;
|
package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {createRTCViewMat} from "../../../../../math/rtcCoords.js";
|
|
3
3
|
import {math} from "../../../../../math/math.js";
|
|
4
|
-
import {VBORenderer} from "../../../VBORenderer";
|
|
4
|
+
import {VBORenderer} from "../../../VBORenderer.js";
|
|
5
5
|
|
|
6
6
|
const tempVec3a = math.vec3();
|
|
7
7
|
const tempVec3b = math.vec3();
|
package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesRenderers.js
CHANGED
|
@@ -13,8 +13,8 @@ import {VBOBatchingTrianglesShadowRenderer} from "./VBOBatchingTrianglesShadowRe
|
|
|
13
13
|
import {VBOBatchingTrianglesPBRRenderer} from "./VBOBatchingTrianglesPBRRenderer.js";
|
|
14
14
|
import {VBOBatchingTrianglesPickNormalsFlatRenderer} from "./VBOBatchingTrianglesPickNormalsFlatRenderer.js";
|
|
15
15
|
import {VBOBatchingTrianglesColorTextureRenderer} from "./VBOBatchingTrianglesColorTextureRenderer.js";
|
|
16
|
-
import {VBOBatchingTrianglesSnapInitRenderer} from "./VBOBatchingTrianglesSnapInitRenderer";
|
|
17
|
-
import {VBOBatchingTrianglesSnapRenderer} from "./VBOBatchingTrianglesSnapRenderer";
|
|
16
|
+
import {VBOBatchingTrianglesSnapInitRenderer} from "./VBOBatchingTrianglesSnapInitRenderer.js";
|
|
17
|
+
import {VBOBatchingTrianglesSnapRenderer} from "./VBOBatchingTrianglesSnapRenderer.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @private
|
package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsRenderers.js
CHANGED
|
@@ -5,8 +5,8 @@ import {VBOInstancingPointsPickDepthRenderer} from "./VBOInstancingPointsPickDep
|
|
|
5
5
|
import {VBOInstancingPointsOcclusionRenderer} from "./VBOInstancingPointsOcclusionRenderer.js";
|
|
6
6
|
import {VBOInstancingPointsDepthRenderer} from "./VBOInstancingPointsDepthRenderer.js";
|
|
7
7
|
import {VBOInstancingPointsShadowRenderer} from "./VBOInstancingPointsShadowRenderer.js";
|
|
8
|
-
import {VBOInstancingPointsSnapInitRenderer} from "./VBOInstancingPointsSnapInitRenderer";
|
|
9
|
-
import {VBOInstancingPointsSnapRenderer} from "./VBOInstancingPointsSnapRenderer";
|
|
8
|
+
import {VBOInstancingPointsSnapInitRenderer} from "./VBOInstancingPointsSnapInitRenderer.js";
|
|
9
|
+
import {VBOInstancingPointsSnapRenderer} from "./VBOInstancingPointsSnapRenderer.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @private
|
|
@@ -286,10 +286,7 @@ export class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
|
|
|
286
286
|
}
|
|
287
287
|
src.push("in highp vec3 relativeToOriginPosition;");
|
|
288
288
|
src.push("layout(location = 0) out highp ivec4 outCoords;");
|
|
289
|
-
|
|
290
|
-
// TODO: normal placeholder?
|
|
291
|
-
// Primitive type?
|
|
292
|
-
///////////////////////////////////////////
|
|
289
|
+
src.push("layout(location = 1) out highp ivec4 outNormal;");
|
|
293
290
|
src.push("layout(location = 2) out lowp uvec4 outPickColor;");
|
|
294
291
|
src.push("void main(void) {");
|
|
295
292
|
if (clipping) {
|
|
@@ -311,6 +308,10 @@ export class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
|
|
|
311
308
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
312
309
|
}
|
|
313
310
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);")
|
|
311
|
+
// src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");
|
|
312
|
+
// src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");
|
|
313
|
+
// src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");
|
|
314
|
+
src.push(`outNormal = ivec4(1.0, 1.0, 1.0, 1.0);`);
|
|
314
315
|
src.push("outPickColor = uvec4(vPickColor);");
|
|
315
316
|
src.push("}");
|
|
316
317
|
return src;
|
package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesRenderers.js
CHANGED
|
@@ -13,8 +13,8 @@ import {VBOInstancingTrianglesShadowRenderer} from "./VBOInstancingTrianglesShad
|
|
|
13
13
|
import {VBOInstancingTrianglesPBRRenderer} from "./VBOInstancingTrianglesPBRRenderer.js";
|
|
14
14
|
import {VBOInstancingTrianglesPickNormalsFlatRenderer} from "./VBOInstancingTrianglesPickNormalsFlatRenderer.js";
|
|
15
15
|
import {VBOInstancingTrianglesColorTextureRenderer} from "./VBOInstancingTrianglesColorTextureRenderer.js";
|
|
16
|
-
import {VBOInstancingTrianglesSnapInitRenderer} from "./VBOInstancingTrianglesSnapInitRenderer";
|
|
17
|
-
import {VBOInstancingTrianglesSnapRenderer} from "./VBOInstancingTrianglesSnapRenderer";
|
|
16
|
+
import {VBOInstancingTrianglesSnapInitRenderer} from "./VBOInstancingTrianglesSnapInitRenderer.js";
|
|
17
|
+
import {VBOInstancingTrianglesSnapRenderer} from "./VBOInstancingTrianglesSnapRenderer.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @private
|