@cesium/engine 23.0.0 → 24.0.0
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/Build/Workers/{chunk-QTOHIXGF.js → chunk-2N4KDHS3.js} +10 -10
- package/Build/Workers/{chunk-SQTRWKO2.js → chunk-44EMEGKW.js} +5 -5
- package/Build/Workers/{chunk-OHBM4YG4.js → chunk-4TIG36AW.js} +12 -12
- package/Build/Workers/{chunk-BNBD2YZK.js → chunk-5A2SW66E.js} +16 -16
- package/Build/Workers/{chunk-52K3GJKG.js → chunk-5GXYJQ2K.js} +3 -3
- package/Build/Workers/{chunk-NQCAZU7S.js → chunk-63SIWPLS.js} +13 -13
- package/Build/Workers/{chunk-UEEGWJJP.js → chunk-6MPGQEHA.js} +2 -2
- package/Build/Workers/{chunk-PQVNT5CJ.js → chunk-6RMS4S72.js} +6 -6
- package/Build/Workers/{chunk-HYTFXWMY.js → chunk-6WLHJFD3.js} +7 -7
- package/Build/Workers/{chunk-DT5SJBKA.js → chunk-72VYSVEW.js} +9 -9
- package/Build/Workers/{chunk-JUGY5AZN.js → chunk-7MDYBRYJ.js} +4 -4
- package/Build/Workers/{chunk-6SLGTBB2.js → chunk-7O5XJTVE.js} +5 -5
- package/Build/Workers/{chunk-4UNQX2MP.js → chunk-7QRFIKWQ.js} +2 -2
- package/Build/Workers/{chunk-GN5NEUDT.js → chunk-7TYLCBGK.js} +8 -8
- package/Build/Workers/{chunk-SGKTBHFQ.js → chunk-7X322WP2.js} +13 -13
- package/Build/Workers/{chunk-T43FXHNC.js → chunk-A47HVBC5.js} +7 -7
- package/Build/Workers/{chunk-FSDVXW7M.js → chunk-AF3MU2RL.js} +5 -5
- package/Build/Workers/{chunk-3B65YFXC.js → chunk-AJLTU6PF.js} +1 -1
- package/Build/Workers/{chunk-OQ3EAJNW.js → chunk-AMIHNSST.js} +2 -2
- package/Build/Workers/{chunk-N4AWE7TZ.js → chunk-B6SCUUFP.js} +10 -10
- package/Build/Workers/{chunk-OMXN7YF4.js → chunk-BJD6QGXZ.js} +12 -12
- package/Build/Workers/{chunk-APDKMX7W.js → chunk-C6P4IG5P.js} +6 -6
- package/Build/Workers/{chunk-QA24Q62E.js → chunk-D4EJ2NXG.js} +17 -17
- package/Build/Workers/{chunk-HYLEKKO5.js → chunk-DHKPFLSJ.js} +1 -1
- package/Build/Workers/{chunk-MQJG522T.js → chunk-DVB56LG7.js} +6 -6
- package/Build/Workers/{chunk-Y5AJSEEN.js → chunk-EDXL4W76.js} +2 -2
- package/Build/Workers/{chunk-QQX7S5QT.js → chunk-EV3VGO6Y.js} +17 -17
- package/Build/Workers/{chunk-IFA7VHHP.js → chunk-GOQBUCXH.js} +10 -10
- package/Build/Workers/{chunk-5A7YSAXT.js → chunk-GQUNK2XC.js} +14 -14
- package/Build/Workers/{chunk-36LBFITA.js → chunk-HKUES6UG.js} +12 -12
- package/Build/Workers/{chunk-OC6X22PG.js → chunk-HRHRYFHS.js} +9 -9
- package/Build/Workers/{chunk-L7RDJ4V7.js → chunk-HXJMS2ZI.js} +1 -1
- package/Build/Workers/{chunk-NAYRNPEP.js → chunk-ILMFADZA.js} +4 -4
- package/Build/Workers/{chunk-AA33B6PU.js → chunk-ISY4EZCA.js} +4 -4
- package/Build/Workers/{chunk-7KRN6JPQ.js → chunk-J6AW5YHS.js} +14 -14
- package/Build/Workers/{chunk-OQBPOKPZ.js → chunk-JCI63T3K.js} +6 -6
- package/Build/Workers/{chunk-2WI4HGJU.js → chunk-KLPGTXS3.js} +6 -6
- package/Build/Workers/{chunk-5R7SBUTW.js → chunk-LIB2H534.js} +10 -10
- package/Build/Workers/{chunk-IYVDOB5V.js → chunk-LXMCPFFS.js} +4 -4
- package/Build/Workers/{chunk-NUYLNQKV.js → chunk-MKM27KGV.js} +2 -2
- package/Build/Workers/{chunk-R7M4XNPP.js → chunk-N65BAKSH.js} +8 -8
- package/Build/Workers/{chunk-4LGFX2P5.js → chunk-NKT5K3K3.js} +11 -11
- package/Build/Workers/{chunk-NNHU33JK.js → chunk-NPF7SSHZ.js} +7 -7
- package/Build/Workers/{chunk-LDQWNMEC.js → chunk-PVV64VFW.js} +1 -1
- package/Build/Workers/{chunk-WKXDCVBO.js → chunk-Q3C6VQH6.js} +4 -4
- package/Build/Workers/{chunk-ARCFIOKA.js → chunk-RQNJD3O4.js} +12 -12
- package/Build/Workers/{chunk-G3YT7M7A.js → chunk-UIGVOKKI.js} +1 -1
- package/Build/Workers/{chunk-ZIW5FCIW.js → chunk-UQU4RXLT.js} +27 -19
- package/Build/Workers/{chunk-MT5M7RLZ.js → chunk-VLDEUTOP.js} +2 -2
- package/Build/Workers/{chunk-5JP5FG7U.js → chunk-VMVOUQ5J.js} +7 -7
- package/Build/Workers/{chunk-2GL2EUEE.js → chunk-XJRBB253.js} +11 -11
- package/Build/Workers/{chunk-ESD4IEOU.js → chunk-XY6HMDGI.js} +5 -5
- package/Build/Workers/{chunk-56OHFSLH.js → chunk-Y7HNNPNK.js} +10 -10
- package/Build/Workers/{chunk-6FVFM2KB.js → chunk-YAOZMOFL.js} +5 -5
- package/Build/Workers/{chunk-AP6XWET5.js → chunk-YJZGW74L.js} +8 -8
- package/Build/Workers/{chunk-KPYU6YZG.js → chunk-YQFTYQMZ.js} +1 -1
- package/Build/Workers/{chunk-5VKZVPO5.js → chunk-ZBZRTRJB.js} +10 -10
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +25 -25
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +12 -12
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoundingSphere.js +1 -1
- package/Source/Core/Cartesian2.js +7 -5
- package/Source/Core/Cartesian3.js +8 -6
- package/Source/Core/Cartesian4.js +8 -6
- package/Source/Core/Color.js +5 -3
- package/Source/Core/DeveloperError.js +2 -1
- package/Source/Core/ITwinPlatform.js +1 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/S2Cell.js +2 -2
- package/Source/Core/TerrainMesh.js +10 -1
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/assert.js +27 -0
- package/Source/Core/globalTypes.js +4 -0
- package/Source/DataSources/CzmlDataSource.js +9 -0
- package/Source/DataSources/PathGraphics.js +13 -0
- package/Source/DataSources/PathVisualizer.js +330 -18
- package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +3 -1
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +3 -1
- package/Source/Renderer/Context.js +1 -1
- package/Source/Renderer/RenderState.js +2 -2
- package/Source/Renderer/VertexArray.js +80 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardCollection.js +65 -364
- package/Source/Scene/BufferPoint.js +148 -0
- package/Source/Scene/BufferPointCollection.js +135 -0
- package/Source/Scene/BufferPointMaterial.js +95 -0
- package/Source/Scene/BufferPolygon.js +516 -0
- package/Source/Scene/BufferPolygonCollection.js +368 -0
- package/Source/Scene/BufferPolygonMaterial.js +41 -0
- package/Source/Scene/BufferPolyline.js +185 -0
- package/Source/Scene/BufferPolylineCollection.js +136 -0
- package/Source/Scene/BufferPolylineMaterial.js +93 -0
- package/Source/Scene/BufferPrimitive.js +347 -0
- package/Source/Scene/BufferPrimitiveCollection.js +702 -0
- package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
- package/Source/Scene/Cesium3DTileContent.js +5 -1
- package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
- package/Source/Scene/Cesium3DTileStyle.js +22 -0
- package/Source/Scene/Cesium3DTileset.js +1 -0
- package/Source/Scene/ClippingPolygonCollection.js +270 -101
- package/Source/Scene/CubeMapPanorama.js +4 -4
- package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
- package/Source/Scene/GaussianSplatPrimitive.js +413 -70
- package/Source/Scene/GetFeatureInfoFormat.js +3 -3
- package/Source/Scene/GltfLoader.js +227 -34
- package/Source/Scene/GltfSpzLoader.js +109 -0
- package/Source/Scene/ITwinData.js +1 -0
- package/Source/Scene/Label.js +32 -0
- package/Source/Scene/LabelCollection.js +14 -13
- package/Source/Scene/Material.js +2 -0
- package/Source/Scene/Megatexture.js +1 -0
- package/Source/Scene/MetadataClassProperty.js +24 -10
- package/Source/Scene/MetadataComponentType.js +115 -23
- package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +761 -263
- package/Source/Scene/Model/MaterialPipelineStage.js +147 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +6 -0
- package/Source/Scene/Model/ModelReader.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +3 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +330 -0
- package/Source/Scene/ModelComponents.js +1632 -1542
- package/Source/Scene/PickedMetadataInfo.js +1 -0
- package/Source/Scene/ScreenSpaceCameraController.js +13 -0
- package/Source/Scene/SkyBox.js +17 -8
- package/Source/Scene/TileBoundingRegion.js +1 -1
- package/Source/Scene/TileBoundingS2Cell.js +1 -1
- package/Source/Scene/TileBoundingSphere.js +1 -1
- package/Source/Scene/TweenCollection.js +7 -0
- package/Source/Scene/VectorGltf3DTileContent.js +382 -0
- package/Source/Scene/VertexAttributeSemantic.js +14 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
- package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
- package/Source/Scene/parseStructuralMetadata.js +97 -37
- package/Source/Scene/renderBufferPointCollection.js +334 -0
- package/Source/Scene/renderBufferPolygonCollection.js +386 -0
- package/Source/Scene/renderBufferPolylineCollection.js +529 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
- package/Source/Shaders/BillboardCollectionFS.js +2 -77
- package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
- package/Source/Shaders/BillboardCollectionVS.js +2 -60
- package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
- package/Source/Shaders/BufferPointMaterialFS.js +29 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
- package/Source/Shaders/BufferPointMaterialVS.js +50 -0
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
- package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
- package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
- package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
- package/Source/Shaders/Model/ModelFS.glsl +15 -0
- package/Source/Shaders/Model/ModelFS.js +15 -0
- package/Source/Shaders/Model/ModelVS.glsl +8 -0
- package/Source/Shaders/Model/ModelVS.js +8 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
- package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
- package/Source/Shaders/Voxels/VoxelFS.js +1 -1
- package/Source/Workers/decodeDraco.js +3 -0
- package/Source/Workers/decodeI3S.js +5 -2
- package/index.d.ts +1007 -111
- package/index.js +368 -343
- package/package.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
in vec3 positionHigh;
|
|
2
|
+
in vec3 positionLow;
|
|
3
|
+
in vec3 prevPositionHigh;
|
|
4
|
+
in vec3 prevPositionLow;
|
|
5
|
+
in vec3 nextPositionHigh;
|
|
6
|
+
in vec3 nextPositionLow;
|
|
7
|
+
in vec4 pickColor;
|
|
8
|
+
in vec4 showColorWidthAndTexCoord;
|
|
9
|
+
|
|
10
|
+
out vec4 v_pickColor;
|
|
11
|
+
out vec4 v_color;
|
|
12
|
+
out vec2 v_st;
|
|
13
|
+
out float v_width;
|
|
14
|
+
out float v_polylineAngle;
|
|
15
|
+
|
|
16
|
+
void main()
|
|
17
|
+
{
|
|
18
|
+
float show = showColorWidthAndTexCoord.x;
|
|
19
|
+
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
|
|
20
|
+
float width = showColorWidthAndTexCoord.z;
|
|
21
|
+
float texCoord = showColorWidthAndTexCoord.w;
|
|
22
|
+
|
|
23
|
+
///////////////////////////////////////////////////////////////////////////
|
|
24
|
+
|
|
25
|
+
bool usePrevious = texCoord == 1.0;
|
|
26
|
+
float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;
|
|
27
|
+
float polylineAngle;
|
|
28
|
+
|
|
29
|
+
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
30
|
+
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
|
|
31
|
+
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
|
|
32
|
+
|
|
33
|
+
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
34
|
+
|
|
35
|
+
///////////////////////////////////////////////////////////////////////////
|
|
36
|
+
|
|
37
|
+
gl_Position = czm_viewportOrthographic * positionWC * show;
|
|
38
|
+
|
|
39
|
+
v_pickColor = pickColor / 255.0;
|
|
40
|
+
|
|
41
|
+
v_color = color;
|
|
42
|
+
v_color.a *= show;
|
|
43
|
+
|
|
44
|
+
v_st.s = texCoord;
|
|
45
|
+
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
|
|
46
|
+
|
|
47
|
+
v_width = width;
|
|
48
|
+
v_polylineAngle = polylineAngle;
|
|
49
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "in vec3 positionHigh;\n\
|
|
3
|
+
in vec3 positionLow;\n\
|
|
4
|
+
in vec3 prevPositionHigh;\n\
|
|
5
|
+
in vec3 prevPositionLow;\n\
|
|
6
|
+
in vec3 nextPositionHigh;\n\
|
|
7
|
+
in vec3 nextPositionLow;\n\
|
|
8
|
+
in vec4 pickColor;\n\
|
|
9
|
+
in vec4 showColorWidthAndTexCoord;\n\
|
|
10
|
+
\n\
|
|
11
|
+
out vec4 v_pickColor;\n\
|
|
12
|
+
out vec4 v_color;\n\
|
|
13
|
+
out vec2 v_st;\n\
|
|
14
|
+
out float v_width;\n\
|
|
15
|
+
out float v_polylineAngle;\n\
|
|
16
|
+
\n\
|
|
17
|
+
void main()\n\
|
|
18
|
+
{\n\
|
|
19
|
+
float show = showColorWidthAndTexCoord.x;\n\
|
|
20
|
+
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);\n\
|
|
21
|
+
float width = showColorWidthAndTexCoord.z;\n\
|
|
22
|
+
float texCoord = showColorWidthAndTexCoord.w;\n\
|
|
23
|
+
\n\
|
|
24
|
+
///////////////////////////////////////////////////////////////////////////\n\
|
|
25
|
+
\n\
|
|
26
|
+
bool usePrevious = texCoord == 1.0;\n\
|
|
27
|
+
float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;\n\
|
|
28
|
+
float polylineAngle;\n\
|
|
29
|
+
\n\
|
|
30
|
+
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);\n\
|
|
31
|
+
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);\n\
|
|
32
|
+
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);\n\
|
|
33
|
+
\n\
|
|
34
|
+
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
|
|
35
|
+
\n\
|
|
36
|
+
///////////////////////////////////////////////////////////////////////////\n\
|
|
37
|
+
\n\
|
|
38
|
+
gl_Position = czm_viewportOrthographic * positionWC * show;\n\
|
|
39
|
+
\n\
|
|
40
|
+
v_pickColor = pickColor / 255.0;\n\
|
|
41
|
+
\n\
|
|
42
|
+
v_color = color;\n\
|
|
43
|
+
v_color.a *= show;\n\
|
|
44
|
+
\n\
|
|
45
|
+
v_st.s = texCoord;\n\
|
|
46
|
+
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\n\
|
|
47
|
+
\n\
|
|
48
|
+
v_width = width;\n\
|
|
49
|
+
v_polylineAngle = polylineAngle;\n\
|
|
50
|
+
}\n\
|
|
51
|
+
";
|
|
@@ -13,59 +13,45 @@ void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
|
|
|
13
13
|
if (!u_isEdgePass) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
float edgeTypeInt = v_edgeType * 255.0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (edgeTypeInt < 0.5) { // HIDDEN (0)
|
|
23
|
-
edgeColor = vec4(0.0, 0.0, 0.0, 0.0); // Transparent for hidden edges
|
|
18
|
+
|
|
19
|
+
if (edgeTypeInt < 0.5) {
|
|
20
|
+
discard;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
vec3 viewDir = -normalize(v_positionEC);
|
|
32
|
-
|
|
33
|
-
// Calculate dot products to determine triangle facing
|
|
34
|
-
float dotA = dot(normalA, viewDir);
|
|
35
|
-
float dotB = dot(normalB, viewDir);
|
|
36
|
-
|
|
37
|
-
const float eps = 1e-3;
|
|
38
|
-
bool frontA = dotA > eps;
|
|
39
|
-
bool backA = dotA < -eps;
|
|
40
|
-
bool frontB = dotB > eps;
|
|
41
|
-
bool backB = dotB < -eps;
|
|
42
|
-
|
|
43
|
-
// True silhouette: one triangle front-facing, other back-facing
|
|
44
|
-
bool oppositeFacing = (frontA && backB) || (backA && frontB);
|
|
45
|
-
|
|
46
|
-
// Exclude edges where both triangles are nearly grazing (perpendicular to view)
|
|
47
|
-
// This handles the top-view cylinder case where both normals are ~horizontal
|
|
48
|
-
bool bothNearGrazing = (abs(dotA) <= eps && abs(dotB) <= eps);
|
|
49
|
-
|
|
50
|
-
if (!(oppositeFacing && !bothNearGrazing)) {
|
|
51
|
-
discard; // Not a true silhouette edge
|
|
52
|
-
} else {
|
|
53
|
-
// True silhouette
|
|
54
|
-
edgeColor = vec4(1.0, 0.0, 0.0, 1.0);
|
|
22
|
+
|
|
23
|
+
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate
|
|
24
|
+
// Silhouette check done in vertex shader
|
|
25
|
+
// v_shouldDiscard will be > 0.5 if this edge should be discarded
|
|
26
|
+
if (v_shouldDiscard > 0.5) {
|
|
27
|
+
discard;
|
|
55
28
|
}
|
|
56
29
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} else {
|
|
63
|
-
edgeColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
30
|
+
|
|
31
|
+
vec4 finalColor = color;
|
|
32
|
+
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
33
|
+
if (v_edgeColor.a >= 0.0) {
|
|
34
|
+
finalColor = v_edgeColor;
|
|
64
35
|
}
|
|
36
|
+
#endif
|
|
65
37
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
38
|
+
#ifdef HAS_LINE_PATTERN
|
|
39
|
+
// Pattern is 16-bit, each bit represents visibility at that position
|
|
40
|
+
const float maskLength = 16.0;
|
|
41
|
+
|
|
42
|
+
// Get the relative position within the dash from 0 to 1
|
|
43
|
+
float dashPosition = fract(v_lineCoord / maskLength);
|
|
44
|
+
// Figure out the mask index
|
|
45
|
+
float maskIndex = floor(dashPosition * maskLength);
|
|
46
|
+
// Test the bit mask
|
|
47
|
+
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
48
|
+
|
|
49
|
+
// If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)
|
|
50
|
+
if (mod(maskTest, 2.0) < 1.0) {
|
|
51
|
+
discard;
|
|
52
|
+
}
|
|
53
|
+
#endif
|
|
54
|
+
color = finalColor;
|
|
69
55
|
|
|
70
56
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
|
|
71
57
|
// Write edge metadata
|
|
@@ -80,4 +66,4 @@ void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
|
|
|
80
66
|
out_edgeDepth = czm_packDepth(gl_FragCoord.z);
|
|
81
67
|
#endif
|
|
82
68
|
#endif
|
|
83
|
-
}
|
|
69
|
+
}
|
|
@@ -14,59 +14,45 @@ void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)\n\
|
|
|
14
14
|
if (!u_isEdgePass) {\n\
|
|
15
15
|
return;\n\
|
|
16
16
|
}\n\
|
|
17
|
-
|
|
17
|
+
\n\
|
|
18
18
|
float edgeTypeInt = v_edgeType * 255.0;\n\
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
\n\
|
|
23
|
-
if (edgeTypeInt < 0.5) { // HIDDEN (0)\n\
|
|
24
|
-
edgeColor = vec4(0.0, 0.0, 0.0, 0.0); // Transparent for hidden edges\n\
|
|
19
|
+
\n\
|
|
20
|
+
if (edgeTypeInt < 0.5) {\n\
|
|
21
|
+
discard;\n\
|
|
25
22
|
}\n\
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
\n\
|
|
31
|
-
|
|
32
|
-
vec3 viewDir = -normalize(v_positionEC);\n\
|
|
33
|
-
\n\
|
|
34
|
-
// Calculate dot products to determine triangle facing\n\
|
|
35
|
-
float dotA = dot(normalA, viewDir);\n\
|
|
36
|
-
float dotB = dot(normalB, viewDir);\n\
|
|
37
|
-
\n\
|
|
38
|
-
const float eps = 1e-3;\n\
|
|
39
|
-
bool frontA = dotA > eps;\n\
|
|
40
|
-
bool backA = dotA < -eps;\n\
|
|
41
|
-
bool frontB = dotB > eps;\n\
|
|
42
|
-
bool backB = dotB < -eps;\n\
|
|
43
|
-
\n\
|
|
44
|
-
// True silhouette: one triangle front-facing, other back-facing\n\
|
|
45
|
-
bool oppositeFacing = (frontA && backB) || (backA && frontB);\n\
|
|
46
|
-
\n\
|
|
47
|
-
// Exclude edges where both triangles are nearly grazing (perpendicular to view)\n\
|
|
48
|
-
// This handles the top-view cylinder case where both normals are ~horizontal\n\
|
|
49
|
-
bool bothNearGrazing = (abs(dotA) <= eps && abs(dotB) <= eps);\n\
|
|
50
|
-
\n\
|
|
51
|
-
if (!(oppositeFacing && !bothNearGrazing)) {\n\
|
|
52
|
-
discard; // Not a true silhouette edge\n\
|
|
53
|
-
} else {\n\
|
|
54
|
-
// True silhouette\n\
|
|
55
|
-
edgeColor = vec4(1.0, 0.0, 0.0, 1.0);\n\
|
|
23
|
+
\n\
|
|
24
|
+
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate\n\
|
|
25
|
+
// Silhouette check done in vertex shader\n\
|
|
26
|
+
// v_shouldDiscard will be > 0.5 if this edge should be discarded\n\
|
|
27
|
+
if (v_shouldDiscard > 0.5) {\n\
|
|
28
|
+
discard;\n\
|
|
56
29
|
}\n\
|
|
57
30
|
}\n\
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} else {\n\
|
|
64
|
-
edgeColor = vec4(0.0, 0.0, 0.0, 0.0);\n\
|
|
31
|
+
\n\
|
|
32
|
+
vec4 finalColor = color;\n\
|
|
33
|
+
#ifdef HAS_EDGE_COLOR_ATTRIBUTE\n\
|
|
34
|
+
if (v_edgeColor.a >= 0.0) {\n\
|
|
35
|
+
finalColor = v_edgeColor;\n\
|
|
65
36
|
}\n\
|
|
37
|
+
#endif\n\
|
|
66
38
|
\n\
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
39
|
+
#ifdef HAS_LINE_PATTERN\n\
|
|
40
|
+
// Pattern is 16-bit, each bit represents visibility at that position\n\
|
|
41
|
+
const float maskLength = 16.0;\n\
|
|
42
|
+
\n\
|
|
43
|
+
// Get the relative position within the dash from 0 to 1\n\
|
|
44
|
+
float dashPosition = fract(v_lineCoord / maskLength);\n\
|
|
45
|
+
// Figure out the mask index\n\
|
|
46
|
+
float maskIndex = floor(dashPosition * maskLength);\n\
|
|
47
|
+
// Test the bit mask\n\
|
|
48
|
+
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));\n\
|
|
49
|
+
\n\
|
|
50
|
+
// If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)\n\
|
|
51
|
+
if (mod(maskTest, 2.0) < 1.0) {\n\
|
|
52
|
+
discard;\n\
|
|
53
|
+
}\n\
|
|
54
|
+
#endif\n\
|
|
55
|
+
color = finalColor;\n\
|
|
70
56
|
\n\
|
|
71
57
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)\n\
|
|
72
58
|
// Write edge metadata\n\
|
|
@@ -81,5 +67,4 @@ void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)\n\
|
|
|
81
67
|
out_edgeDepth = czm_packDepth(gl_FragCoord.z);\n\
|
|
82
68
|
#endif\n\
|
|
83
69
|
#endif\n\
|
|
84
|
-
}
|
|
85
|
-
";
|
|
70
|
+
}";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#ifdef HAS_EDGE_VISIBILITY
|
|
2
|
+
void edgeVisibilityStageVS() {
|
|
3
|
+
if (!u_isEdgePass) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
v_edgeType = a_edgeType;
|
|
8
|
+
v_silhouetteNormalView = czm_normal * a_silhouetteNormal;
|
|
9
|
+
v_faceNormalAView = czm_normal * a_faceNormalA;
|
|
10
|
+
v_faceNormalBView = czm_normal * a_faceNormalB;
|
|
11
|
+
v_edgeOffset = a_edgeOffset;
|
|
12
|
+
|
|
13
|
+
// Silhouette detection: check both endpoints of the edge
|
|
14
|
+
v_shouldDiscard = 0.0;
|
|
15
|
+
float edgeTypeInt = a_edgeType * 255.0;
|
|
16
|
+
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {
|
|
17
|
+
vec3 normalA = normalize(v_faceNormalAView);
|
|
18
|
+
vec3 normalB = normalize(v_faceNormalBView);
|
|
19
|
+
const float perpTol = 2.5e-4;
|
|
20
|
+
|
|
21
|
+
// Check at current vertex (first endpoint)
|
|
22
|
+
vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);
|
|
23
|
+
vec3 toEye1 = normalize(-currentPosEC.xyz);
|
|
24
|
+
float dotA1 = dot(normalA, toEye1);
|
|
25
|
+
float dotB1 = dot(normalB, toEye1);
|
|
26
|
+
|
|
27
|
+
// Check at other vertex (second endpoint)
|
|
28
|
+
vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);
|
|
29
|
+
vec3 toEye2 = normalize(-otherPosEC.xyz);
|
|
30
|
+
float dotA2 = dot(normalA, toEye2);
|
|
31
|
+
float dotB2 = dot(normalB, toEye2);
|
|
32
|
+
|
|
33
|
+
// Discard if EITHER endpoint is non-silhouette
|
|
34
|
+
if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {
|
|
35
|
+
v_shouldDiscard = 1.0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#ifdef HAS_EDGE_FEATURE_ID
|
|
40
|
+
v_featureId_0 = a_edgeFeatureId;
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
44
|
+
v_edgeColor = a_edgeColor;
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#ifdef HAS_LINE_PATTERN
|
|
48
|
+
#ifdef HAS_EDGE_CUMULATIVE_DISTANCE
|
|
49
|
+
v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;
|
|
50
|
+
#else
|
|
51
|
+
vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);
|
|
52
|
+
vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
53
|
+
|
|
54
|
+
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
55
|
+
vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
56
|
+
vec2 windowDir = otherScreen - currentScreen;
|
|
57
|
+
|
|
58
|
+
const float textureCoordinateBase = 8192.0;
|
|
59
|
+
if (abs(windowDir.x) > abs(windowDir.y)) {
|
|
60
|
+
v_lineCoord = textureCoordinateBase + currentScreen.x;
|
|
61
|
+
} else {
|
|
62
|
+
v_lineCoord = textureCoordinateBase + currentScreen.y;
|
|
63
|
+
}
|
|
64
|
+
#endif
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
// Expand vertex to form quad
|
|
68
|
+
vec4 posClip = gl_Position;
|
|
69
|
+
|
|
70
|
+
if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {
|
|
71
|
+
vec4 currentClip = posClip;
|
|
72
|
+
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
73
|
+
|
|
74
|
+
vec2 currentNDC = currentClip.xy / currentClip.w;
|
|
75
|
+
vec2 otherNDC = otherClip.xy / otherClip.w;
|
|
76
|
+
|
|
77
|
+
vec2 edgeDirNDC = otherNDC - currentNDC;
|
|
78
|
+
|
|
79
|
+
// Ensure consistent edge direction
|
|
80
|
+
if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {
|
|
81
|
+
edgeDirNDC = -edgeDirNDC;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
edgeDirNDC = normalize(edgeDirNDC);
|
|
85
|
+
vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);
|
|
86
|
+
|
|
87
|
+
// Convert line width from pixels to clip space
|
|
88
|
+
float lineWidthPixels = u_lineWidth;
|
|
89
|
+
vec2 viewportSize = czm_viewport.zw;
|
|
90
|
+
vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;
|
|
91
|
+
vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;
|
|
92
|
+
|
|
93
|
+
posClip.xy += offsetClip;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
gl_Position = posClip;
|
|
97
|
+
}
|
|
98
|
+
#endif
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "#ifdef HAS_EDGE_VISIBILITY\n\
|
|
3
|
+
void edgeVisibilityStageVS() {\n\
|
|
4
|
+
if (!u_isEdgePass) {\n\
|
|
5
|
+
return;\n\
|
|
6
|
+
}\n\
|
|
7
|
+
\n\
|
|
8
|
+
v_edgeType = a_edgeType;\n\
|
|
9
|
+
v_silhouetteNormalView = czm_normal * a_silhouetteNormal;\n\
|
|
10
|
+
v_faceNormalAView = czm_normal * a_faceNormalA;\n\
|
|
11
|
+
v_faceNormalBView = czm_normal * a_faceNormalB;\n\
|
|
12
|
+
v_edgeOffset = a_edgeOffset;\n\
|
|
13
|
+
\n\
|
|
14
|
+
// Silhouette detection: check both endpoints of the edge\n\
|
|
15
|
+
v_shouldDiscard = 0.0;\n\
|
|
16
|
+
float edgeTypeInt = a_edgeType * 255.0;\n\
|
|
17
|
+
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {\n\
|
|
18
|
+
vec3 normalA = normalize(v_faceNormalAView);\n\
|
|
19
|
+
vec3 normalB = normalize(v_faceNormalBView);\n\
|
|
20
|
+
const float perpTol = 2.5e-4;\n\
|
|
21
|
+
\n\
|
|
22
|
+
// Check at current vertex (first endpoint)\n\
|
|
23
|
+
vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);\n\
|
|
24
|
+
vec3 toEye1 = normalize(-currentPosEC.xyz);\n\
|
|
25
|
+
float dotA1 = dot(normalA, toEye1);\n\
|
|
26
|
+
float dotB1 = dot(normalB, toEye1);\n\
|
|
27
|
+
\n\
|
|
28
|
+
// Check at other vertex (second endpoint)\n\
|
|
29
|
+
vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);\n\
|
|
30
|
+
vec3 toEye2 = normalize(-otherPosEC.xyz);\n\
|
|
31
|
+
float dotA2 = dot(normalA, toEye2);\n\
|
|
32
|
+
float dotB2 = dot(normalB, toEye2);\n\
|
|
33
|
+
\n\
|
|
34
|
+
// Discard if EITHER endpoint is non-silhouette\n\
|
|
35
|
+
if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {\n\
|
|
36
|
+
v_shouldDiscard = 1.0;\n\
|
|
37
|
+
}\n\
|
|
38
|
+
}\n\
|
|
39
|
+
\n\
|
|
40
|
+
#ifdef HAS_EDGE_FEATURE_ID\n\
|
|
41
|
+
v_featureId_0 = a_edgeFeatureId;\n\
|
|
42
|
+
#endif\n\
|
|
43
|
+
\n\
|
|
44
|
+
#ifdef HAS_EDGE_COLOR_ATTRIBUTE\n\
|
|
45
|
+
v_edgeColor = a_edgeColor;\n\
|
|
46
|
+
#endif\n\
|
|
47
|
+
\n\
|
|
48
|
+
#ifdef HAS_LINE_PATTERN\n\
|
|
49
|
+
#ifdef HAS_EDGE_CUMULATIVE_DISTANCE\n\
|
|
50
|
+
v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;\n\
|
|
51
|
+
#else\n\
|
|
52
|
+
vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);\n\
|
|
53
|
+
vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;\n\
|
|
54
|
+
\n\
|
|
55
|
+
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);\n\
|
|
56
|
+
vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;\n\
|
|
57
|
+
vec2 windowDir = otherScreen - currentScreen;\n\
|
|
58
|
+
\n\
|
|
59
|
+
const float textureCoordinateBase = 8192.0;\n\
|
|
60
|
+
if (abs(windowDir.x) > abs(windowDir.y)) {\n\
|
|
61
|
+
v_lineCoord = textureCoordinateBase + currentScreen.x;\n\
|
|
62
|
+
} else {\n\
|
|
63
|
+
v_lineCoord = textureCoordinateBase + currentScreen.y;\n\
|
|
64
|
+
}\n\
|
|
65
|
+
#endif\n\
|
|
66
|
+
#endif\n\
|
|
67
|
+
\n\
|
|
68
|
+
// Expand vertex to form quad\n\
|
|
69
|
+
vec4 posClip = gl_Position;\n\
|
|
70
|
+
\n\
|
|
71
|
+
if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {\n\
|
|
72
|
+
vec4 currentClip = posClip;\n\
|
|
73
|
+
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);\n\
|
|
74
|
+
\n\
|
|
75
|
+
vec2 currentNDC = currentClip.xy / currentClip.w;\n\
|
|
76
|
+
vec2 otherNDC = otherClip.xy / otherClip.w;\n\
|
|
77
|
+
\n\
|
|
78
|
+
vec2 edgeDirNDC = otherNDC - currentNDC;\n\
|
|
79
|
+
\n\
|
|
80
|
+
// Ensure consistent edge direction\n\
|
|
81
|
+
if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {\n\
|
|
82
|
+
edgeDirNDC = -edgeDirNDC;\n\
|
|
83
|
+
}\n\
|
|
84
|
+
\n\
|
|
85
|
+
edgeDirNDC = normalize(edgeDirNDC);\n\
|
|
86
|
+
vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);\n\
|
|
87
|
+
\n\
|
|
88
|
+
// Convert line width from pixels to clip space\n\
|
|
89
|
+
float lineWidthPixels = u_lineWidth;\n\
|
|
90
|
+
vec2 viewportSize = czm_viewport.zw;\n\
|
|
91
|
+
vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;\n\
|
|
92
|
+
vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;\n\
|
|
93
|
+
\n\
|
|
94
|
+
posClip.xy += offsetClip;\n\
|
|
95
|
+
}\n\
|
|
96
|
+
\n\
|
|
97
|
+
gl_Position = posClip;\n\
|
|
98
|
+
}\n\
|
|
99
|
+
#endif\n\
|
|
100
|
+
";
|
|
@@ -25,6 +25,19 @@ vec4 handleAlpha(vec3 color, float alpha)
|
|
|
25
25
|
return vec4(color, alpha);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
void lineStyleStage()
|
|
29
|
+
{
|
|
30
|
+
#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)
|
|
31
|
+
const float maskLength = 16.0;
|
|
32
|
+
float dashPosition = fract(v_lineCoord / maskLength);
|
|
33
|
+
float maskIndex = floor(dashPosition * maskLength);
|
|
34
|
+
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
35
|
+
if (mod(maskTest, 2.0) < 1.0) {
|
|
36
|
+
discard;
|
|
37
|
+
}
|
|
38
|
+
#endif
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
SelectedFeature selectedFeature;
|
|
29
42
|
|
|
30
43
|
void main()
|
|
@@ -107,6 +120,8 @@ void main()
|
|
|
107
120
|
// When picking metadata END
|
|
108
121
|
//========================================================================
|
|
109
122
|
|
|
123
|
+
lineStyleStage();
|
|
124
|
+
|
|
110
125
|
#ifdef HAS_CLIPPING_PLANES
|
|
111
126
|
modelClippingPlanesStage(color);
|
|
112
127
|
#endif
|
|
@@ -26,6 +26,19 @@ vec4 handleAlpha(vec3 color, float alpha)\n\
|
|
|
26
26
|
return vec4(color, alpha);\n\
|
|
27
27
|
}\n\
|
|
28
28
|
\n\
|
|
29
|
+
void lineStyleStage()\n\
|
|
30
|
+
{\n\
|
|
31
|
+
#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)\n\
|
|
32
|
+
const float maskLength = 16.0;\n\
|
|
33
|
+
float dashPosition = fract(v_lineCoord / maskLength);\n\
|
|
34
|
+
float maskIndex = floor(dashPosition * maskLength);\n\
|
|
35
|
+
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));\n\
|
|
36
|
+
if (mod(maskTest, 2.0) < 1.0) {\n\
|
|
37
|
+
discard;\n\
|
|
38
|
+
}\n\
|
|
39
|
+
#endif\n\
|
|
40
|
+
}\n\
|
|
41
|
+
\n\
|
|
29
42
|
SelectedFeature selectedFeature;\n\
|
|
30
43
|
\n\
|
|
31
44
|
void main()\n\
|
|
@@ -107,6 +120,8 @@ void main()\n\
|
|
|
107
120
|
#endif\n\
|
|
108
121
|
// When picking metadata END\n\
|
|
109
122
|
//========================================================================\n\
|
|
123
|
+
\n\
|
|
124
|
+
lineStyleStage();\n\
|
|
110
125
|
\n\
|
|
111
126
|
#ifdef HAS_CLIPPING_PLANES\n\
|
|
112
127
|
modelClippingPlanesStage(color);\n\
|
|
@@ -110,6 +110,10 @@ void main()
|
|
|
110
110
|
// This returns the value that will be assigned to gl_Position.
|
|
111
111
|
vec4 positionClip = geometryStage(attributes, modelView, normal);
|
|
112
112
|
|
|
113
|
+
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
|
|
114
|
+
lineStyleStageVS(attributes);
|
|
115
|
+
#endif
|
|
116
|
+
|
|
113
117
|
// This must go after the geometry stage as it needs v_positionWC
|
|
114
118
|
#ifdef HAS_ATMOSPHERE
|
|
115
119
|
atmosphereStage(attributes);
|
|
@@ -157,6 +161,10 @@ void main()
|
|
|
157
161
|
// We will discard points with v_pointCloudShow == 0 in the fragment shader.
|
|
158
162
|
gl_Position = positionClip;
|
|
159
163
|
|
|
164
|
+
#ifdef HAS_EDGE_VISIBILITY
|
|
165
|
+
edgeVisibilityStageVS();
|
|
166
|
+
#endif
|
|
167
|
+
|
|
160
168
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
161
169
|
v_pointCloudShow = show;
|
|
162
170
|
#endif
|
|
@@ -110,6 +110,10 @@ void main()\n\
|
|
|
110
110
|
// Compute the final position in each coordinate system needed.\n\
|
|
111
111
|
// This returns the value that will be assigned to gl_Position.\n\
|
|
112
112
|
vec4 positionClip = geometryStage(attributes, modelView, normal);\n\
|
|
113
|
+
\n\
|
|
114
|
+
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)\n\
|
|
115
|
+
lineStyleStageVS(attributes);\n\
|
|
116
|
+
#endif\n\
|
|
113
117
|
\n\
|
|
114
118
|
// This must go after the geometry stage as it needs v_positionWC\n\
|
|
115
119
|
#ifdef HAS_ATMOSPHERE\n\
|
|
@@ -157,6 +161,10 @@ void main()\n\
|
|
|
157
161
|
//\n\
|
|
158
162
|
// We will discard points with v_pointCloudShow == 0 in the fragment shader.\n\
|
|
159
163
|
gl_Position = positionClip;\n\
|
|
164
|
+
\n\
|
|
165
|
+
#ifdef HAS_EDGE_VISIBILITY\n\
|
|
166
|
+
edgeVisibilityStageVS();\n\
|
|
167
|
+
#endif\n\
|
|
160
168
|
\n\
|
|
161
169
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE\n\
|
|
162
170
|
v_pointCloudShow = show;\n\
|