@cesium/engine 24.0.0 → 26.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-6WLHJFD3.js → chunk-3VFEWOBI.js} +59 -32
- package/Build/Workers/{chunk-UQU4RXLT.js → chunk-424RNO3D.js} +50 -45
- package/Build/Workers/chunk-4MGMYHOO.js +147 -0
- package/Build/Workers/{chunk-AMIHNSST.js → chunk-4S7IE3LB.js} +2 -2
- package/Build/Workers/{chunk-J6AW5YHS.js → chunk-52JDLOEM.js} +14 -14
- package/Build/Workers/{chunk-6RMS4S72.js → chunk-54I6Y66F.js} +6 -6
- package/Build/Workers/{chunk-C6P4IG5P.js → chunk-6YEE6JDR.js} +6 -6
- package/Build/Workers/{chunk-72VYSVEW.js → chunk-7J2HKPRH.js} +11 -10
- package/Build/Workers/{chunk-7O5XJTVE.js → chunk-7WM2PX4V.js} +5 -5
- package/Build/Workers/{chunk-5A2SW66E.js → chunk-ACXQXN46.js} +16 -16
- package/Build/Workers/{chunk-VLDEUTOP.js → chunk-AYKR4VBR.js} +2 -2
- package/Build/Workers/{chunk-YQFTYQMZ.js → chunk-C6J67V5A.js} +3 -2
- package/Build/Workers/{chunk-D4EJ2NXG.js → chunk-C6KNZ7T4.js} +17 -17
- package/Build/Workers/{chunk-7MDYBRYJ.js → chunk-CFQP6LYM.js} +4 -4
- package/Build/Workers/{chunk-YAOZMOFL.js → chunk-CXOYE2WM.js} +5 -5
- package/Build/Workers/{chunk-B6SCUUFP.js → chunk-CZEYZU4N.js} +10 -10
- package/Build/Workers/{chunk-NPF7SSHZ.js → chunk-DBOEKL43.js} +7 -7
- package/Build/Workers/{chunk-44EMEGKW.js → chunk-DDWSZVMY.js} +5 -5
- package/Build/Workers/{chunk-7X322WP2.js → chunk-DOBXCNC3.js} +13 -13
- package/Build/Workers/{chunk-JCI63T3K.js → chunk-E7VQ76KE.js} +6 -6
- package/Build/Workers/{chunk-7TYLCBGK.js → chunk-EBSIOBXY.js} +12 -10
- package/Build/Workers/{chunk-GQUNK2XC.js → chunk-EF2QYXGA.js} +14 -14
- package/Build/Workers/{chunk-BJD6QGXZ.js → chunk-EPYXRCDB.js} +12 -12
- package/Build/Workers/{chunk-63SIWPLS.js → chunk-F6QDY6HU.js} +13 -13
- package/Build/Workers/{chunk-XY6HMDGI.js → chunk-FRQZECAO.js} +5 -5
- package/Build/Workers/{chunk-VMVOUQ5J.js → chunk-G7PXZRVF.js} +7 -7
- package/Build/Workers/{chunk-N65BAKSH.js → chunk-INUEEEQA.js} +8 -8
- package/Build/Workers/{chunk-7QRFIKWQ.js → chunk-IRBKFCEJ.js} +2 -2
- package/Build/Workers/{chunk-UIGVOKKI.js → chunk-IYOUHCZB.js} +3 -2
- package/Build/Workers/{chunk-5GXYJQ2K.js → chunk-J6BWOHUF.js} +3 -3
- package/Build/Workers/{chunk-A47HVBC5.js → chunk-KFSTQKNM.js} +7 -7
- package/Build/Workers/{chunk-EV3VGO6Y.js → chunk-KKOSKAZB.js} +17 -17
- package/Build/Workers/{chunk-6MPGQEHA.js → chunk-KSSWJIZW.js} +2 -2
- package/Build/Workers/{chunk-DHKPFLSJ.js → chunk-M3B5JKSM.js} +3 -2
- package/Build/Workers/chunk-MPZHGZU6.js +2342 -0
- package/Build/Workers/{chunk-YJZGW74L.js → chunk-MYP774IS.js} +2213 -1349
- package/Build/Workers/{chunk-LIB2H534.js → chunk-O3EA5HS7.js} +12 -11
- package/Build/Workers/{chunk-ILMFADZA.js → chunk-P3CK7MCY.js} +27 -5
- package/Build/Workers/chunk-Q3PY526V.js +3201 -0
- package/Build/Workers/chunk-QN67VG36.js +973 -0
- package/Build/Workers/{chunk-XJRBB253.js → chunk-QRWGUWI6.js} +11 -11
- package/Build/Workers/{chunk-AF3MU2RL.js → chunk-S4MCOY6I.js} +7 -6
- package/Build/Workers/{chunk-Y7HNNPNK.js → chunk-SMQZZOW6.js} +10 -10
- package/Build/Workers/{chunk-PVV64VFW.js → chunk-TKKIREQ6.js} +3 -2
- package/Build/Workers/{chunk-MKM27KGV.js → chunk-U3ZA64U7.js} +2 -2
- package/Build/Workers/{chunk-2N4KDHS3.js → chunk-UA25D5MX.js} +12 -11
- package/Build/Workers/{chunk-RQNJD3O4.js → chunk-UOOIQ3KX.js} +12 -12
- package/Build/Workers/{chunk-GOQBUCXH.js → chunk-V7VQKN6N.js} +709 -431
- package/Build/Workers/{chunk-LXMCPFFS.js → chunk-VQYETPWC.js} +4 -4
- package/Build/Workers/{chunk-NKT5K3K3.js → chunk-VWV2IJRB.js} +13 -12
- package/Build/Workers/chunk-XZMBNNDX.js +1287 -0
- package/Build/Workers/{chunk-ISY4EZCA.js → chunk-Y57HREW5.js} +4 -4
- package/Build/Workers/{chunk-EDXL4W76.js → chunk-Y5BF6AFU.js} +2 -2
- package/Build/Workers/{chunk-Q3C6VQH6.js → chunk-YLY7NKAB.js} +4 -4
- package/Build/Workers/{chunk-4TIG36AW.js → chunk-ZK3CF7ZD.js} +12 -12
- package/Build/Workers/{chunk-AJLTU6PF.js → chunk-ZP7JMQV4.js} +4 -1
- package/Build/Workers/{chunk-HXJMS2ZI.js → chunk-ZZ46LWL6.js} +1 -1
- 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 +175 -118
- 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 +24 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- 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 +12 -9
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/ArcType.js +6 -1
- package/Source/Core/ArticulationStageType.js +5 -1
- package/Source/Core/AssociativeArray.js +100 -94
- package/Source/Core/BoundingSphere.js +1296 -1300
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +2 -3
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Cartographic.js +257 -249
- package/Source/Core/ClockRange.js +6 -1
- package/Source/Core/ClockStep.js +6 -1
- package/Source/Core/Color.js +844 -835
- package/Source/Core/ComponentDatatype.js +39 -1
- package/Source/Core/CornerType.js +6 -1
- package/Source/Core/Credit.js +121 -124
- package/Source/Core/Ellipsoid.js +637 -660
- package/Source/Core/ExtrapolationType.js +6 -1
- package/Source/Core/GeocodeType.js +6 -1
- package/Source/Core/GeographicProjection.js +74 -74
- package/Source/Core/GeographicTilingScheme.js +179 -198
- package/Source/Core/GeometryOffsetAttribute.js +7 -1
- package/Source/Core/GeometryType.js +7 -1
- package/Source/Core/HeightmapEncoding.js +6 -1
- package/Source/Core/Iau2006XysData.js +24 -13
- package/Source/Core/IndexDatatype.js +3 -1
- package/Source/Core/InterpolationType.js +5 -1
- package/Source/Core/Intersect.js +6 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonGeocodeProviderType.js +5 -1
- package/Source/Core/JulianDate.js +850 -848
- package/Source/Core/KeyboardEventModifier.js +6 -1
- package/Source/Core/MapProjection.js +40 -44
- package/Source/Core/Matrix2.js +906 -893
- package/Source/Core/Matrix3.js +1643 -1575
- package/Source/Core/Matrix4.js +2903 -2872
- package/Source/Core/PixelFormat.js +3 -1
- package/Source/Core/PrimitiveType.js +11 -1
- package/Source/Core/Ray.js +62 -60
- package/Source/Core/Rectangle.js +913 -904
- package/Source/Core/ReferenceFrame.js +6 -1
- package/Source/Core/RequestScheduler.js +8 -3
- package/Source/Core/RequestState.js +6 -1
- package/Source/Core/RequestType.js +6 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/ScreenSpaceEventType.js +6 -1
- package/Source/Core/TerrainQuantization.js +6 -1
- package/Source/Core/TilingScheme.js +100 -98
- package/Source/Core/TimeConstants.js +6 -1
- package/Source/Core/TimeStandard.js +6 -1
- package/Source/Core/TrackingReferenceFrame.js +6 -1
- package/Source/Core/Visibility.js +6 -1
- package/Source/Core/VulkanConstants.js +6 -1
- package/Source/Core/WebGLConstants.js +6 -1
- package/Source/Core/WebMercatorProjection.js +108 -109
- package/Source/Core/WebMercatorTilingScheme.js +246 -242
- package/Source/Core/WindingOrder.js +3 -1
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +1 -0
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +1 -0
- package/Source/DataSources/StripeOrientation.js +6 -1
- package/Source/Renderer/BufferUsage.js +20 -9
- package/Source/Renderer/Context.js +2 -29
- package/Source/Renderer/DrawCommand.js +435 -403
- package/Source/Renderer/MipmapHint.js +5 -1
- package/Source/Renderer/Pass.js +10 -3
- package/Source/Renderer/PickId.js +44 -0
- package/Source/Renderer/PixelDatatype.js +3 -1
- package/Source/Renderer/RenderbufferFormat.js +5 -1
- package/Source/Renderer/ShaderDestination.js +4 -1
- package/Source/Renderer/TextureMagnificationFilter.js +3 -1
- package/Source/Renderer/TextureMinificationFilter.js +3 -1
- package/Source/Renderer/TextureWrap.js +5 -1
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/AlphaMode.js +5 -1
- package/Source/Scene/ArcGisBaseMapType.js +6 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/AttributeType.js +3 -1
- package/Source/Scene/Axis.js +3 -1
- package/Source/Scene/BingMapsStyle.js +6 -1
- package/Source/Scene/BlendEquation.js +6 -1
- package/Source/Scene/BlendFunction.js +6 -1
- package/Source/Scene/BlendOption.js +6 -1
- package/Source/Scene/BlendingState.js +6 -1
- package/Source/Scene/BufferLoader.js +0 -2
- package/Source/Scene/BufferPoint.js +1 -0
- package/Source/Scene/BufferPointCollection.js +17 -1
- package/Source/Scene/BufferPolygon.js +3 -2
- package/Source/Scene/BufferPolygonCollection.js +13 -1
- package/Source/Scene/BufferPolyline.js +1 -0
- package/Source/Scene/BufferPolylineCollection.js +5 -1
- package/Source/Scene/BufferPrimitiveCollection.js +210 -43
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraEventType.js +6 -1
- package/Source/Scene/Cesium3DTile.js +54 -1
- package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileContentState.js +6 -1
- package/Source/Scene/Cesium3DTileContentType.js +3 -1
- package/Source/Scene/Cesium3DTileFeature.js +289 -306
- package/Source/Scene/Cesium3DTileOptimizationHint.js +6 -1
- package/Source/Scene/Cesium3DTilePass.js +5 -1
- package/Source/Scene/Cesium3DTilePointFeature.js +433 -511
- package/Source/Scene/Cesium3DTileRefine.js +6 -1
- package/Source/Scene/Cesium3DTileVectorFeature.js +586 -0
- package/Source/Scene/Cesium3DTileset.js +46 -6
- package/Source/Scene/ClassificationType.js +3 -1
- package/Source/Scene/CloudType.js +3 -1
- package/Source/Scene/ColorBlendMode.js +4 -1
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/CullFace.js +6 -1
- package/Source/Scene/DepthFunction.js +6 -1
- package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/EquirectangularPanorama.js +1 -0
- package/Source/Scene/ExpressionNodeType.js +6 -1
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/GltfBufferViewLoader.js +0 -2
- package/Source/Scene/GltfDracoLoader.js +0 -2
- package/Source/Scene/GltfImageLoader.js +0 -3
- package/Source/Scene/GltfIndexBufferLoader.js +0 -4
- package/Source/Scene/GltfJsonLoader.js +0 -2
- package/Source/Scene/GltfLoader.js +109 -5
- package/Source/Scene/GltfLoaderUtil.js +14 -0
- package/Source/Scene/GltfSpzLoader.js +0 -2
- package/Source/Scene/GltfStructuralMetadataLoader.js +0 -2
- package/Source/Scene/GltfTextureLoader.js +0 -2
- package/Source/Scene/GltfVertexBufferLoader.js +0 -4
- package/Source/Scene/HeightReference.js +5 -1
- package/Source/Scene/HorizontalOrigin.js +6 -1
- package/Source/Scene/ImageryProvider.js +1 -1
- package/Source/Scene/ImageryState.js +6 -1
- package/Source/Scene/Implicit3DTileContent.js +179 -214
- package/Source/Scene/ImplicitSubdivisionScheme.js +3 -1
- package/Source/Scene/InstanceAttributeSemantic.js +3 -1
- package/Source/Scene/IonWorldImageryStyle.js +6 -1
- package/Source/Scene/JobType.js +6 -1
- package/Source/Scene/LabelStyle.js +6 -1
- package/Source/Scene/MVTDataProvider.js +147 -0
- package/Source/Scene/MapMode2D.js +6 -1
- package/Source/Scene/MetadataComponentType.js +3 -1
- package/Source/Scene/MetadataSchemaLoader.js +0 -2
- package/Source/Scene/MetadataSemantic.js +6 -2
- package/Source/Scene/MetadataType.js +3 -1
- package/Source/Scene/Model/B3dmLoader.js +0 -3
- package/Source/Scene/Model/CustomShaderMode.js +3 -1
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +5 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +78 -337
- package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +5 -1
- package/Source/Scene/Model/Extensions/Gpm/StorageType.js +5 -1
- package/Source/Scene/Model/GeoJsonLoader.js +0 -2
- package/Source/Scene/Model/I3dmLoader.js +0 -3
- package/Source/Scene/Model/InstancingPipelineStage.js +1 -1
- package/Source/Scene/Model/LightingModel.js +5 -1
- package/Source/Scene/Model/MaterialPipelineStage.js +184 -3
- package/Source/Scene/Model/Model.js +34 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -3
- package/Source/Scene/Model/ModelReader.js +474 -3
- package/Source/Scene/Model/ModelRuntimePrimitive.js +2 -1
- package/Source/Scene/Model/ModelType.js +3 -1
- package/Source/Scene/Model/ModelUtility.js +4 -0
- package/Source/Scene/Model/PntsLoader.js +4 -3
- package/Source/Scene/Model/StyleCommandsNeeded.js +3 -1
- package/Source/Scene/Model/UniformType.js +5 -1
- package/Source/Scene/Model/VaryingType.js +5 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +500 -139
- package/Source/Scene/Model/pickModel.js +94 -299
- package/Source/Scene/ModelAnimationLoop.js +6 -1
- package/Source/Scene/ModelAnimationState.js +6 -1
- package/Source/Scene/ModelComponents.js +47 -2
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/PrimitiveState.js +7 -1
- package/Source/Scene/QuadtreeOccluders.js +20 -15
- package/Source/Scene/QuadtreeTile.js +547 -541
- package/Source/Scene/QuadtreeTileLoadState.js +6 -1
- package/Source/Scene/QuadtreeTileProvider.js +159 -175
- package/Source/Scene/ResourceLoader.js +0 -1
- package/Source/Scene/ResourceLoaderState.js +7 -1
- package/Source/Scene/Scene.js +26 -0
- package/Source/Scene/SceneMode.js +4 -1
- package/Source/Scene/ShadowMode.js +3 -1
- package/Source/Scene/SkyBox.js +1 -1
- package/Source/Scene/SplitDirection.js +6 -1
- package/Source/Scene/StencilFunction.js +6 -1
- package/Source/Scene/StencilOperation.js +6 -1
- package/Source/Scene/TerrainState.js +7 -1
- package/Source/Scene/TileState.js +7 -1
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/Tonemapper.js +5 -1
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
- package/Source/Scene/Vector3DTileContent.js +205 -234
- package/Source/Scene/VectorGltf3DTileContent.js +131 -61
- package/Source/Scene/VertexAttributeSemantic.js +3 -1
- package/Source/Scene/VerticalOrigin.js +6 -1
- package/Source/Scene/VoxelBoxShape.js +12 -6
- package/Source/Scene/VoxelContent.js +2 -0
- package/Source/Scene/VoxelCylinderShape.js +39 -38
- package/Source/Scene/VoxelEllipsoidShape.js +46 -96
- package/Source/Scene/VoxelMetadataOrder.js +6 -1
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -90
- package/Source/Scene/VoxelShapeType.js +3 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/decodeMVT.js +634 -0
- package/Source/Scene/renderBufferPointCollection.js +124 -127
- package/Source/Scene/renderBufferPolygonCollection.js +122 -122
- package/Source/Scene/renderBufferPolylineCollection.js +386 -238
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
- package/Source/Shaders/Model/ConstantLodStageFS.glsl +60 -0
- package/Source/Shaders/Model/ConstantLodStageFS.js +62 -0
- package/Source/Shaders/Model/ConstantLodStageVS.glsl +12 -0
- package/Source/Shaders/Model/ConstantLodStageVS.js +13 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +46 -20
- package/Source/Shaders/Model/MaterialStageFS.js +46 -20
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +0 -1
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +0 -1
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +7 -9
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +7 -9
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +7 -17
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +7 -17
- package/Source/Widget/CesiumWidget.js +11 -4
- package/index.d.ts +595 -343
- package/index.js +392 -378
- package/package.json +3 -3
- package/Build/Workers/chunk-DVB56LG7.js +0 -114
- package/Build/Workers/chunk-HKUES6UG.js +0 -2357
- package/Build/Workers/chunk-HRHRYFHS.js +0 -940
- package/Build/Workers/chunk-KLPGTXS3.js +0 -642
- package/Build/Workers/chunk-ZBZRTRJB.js +0 -1829
|
@@ -5,9 +5,7 @@ import defined from "../../Core/defined.js";
|
|
|
5
5
|
import IndexDatatype from "../../Core/IndexDatatype.js";
|
|
6
6
|
import ComponentDatatype from "../../Core/ComponentDatatype.js";
|
|
7
7
|
import PrimitiveType from "../../Core/PrimitiveType.js";
|
|
8
|
-
import Cartesian2 from "../../Core/Cartesian2.js";
|
|
9
8
|
import Cartesian3 from "../../Core/Cartesian3.js";
|
|
10
|
-
import AttributeCompression from "../../Core/AttributeCompression.js";
|
|
11
9
|
import Pass from "../../Renderer/Pass.js";
|
|
12
10
|
import ShaderDestination from "../../Renderer/ShaderDestination.js";
|
|
13
11
|
import EdgeVisibilityStageFS from "../../Shaders/Model/EdgeVisibilityStageFS.js";
|
|
@@ -17,10 +15,22 @@ import ModelReader from "./ModelReader.js";
|
|
|
17
15
|
import VertexAttributeSemantic from "../VertexAttributeSemantic.js";
|
|
18
16
|
import AttributeType from "../AttributeType.js";
|
|
19
17
|
|
|
18
|
+
/**
|
|
19
|
+
* 2-bit edge visibility values as defined by EXT_mesh_primitive_edge_visibility.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
const EdgeVisibilityType = Object.freeze({
|
|
23
|
+
HIDDEN: 0,
|
|
24
|
+
SILHOUETTE: 1,
|
|
25
|
+
HARD: 2,
|
|
26
|
+
// REPEATED_HARD (3) is a secondary spec encoding for a hard edge; normalized to HARD at decode time.
|
|
27
|
+
REPEATED_HARD: 3,
|
|
28
|
+
});
|
|
29
|
+
|
|
20
30
|
/**
|
|
21
31
|
* Builds derived line geometry for model edges using EXT_mesh_primitive_edge_visibility data.
|
|
22
32
|
* It parses the encoded edge visibility bits, creates a separate edge-domain vertex array with
|
|
23
|
-
* per-edge attributes (edge type, optional feature ID,
|
|
33
|
+
* per-edge attributes (edge type, optional feature ID, adjacent face normals),
|
|
24
34
|
* sets up the required shader defines / varyings, and stores the resulting line list geometry on
|
|
25
35
|
* the render resources for a later edge rendering pass.
|
|
26
36
|
*
|
|
@@ -95,13 +105,6 @@ EdgeVisibilityPipelineStage.process = function (
|
|
|
95
105
|
"a_edgeFeatureId",
|
|
96
106
|
);
|
|
97
107
|
|
|
98
|
-
// Add silhouette normal attribute and varying for silhouette edges
|
|
99
|
-
const silhouetteNormalLocation = shaderBuilder.addAttribute(
|
|
100
|
-
"vec3",
|
|
101
|
-
"a_silhouetteNormal",
|
|
102
|
-
);
|
|
103
|
-
shaderBuilder.addVarying("vec3", "v_silhouetteNormalView", "flat");
|
|
104
|
-
|
|
105
108
|
// Add face normal attributes for silhouette detection
|
|
106
109
|
const faceNormalALocation = shaderBuilder.addAttribute(
|
|
107
110
|
"vec3",
|
|
@@ -128,11 +131,6 @@ EdgeVisibilityPipelineStage.process = function (
|
|
|
128
131
|
);
|
|
129
132
|
shaderBuilder.addVarying("float", "v_edgeOffset");
|
|
130
133
|
|
|
131
|
-
// Add varying for view space position for perspective-correct silhouette detection
|
|
132
|
-
|
|
133
|
-
// Build triangle adjacency (mapping edges to adjacent triangles) and compute per-triangle face normals.
|
|
134
|
-
const adjacencyData = buildTriangleAdjacency(primitive);
|
|
135
|
-
|
|
136
134
|
const edgeResult = extractVisibleEdges(primitive);
|
|
137
135
|
|
|
138
136
|
if (
|
|
@@ -185,7 +183,6 @@ EdgeVisibilityPipelineStage.process = function (
|
|
|
185
183
|
|
|
186
184
|
// Generate paired face normals for each unique edge (used to classify silhouette edges in the shader).
|
|
187
185
|
const edgeFaceNormals = generateEdgeFaceNormals(
|
|
188
|
-
adjacencyData,
|
|
189
186
|
edgeResult.edgeIndices,
|
|
190
187
|
edgeResult.edgeData,
|
|
191
188
|
primitive.edgeVisibility,
|
|
@@ -198,7 +195,6 @@ EdgeVisibilityPipelineStage.process = function (
|
|
|
198
195
|
renderResources,
|
|
199
196
|
frameState.context,
|
|
200
197
|
edgeTypeLocation,
|
|
201
|
-
silhouetteNormalLocation,
|
|
202
198
|
faceNormalALocation,
|
|
203
199
|
faceNormalBLocation,
|
|
204
200
|
edgeFeatureIdLocation,
|
|
@@ -261,283 +257,70 @@ EdgeVisibilityPipelineStage.process = function (
|
|
|
261
257
|
};
|
|
262
258
|
|
|
263
259
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* @param {ModelComponents.Primitive} primitive The primitive containing triangle index + position data
|
|
269
|
-
* @returns {{edgeMap:Map<string, number[]>, faceNormals:Float32Array, triangleCount:number}}
|
|
270
|
-
* @private
|
|
271
|
-
*/
|
|
272
|
-
function buildTriangleAdjacency(primitive) {
|
|
273
|
-
const indices = primitive.indices;
|
|
274
|
-
if (!defined(indices)) {
|
|
275
|
-
return {
|
|
276
|
-
edgeMap: new Map(),
|
|
277
|
-
faceNormals: new Float32Array(0),
|
|
278
|
-
triangleCount: 0,
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
const triangleIndexArray = indices.typedArray;
|
|
283
|
-
const triangleCount = Math.floor(triangleIndexArray.length / 3);
|
|
284
|
-
|
|
285
|
-
// Get vertex positions for face normal calculation
|
|
286
|
-
const positionAttribute = ModelUtility.getAttributeBySemantic(
|
|
287
|
-
primitive,
|
|
288
|
-
VertexAttributeSemantic.POSITION,
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
// Retrieve raw (possibly quantized) position data. If the attribute is quantized
|
|
292
|
-
// we must dequantize on the CPU here because we compute face normals and silhouette
|
|
293
|
-
// classification data before the vertex shader's dequantization stage runs.
|
|
294
|
-
let positions = defined(positionAttribute.typedArray)
|
|
295
|
-
? positionAttribute.typedArray
|
|
296
|
-
: ModelReader.readAttributeAsTypedArray(positionAttribute);
|
|
297
|
-
|
|
298
|
-
const quantization = positionAttribute.quantization;
|
|
299
|
-
if (defined(quantization) && !quantization.octEncoded) {
|
|
300
|
-
const count = positions.length; // length is 3 * vertexCount
|
|
301
|
-
const dequantized = new Float32Array(count);
|
|
302
|
-
const offset = quantization.quantizedVolumeOffset;
|
|
303
|
-
const step = quantization.quantizedVolumeStepSize;
|
|
304
|
-
for (let i = 0; i < count; i += 3) {
|
|
305
|
-
dequantized[i] = offset.x + positions[i] * step.x;
|
|
306
|
-
dequantized[i + 1] = offset.y + positions[i + 1] * step.y;
|
|
307
|
-
dequantized[i + 2] = offset.z + positions[i + 2] * step.z;
|
|
308
|
-
}
|
|
309
|
-
positions = dequantized;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// Build edge map: key = "min,max", value = [triangleA, triangleB?]
|
|
313
|
-
const edgeMap = new Map();
|
|
314
|
-
|
|
315
|
-
// Calculate face normals for each triangle (model space)
|
|
316
|
-
const faceNormals = new Float32Array(triangleCount * 3);
|
|
317
|
-
|
|
318
|
-
// Scratch vectors to avoid heap allocations per triangle
|
|
319
|
-
const scratchP0 = new Cartesian3();
|
|
320
|
-
const scratchP1 = new Cartesian3();
|
|
321
|
-
const scratchP2 = new Cartesian3();
|
|
322
|
-
const scratchE1 = new Cartesian3();
|
|
323
|
-
const scratchE2 = new Cartesian3();
|
|
324
|
-
const scratchCross = new Cartesian3();
|
|
325
|
-
|
|
326
|
-
function processEdge(a, b, triIndex) {
|
|
327
|
-
const edgeKey = `${a < b ? a : b},${a < b ? b : a}`;
|
|
328
|
-
let list = edgeMap.get(edgeKey);
|
|
329
|
-
if (!defined(list)) {
|
|
330
|
-
list = [];
|
|
331
|
-
edgeMap.set(edgeKey, list);
|
|
332
|
-
}
|
|
333
|
-
if (list.length < 2) {
|
|
334
|
-
list.push(triIndex);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
for (let t = 0; t < triangleCount; t++) {
|
|
339
|
-
const base = t * 3;
|
|
340
|
-
const i0 = triangleIndexArray[base];
|
|
341
|
-
const i1 = triangleIndexArray[base + 1];
|
|
342
|
-
const i2 = triangleIndexArray[base + 2];
|
|
343
|
-
|
|
344
|
-
const i0o = i0 * 3;
|
|
345
|
-
const i1o = i1 * 3;
|
|
346
|
-
const i2o = i2 * 3;
|
|
347
|
-
|
|
348
|
-
scratchP0.x = positions[i0o];
|
|
349
|
-
scratchP0.y = positions[i0o + 1];
|
|
350
|
-
scratchP0.z = positions[i0o + 2];
|
|
351
|
-
scratchP1.x = positions[i1o];
|
|
352
|
-
scratchP1.y = positions[i1o + 1];
|
|
353
|
-
scratchP1.z = positions[i1o + 2];
|
|
354
|
-
scratchP2.x = positions[i2o];
|
|
355
|
-
scratchP2.y = positions[i2o + 1];
|
|
356
|
-
scratchP2.z = positions[i2o + 2];
|
|
357
|
-
|
|
358
|
-
Cartesian3.subtract(scratchP1, scratchP0, scratchE1);
|
|
359
|
-
Cartesian3.subtract(scratchP2, scratchP0, scratchE2);
|
|
360
|
-
Cartesian3.cross(scratchE1, scratchE2, scratchCross);
|
|
361
|
-
Cartesian3.normalize(scratchCross, scratchCross);
|
|
362
|
-
|
|
363
|
-
faceNormals[base] = scratchCross.x;
|
|
364
|
-
faceNormals[base + 1] = scratchCross.y;
|
|
365
|
-
faceNormals[base + 2] = scratchCross.z;
|
|
366
|
-
|
|
367
|
-
// Register edges
|
|
368
|
-
processEdge(i0, i1, t);
|
|
369
|
-
processEdge(i1, i2, t);
|
|
370
|
-
processEdge(i2, i0, t);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
return { edgeMap, faceNormals, triangleCount };
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Generate face normal pairs for each edge. Silhouette edges use normals from the GLB
|
|
378
|
-
* silhouetteNormals accessor if available. Boundary edges synthesize the opposite normal
|
|
379
|
-
* as the negation of the first triangle's normal.
|
|
260
|
+
* Generate face normal pairs for each silhouette edge from the GLB silhouetteNormals
|
|
261
|
+
* accessor. Per the spec, the accessor MUST be present for any primitive that encodes
|
|
262
|
+
* at least one silhouette edge.
|
|
380
263
|
*
|
|
381
|
-
* @param {{edgeMap:Map<string,number[]>, faceNormals:Float32Array}} adjacencyData Triangle adjacency data
|
|
382
264
|
* @param {number[]} edgeIndices Packed array of 2 vertex indices per edge
|
|
383
|
-
* @param {Object[]} edgeData Array of edge metadata (edgeType,
|
|
265
|
+
* @param {Object[]} edgeData Array of edge metadata (edgeType, silhouetteEdgeIndex)
|
|
384
266
|
* @param {Object} edgeVisibility Edge visibility extension data
|
|
385
267
|
* @returns {Float32Array} Packed array: 6 floats per edge (normalA.xyz, normalB.xyz)
|
|
386
268
|
* @private
|
|
387
269
|
*/
|
|
388
|
-
function generateEdgeFaceNormals(
|
|
389
|
-
adjacencyData,
|
|
390
|
-
edgeIndices,
|
|
391
|
-
edgeData,
|
|
392
|
-
edgeVisibility,
|
|
393
|
-
) {
|
|
394
|
-
const { edgeMap, faceNormals } = adjacencyData;
|
|
270
|
+
function generateEdgeFaceNormals(edgeIndices, edgeData, edgeVisibility) {
|
|
395
271
|
const numEdges = edgeIndices.length / 2;
|
|
396
272
|
const edgeFaceNormals = new Float32Array(numEdges * 6);
|
|
397
273
|
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
// Decode from signed byte to normal vector
|
|
420
|
-
scratchNormal.x = decodeSignedByte(vec3.x);
|
|
421
|
-
scratchNormal.y = decodeSignedByte(vec3.y);
|
|
422
|
-
scratchNormal.z = decodeSignedByte(vec3.z);
|
|
423
|
-
|
|
424
|
-
// Normalize to unit vector
|
|
425
|
-
const magnitude = Cartesian3.magnitude(scratchNormal);
|
|
426
|
-
if (magnitude > 0) {
|
|
427
|
-
Cartesian3.normalize(scratchNormal, scratchNormal);
|
|
428
|
-
} else {
|
|
429
|
-
// Handle zero vector - use default up vector
|
|
430
|
-
scratchNormal.x = 0;
|
|
431
|
-
scratchNormal.y = 0;
|
|
432
|
-
scratchNormal.z = 1;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
// Use Cesium's octahedral encoding (returns 0-255 integers)
|
|
436
|
-
AttributeCompression.octEncodeInRange(scratchNormal, 255, scratchEncoded);
|
|
437
|
-
|
|
438
|
-
// Convert to 16-bit integer: (y << 8) | x
|
|
439
|
-
const byteX = scratchEncoded.x & 0xff;
|
|
440
|
-
const byteY = scratchEncoded.y & 0xff;
|
|
441
|
-
uint16Normals[i] = (byteY << 8) | byteX;
|
|
274
|
+
const raw = edgeVisibility.silhouetteNormals;
|
|
275
|
+
if (!defined(raw)) {
|
|
276
|
+
// No silhouette edges in this primitive, the shader only checks normals for SILHOUETTE edges.
|
|
277
|
+
return edgeFaceNormals;
|
|
278
|
+
}
|
|
279
|
+
const silhouetteNormalsFloat = new Float32Array(raw.length * 3);
|
|
280
|
+
const scratchNormal = new Cartesian3();
|
|
281
|
+
|
|
282
|
+
for (let i = 0; i < raw.length; i++) {
|
|
283
|
+
const vec3 = raw[i];
|
|
284
|
+
// Signed byte → float: map [-128,127] → [-1,1]
|
|
285
|
+
scratchNormal.x = 2 * ((vec3.x + 128) / 255) - 1;
|
|
286
|
+
scratchNormal.y = 2 * ((vec3.y + 128) / 255) - 1;
|
|
287
|
+
scratchNormal.z = 2 * ((vec3.z + 128) / 255) - 1;
|
|
288
|
+
|
|
289
|
+
if (Cartesian3.magnitudeSquared(scratchNormal) > 0) {
|
|
290
|
+
Cartesian3.normalize(scratchNormal, scratchNormal);
|
|
291
|
+
} else {
|
|
292
|
+
scratchNormal.x = 0;
|
|
293
|
+
scratchNormal.y = 0;
|
|
294
|
+
scratchNormal.z = 1;
|
|
442
295
|
}
|
|
443
296
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
for (let i = 0; i < numPairs; i++) {
|
|
449
|
-
const normalA = uint16Normals[i * 2];
|
|
450
|
-
const normalB = uint16Normals[i * 2 + 1];
|
|
451
|
-
silhouetteNormalsUint32[i] = normalA | (normalB << 16);
|
|
452
|
-
}
|
|
297
|
+
silhouetteNormalsFloat[i * 3] = scratchNormal.x;
|
|
298
|
+
silhouetteNormalsFloat[i * 3 + 1] = scratchNormal.y;
|
|
299
|
+
silhouetteNormalsFloat[i * 3 + 2] = scratchNormal.z;
|
|
453
300
|
}
|
|
454
301
|
|
|
455
302
|
for (let i = 0; i < numEdges; i++) {
|
|
456
|
-
const
|
|
457
|
-
const b = edgeIndices[i * 2 + 1];
|
|
458
|
-
const edgeKey = `${a < b ? a : b},${a < b ? b : a}`;
|
|
459
|
-
const triangleList = edgeMap.get(edgeKey);
|
|
460
|
-
|
|
461
|
-
const { edgeType, mateVertexIndex } = edgeData[i];
|
|
462
|
-
|
|
463
|
-
let nAx, nAy, nAz, nBx, nBy, nBz;
|
|
464
|
-
let usedGLBNormals = false;
|
|
465
|
-
|
|
466
|
-
// Use GLB silhouetteNormals for type=1 (SILHOUETTE) edges if available
|
|
467
|
-
if (
|
|
468
|
-
hasGLBSilhouetteNormals &&
|
|
469
|
-
silhouetteNormalsUint32 &&
|
|
470
|
-
edgeType === 1 &&
|
|
471
|
-
mateVertexIndex >= 0
|
|
472
|
-
) {
|
|
473
|
-
// Each OctEncodedNormalPair is stored as one Uint32 value
|
|
474
|
-
// Uint32 contains 4 bytes: [byte0, byte1, byte2, byte3]
|
|
475
|
-
// normalA = byte0 | (byte1 << 8) - little endian
|
|
476
|
-
// normalB = byte2 | (byte3 << 8) - little endian
|
|
477
|
-
|
|
478
|
-
if (mateVertexIndex < silhouetteNormalsUint32.length) {
|
|
479
|
-
const uint32Value = silhouetteNormalsUint32[mateVertexIndex];
|
|
480
|
-
|
|
481
|
-
// Uint32 contains 4 bytes: [xA, yA, xB, yB]
|
|
482
|
-
// Extract and decode using octDecode (rangeMax=255)
|
|
483
|
-
AttributeCompression.octDecode(
|
|
484
|
-
uint32Value & 0xff, // xA
|
|
485
|
-
(uint32Value >> 8) & 0xff, // yA
|
|
486
|
-
scratchDecodedA,
|
|
487
|
-
);
|
|
488
|
-
AttributeCompression.octDecode(
|
|
489
|
-
(uint32Value >> 16) & 0xff, // xB
|
|
490
|
-
(uint32Value >> 24) & 0xff, // yB
|
|
491
|
-
scratchDecodedB,
|
|
492
|
-
);
|
|
493
|
-
|
|
494
|
-
nAx = scratchDecodedA.x;
|
|
495
|
-
nAy = scratchDecodedA.y;
|
|
496
|
-
nAz = scratchDecodedA.z;
|
|
497
|
-
nBx = scratchDecodedB.x;
|
|
498
|
-
nBy = scratchDecodedB.y;
|
|
499
|
-
nBz = scratchDecodedB.z;
|
|
500
|
-
|
|
501
|
-
usedGLBNormals = true;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
303
|
+
const { edgeType, silhouetteEdgeIndex } = edgeData[i];
|
|
504
304
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
if (!defined(triangleList) || triangleList.length === 0) {
|
|
509
|
-
continue;
|
|
510
|
-
}
|
|
305
|
+
if (edgeType !== EdgeVisibilityType.SILHOUETTE || silhouetteEdgeIndex < 0) {
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
511
308
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
nAy = faceNormals[aBase + 1];
|
|
516
|
-
nAz = faceNormals[aBase + 2];
|
|
517
|
-
|
|
518
|
-
const isManifold = triangleList.length > 1;
|
|
519
|
-
|
|
520
|
-
if (isManifold) {
|
|
521
|
-
const tB = triangleList[1];
|
|
522
|
-
const bBase = tB * 3;
|
|
523
|
-
nBx = faceNormals[bBase];
|
|
524
|
-
nBy = faceNormals[bBase + 1];
|
|
525
|
-
nBz = faceNormals[bBase + 2];
|
|
526
|
-
} else {
|
|
527
|
-
// Boundary edge – synthesize opposite normal
|
|
528
|
-
nBx = -nAx;
|
|
529
|
-
nBy = -nAy;
|
|
530
|
-
nBz = -nAz;
|
|
531
|
-
}
|
|
309
|
+
const pairBase = silhouetteEdgeIndex * 2;
|
|
310
|
+
if ((pairBase + 1) * 3 + 2 >= silhouetteNormalsFloat.length) {
|
|
311
|
+
continue;
|
|
532
312
|
}
|
|
533
313
|
|
|
314
|
+
const baseA = pairBase * 3;
|
|
315
|
+
const baseB = (pairBase + 1) * 3;
|
|
534
316
|
const baseIdx = i * 6;
|
|
535
|
-
|
|
536
|
-
edgeFaceNormals[baseIdx
|
|
537
|
-
edgeFaceNormals[baseIdx +
|
|
538
|
-
edgeFaceNormals[baseIdx +
|
|
539
|
-
edgeFaceNormals[baseIdx +
|
|
540
|
-
edgeFaceNormals[baseIdx +
|
|
317
|
+
|
|
318
|
+
edgeFaceNormals[baseIdx] = silhouetteNormalsFloat[baseA];
|
|
319
|
+
edgeFaceNormals[baseIdx + 1] = silhouetteNormalsFloat[baseA + 1];
|
|
320
|
+
edgeFaceNormals[baseIdx + 2] = silhouetteNormalsFloat[baseA + 2];
|
|
321
|
+
edgeFaceNormals[baseIdx + 3] = silhouetteNormalsFloat[baseB];
|
|
322
|
+
edgeFaceNormals[baseIdx + 4] = silhouetteNormalsFloat[baseB + 1];
|
|
323
|
+
edgeFaceNormals[baseIdx + 5] = silhouetteNormalsFloat[baseB + 2];
|
|
541
324
|
}
|
|
542
325
|
|
|
543
326
|
return edgeFaceNormals;
|
|
@@ -547,10 +330,10 @@ function generateEdgeFaceNormals(
|
|
|
547
330
|
* Parse the EXT_mesh_primitive_edge_visibility 2-bit edge encoding and extract
|
|
548
331
|
* a unique set of edges that should be considered for rendering. Edge types:
|
|
549
332
|
* <ul>
|
|
550
|
-
* <li>
|
|
551
|
-
* <li>
|
|
552
|
-
* <li>
|
|
553
|
-
* <li>
|
|
333
|
+
* <li><code>EdgeVisibilityType.HIDDEN</code> - skipped</li>
|
|
334
|
+
* <li><code>EdgeVisibilityType.SILHOUETTE</code> - candidates for conditional display based on facing</li>
|
|
335
|
+
* <li><code>EdgeVisibilityType.HARD</code> - always displayed</li>
|
|
336
|
+
* <li><code>EdgeVisibilityType.REPEATED_HARD</code> - secondary encoding for a hard edge (treated same as HARD)</li>
|
|
554
337
|
* </ul>
|
|
555
338
|
* Deduplicates edges shared by adjacent triangles and records per-edge metadata.
|
|
556
339
|
*
|
|
@@ -624,7 +407,7 @@ function extractVisibleEdges(primitive) {
|
|
|
624
407
|
const byte = visibilityArray[byteIndex];
|
|
625
408
|
const visibility2Bit = (byte >> bitPairOffset) & 0x3;
|
|
626
409
|
|
|
627
|
-
if (visibility2Bit ===
|
|
410
|
+
if (visibility2Bit === EdgeVisibilityType.HIDDEN) {
|
|
628
411
|
continue;
|
|
629
412
|
}
|
|
630
413
|
|
|
@@ -633,25 +416,28 @@ function extractVisibleEdges(primitive) {
|
|
|
633
416
|
const edgeKey = `${small},${big}`;
|
|
634
417
|
|
|
635
418
|
if (seenEdgeHashes.has(edgeKey)) {
|
|
419
|
+
// Deduplicate edges shared by adjacent triangles. This also handles
|
|
420
|
+
// REPEATED_HARD edges (type=3): their first occurrence is recorded as
|
|
421
|
+
// HARD, and any subsequent REPEATED_HARD occurrence is skipped here.
|
|
636
422
|
continue;
|
|
637
423
|
}
|
|
638
424
|
seenEdgeHashes.add(edgeKey);
|
|
639
425
|
edgeIndices.push(a, b);
|
|
640
426
|
|
|
641
|
-
//
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
mateVertexIndex = silhouetteEdgeCount;
|
|
427
|
+
// Assign a sequential index into the silhouetteNormals accessor for SILHOUETTE edges.
|
|
428
|
+
let silhouetteEdgeIndex = -1;
|
|
429
|
+
if (visibility2Bit === EdgeVisibilityType.SILHOUETTE) {
|
|
430
|
+
silhouetteEdgeIndex = silhouetteEdgeCount;
|
|
646
431
|
silhouetteEdgeCount++;
|
|
647
432
|
}
|
|
648
433
|
|
|
649
434
|
edgeData.push({
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
435
|
+
// Normalize REPEATED_HARD to HARD — both render identically in the shader.
|
|
436
|
+
edgeType:
|
|
437
|
+
visibility2Bit === EdgeVisibilityType.REPEATED_HARD
|
|
438
|
+
? EdgeVisibilityType.HARD
|
|
439
|
+
: visibility2Bit,
|
|
440
|
+
silhouetteEdgeIndex: silhouetteEdgeIndex,
|
|
655
441
|
color: globalColor,
|
|
656
442
|
});
|
|
657
443
|
}
|
|
@@ -714,11 +500,8 @@ function extractVisibleEdges(primitive) {
|
|
|
714
500
|
seenEdgeHashes.add(edgeKey);
|
|
715
501
|
edgeIndices.push(a, b);
|
|
716
502
|
edgeData.push({
|
|
717
|
-
edgeType:
|
|
718
|
-
|
|
719
|
-
edgeIndex: -1,
|
|
720
|
-
mateVertexIndex: -1,
|
|
721
|
-
currentTriangleVertices: undefined,
|
|
503
|
+
edgeType: EdgeVisibilityType.HARD,
|
|
504
|
+
silhouetteEdgeIndex: -1,
|
|
722
505
|
color: defined(lineColor) ? lineColor : undefined,
|
|
723
506
|
});
|
|
724
507
|
}
|
|
@@ -819,7 +602,6 @@ function collectVertexColors(runtimePrimitive) {
|
|
|
819
602
|
* @param {PrimitiveRenderResources} renderResources The render resources for the primitive
|
|
820
603
|
* @param {Context} context The WebGL rendering context
|
|
821
604
|
* @param {number} edgeTypeLocation Shader attribute location for the edge type
|
|
822
|
-
* @param {number} silhouetteNormalLocation Shader attribute location for input silhouette normal
|
|
823
605
|
* @param {number} faceNormalALocation Shader attribute location for face normal A
|
|
824
606
|
* @param {number} faceNormalBLocation Shader attribute location for face normal B
|
|
825
607
|
* @param {number} edgeFeatureIdLocation Shader attribute location for optional edge feature ID
|
|
@@ -840,7 +622,6 @@ function createQuadEdgeGeometry(
|
|
|
840
622
|
renderResources,
|
|
841
623
|
context,
|
|
842
624
|
edgeTypeLocation,
|
|
843
|
-
silhouetteNormalLocation,
|
|
844
625
|
faceNormalALocation,
|
|
845
626
|
faceNormalBLocation,
|
|
846
627
|
edgeFeatureIdLocation,
|
|
@@ -876,7 +657,6 @@ function createQuadEdgeGeometry(
|
|
|
876
657
|
// Create arrays for quad vertices
|
|
877
658
|
const edgePosArray = new Float32Array(totalVerts * 3);
|
|
878
659
|
const edgeTypeArray = new Float32Array(totalVerts);
|
|
879
|
-
const silhouetteNormalArray = new Float32Array(totalVerts * 3);
|
|
880
660
|
const faceNormalAArray = new Float32Array(totalVerts * 3);
|
|
881
661
|
const faceNormalBArray = new Float32Array(totalVerts * 3);
|
|
882
662
|
const edgeOtherPosArray = new Float32Array(totalVerts * 3);
|
|
@@ -1029,32 +809,6 @@ function createQuadEdgeGeometry(
|
|
|
1029
809
|
edgeCumDistArray[baseVertexIndex + 3] = cumDistB;
|
|
1030
810
|
}
|
|
1031
811
|
|
|
1032
|
-
// Set silhouette normal (same for all 4 vertices)
|
|
1033
|
-
let normalX = 0,
|
|
1034
|
-
normalY = 0,
|
|
1035
|
-
normalZ = 1;
|
|
1036
|
-
|
|
1037
|
-
if (rawType === 1 && defined(edgeVisibility.silhouetteNormals)) {
|
|
1038
|
-
const mateVertexIndex = edgeData[i].mateVertexIndex;
|
|
1039
|
-
if (
|
|
1040
|
-
mateVertexIndex >= 0 &&
|
|
1041
|
-
mateVertexIndex < edgeVisibility.silhouetteNormals.length
|
|
1042
|
-
) {
|
|
1043
|
-
const normal = edgeVisibility.silhouetteNormals[mateVertexIndex];
|
|
1044
|
-
if (defined(normal)) {
|
|
1045
|
-
normalX = normal.x;
|
|
1046
|
-
normalY = normal.y;
|
|
1047
|
-
normalZ = normal.z;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
for (let v = 0; v < 4; v++) {
|
|
1053
|
-
silhouetteNormalArray[(baseVertexIndex + v) * 3] = normalX;
|
|
1054
|
-
silhouetteNormalArray[(baseVertexIndex + v) * 3 + 1] = normalY;
|
|
1055
|
-
silhouetteNormalArray[(baseVertexIndex + v) * 3 + 2] = normalZ;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
812
|
// Set face normals (same for all 4 vertices)
|
|
1059
813
|
const faceNormalIdx = i * 6;
|
|
1060
814
|
const normalAX = edgeFaceNormals[faceNormalIdx];
|
|
@@ -1087,12 +841,6 @@ function createQuadEdgeGeometry(
|
|
|
1087
841
|
usage: BufferUsage.STATIC_DRAW,
|
|
1088
842
|
});
|
|
1089
843
|
|
|
1090
|
-
const silhouetteNormalBuffer = Buffer.createVertexBuffer({
|
|
1091
|
-
context,
|
|
1092
|
-
typedArray: silhouetteNormalArray,
|
|
1093
|
-
usage: BufferUsage.STATIC_DRAW,
|
|
1094
|
-
});
|
|
1095
|
-
|
|
1096
844
|
const faceNormalABuffer = Buffer.createVertexBuffer({
|
|
1097
845
|
context,
|
|
1098
846
|
typedArray: faceNormalAArray,
|
|
@@ -1181,13 +929,6 @@ function createQuadEdgeGeometry(
|
|
|
1181
929
|
componentDatatype: ComponentDatatype.FLOAT,
|
|
1182
930
|
normalize: false,
|
|
1183
931
|
},
|
|
1184
|
-
{
|
|
1185
|
-
index: silhouetteNormalLocation,
|
|
1186
|
-
vertexBuffer: silhouetteNormalBuffer,
|
|
1187
|
-
componentsPerAttribute: 3,
|
|
1188
|
-
componentDatatype: ComponentDatatype.FLOAT,
|
|
1189
|
-
normalize: false,
|
|
1190
|
-
},
|
|
1191
932
|
{
|
|
1192
933
|
index: faceNormalALocation,
|
|
1193
934
|
vertexBuffer: faceNormalABuffer,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* An enum of storage types for covariance information.
|
|
3
5
|
*
|
|
@@ -27,4 +29,6 @@ const StorageType = {
|
|
|
27
29
|
Indirect: "Indirect",
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
Object.freeze(StorageType);
|
|
33
|
+
|
|
34
|
+
export default StorageType;
|
|
@@ -56,7 +56,6 @@ class GeoJsonLoader extends ResourceLoader {
|
|
|
56
56
|
/**
|
|
57
57
|
* The cache key of the resource.
|
|
58
58
|
*
|
|
59
|
-
* @memberof GeoJsonLoader.prototype
|
|
60
59
|
*
|
|
61
60
|
* @type {string}
|
|
62
61
|
* @readonly
|
|
@@ -69,7 +68,6 @@ class GeoJsonLoader extends ResourceLoader {
|
|
|
69
68
|
/**
|
|
70
69
|
* The loaded components.
|
|
71
70
|
*
|
|
72
|
-
* @memberof GeoJsonLoader.prototype
|
|
73
71
|
*
|
|
74
72
|
* @type {ModelComponents.Components}
|
|
75
73
|
* @readonly
|
|
@@ -129,7 +129,6 @@ class I3dmLoader extends ResourceLoader {
|
|
|
129
129
|
/**
|
|
130
130
|
* true if textures are loaded, useful when incrementallyLoadTextures is true
|
|
131
131
|
*
|
|
132
|
-
* @memberof I3dmLoader.prototype
|
|
133
132
|
*
|
|
134
133
|
* @type {boolean}
|
|
135
134
|
* @readonly
|
|
@@ -142,7 +141,6 @@ class I3dmLoader extends ResourceLoader {
|
|
|
142
141
|
/**
|
|
143
142
|
* The cache key of the resource
|
|
144
143
|
*
|
|
145
|
-
* @memberof I3dmLoader.prototype
|
|
146
144
|
*
|
|
147
145
|
* @type {string}
|
|
148
146
|
* @readonly
|
|
@@ -155,7 +153,6 @@ class I3dmLoader extends ResourceLoader {
|
|
|
155
153
|
/**
|
|
156
154
|
* The loaded components.
|
|
157
155
|
*
|
|
158
|
-
* @memberof I3dmLoader.prototype
|
|
159
156
|
*
|
|
160
157
|
* @type {ModelComponents.Components}
|
|
161
158
|
* @default {@link Matrix4.IDENTITY}
|
|
@@ -706,7 +706,7 @@ function processTransformAttributes(
|
|
|
706
706
|
);
|
|
707
707
|
|
|
708
708
|
// Only use matrices for the transforms if the rotation attribute is defined.
|
|
709
|
-
if (defined(rotationAttribute)) {
|
|
709
|
+
if (defined(rotationAttribute) || keepTypedArray) {
|
|
710
710
|
processTransformMatrixAttributes(
|
|
711
711
|
renderResources,
|
|
712
712
|
instances,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* The lighting model to use for lighting a {@link Model}.
|
|
3
5
|
*
|
|
@@ -27,4 +29,6 @@ const LightingModel = {
|
|
|
27
29
|
PBR: 1,
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
Object.freeze(LightingModel);
|
|
33
|
+
|
|
34
|
+
export default LightingModel;
|