@cesium/engine 23.0.1 → 25.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-ZEMJQKHD.js → chunk-35H3UBIO.js} +13 -12
- package/Build/Workers/{chunk-PQTSXJBJ.js → chunk-3LSD7OOA.js} +16 -16
- package/Build/Workers/{chunk-PUO7BYDY.js → chunk-3RFFPH4M.js} +1 -1
- package/Build/Workers/{chunk-PBECJOWF.js → chunk-3TKLDHV3.js} +2 -2
- package/Build/Workers/{chunk-TMCTZ5E3.js → chunk-3VDDRF2E.js} +14 -14
- package/Build/Workers/{chunk-FKU77FNM.js → chunk-3XY3MVPG.js} +4 -4
- package/Build/Workers/{chunk-2OBWHTIC.js → chunk-4GF4MVPY.js} +7 -7
- package/Build/Workers/{chunk-JUKGMJX7.js → chunk-4MTRQFJP.js} +3 -2
- package/Build/Workers/{chunk-66OWUDO7.js → chunk-4QQXGTCE.js} +8 -8
- package/Build/Workers/{chunk-ALTCIHRH.js → chunk-4XXHJI6Y.js} +17 -17
- package/Build/Workers/{chunk-K7UTK4OM.js → chunk-5T6QQAJW.js} +3 -2
- package/Build/Workers/{chunk-IJ3SUMK3.js → chunk-6SDGQI27.js} +3 -2
- package/Build/Workers/{chunk-FXSRA5UG.js → chunk-77RL3MBD.js} +6 -5
- package/Build/Workers/{chunk-G6MJ3ZW3.js → chunk-7LSFAEWF.js} +12 -11
- package/Build/Workers/{chunk-C6HHBKT5.js → chunk-A7A433MD.js} +5 -5
- package/Build/Workers/{chunk-PGZ3B6CB.js → chunk-A7ZBMVFS.js} +14 -14
- package/Build/Workers/{chunk-OZYB3AOR.js → chunk-ACFFCHHZ.js} +11 -11
- package/Build/Workers/{chunk-DNMASBMH.js → chunk-AEAVLYPS.js} +2 -2
- package/Build/Workers/{chunk-VPWYHFQA.js → chunk-AWFZHD2B.js} +4 -4
- package/Build/Workers/{chunk-TFPG3ZKW.js → chunk-BTX2NL3P.js} +59 -46
- package/Build/Workers/{chunk-TNXOPEIG.js → chunk-BVAIWR7O.js} +12 -12
- package/Build/Workers/chunk-CKQP3DSS.js +973 -0
- package/Build/Workers/{chunk-N6HRZLS6.js → chunk-CZ23Y3RM.js} +2 -2
- package/Build/Workers/{chunk-EIC3VAOZ.js → chunk-DFEI5MAV.js} +7 -7
- package/Build/Workers/{chunk-BTP3634E.js → chunk-DH26SNAB.js} +4 -1
- package/Build/Workers/{chunk-TXYQNXNW.js → chunk-DYT5NR6P.js} +3 -3
- package/Build/Workers/{chunk-O67UP5YO.js → chunk-EZARA5FJ.js} +13 -13
- package/Build/Workers/{chunk-YSJRB2UZ.js → chunk-FIBS5S7R.js} +2 -2
- package/Build/Workers/{chunk-2M7DKGLW.js → chunk-FVLVVOBQ.js} +10 -10
- package/Build/Workers/{chunk-B2VA6IEL.js → chunk-GL7DNVUS.js} +5 -5
- package/Build/Workers/{chunk-77DJBHMI.js → chunk-GPIGURCG.js} +59 -32
- package/Build/Workers/{chunk-QPXGGVHC.js → chunk-H2A4USJR.js} +10 -10
- package/Build/Workers/chunk-HSVQATK2.js +147 -0
- package/Build/Workers/{chunk-HXEPZWJN.js → chunk-HVMG6AG4.js} +11 -10
- package/Build/Workers/{chunk-H3TVRJLY.js → chunk-I3A6DXYZ.js} +4 -4
- package/Build/Workers/{chunk-UEWYSOFD.js → chunk-ITD2IN7N.js} +2 -2
- package/Build/Workers/{chunk-CYOPNGPX.js → chunk-J3OFS2RD.js} +12 -12
- package/Build/Workers/{chunk-RZX6LOG6.js → chunk-J647NNZW.js} +6 -6
- package/Build/Workers/{chunk-GLCPE2BJ.js → chunk-J7KQEKPK.js} +13 -13
- package/Build/Workers/{chunk-XPMXRJDD.js → chunk-K6NFIRFB.js} +5 -5
- package/Build/Workers/{chunk-CID5SY7L.js → chunk-LH5SF3XV.js} +7 -6
- package/Build/Workers/{chunk-UOQB7XQI.js → chunk-ND3NTTOF.js} +713 -435
- package/Build/Workers/chunk-QO2CGXMP.js +2342 -0
- package/Build/Workers/chunk-QSDY4NS7.js +1287 -0
- package/Build/Workers/chunk-QXNQQYPV.js +3201 -0
- package/Build/Workers/{chunk-CJ7ZDY77.js → chunk-ST2UWDUU.js} +5 -5
- package/Build/Workers/{chunk-YDR5LX5Z.js → chunk-TA777BGS.js} +3 -2
- package/Build/Workers/{chunk-U4SWB6TI.js → chunk-TAI4HLII.js} +4 -4
- package/Build/Workers/{chunk-VX774SWE.js → chunk-URUCCIPS.js} +6 -6
- package/Build/Workers/{chunk-MNSNOONX.js → chunk-VQKLRBIK.js} +7 -7
- package/Build/Workers/{chunk-CVAAIRNP.js → chunk-WC57YYBN.js} +2 -2
- package/Build/Workers/{chunk-QNABVTTP.js → chunk-WN6P5UDH.js} +12 -12
- package/Build/Workers/{chunk-CNLXMOPM.js → chunk-WNN5D4W3.js} +12 -11
- package/Build/Workers/{chunk-4JJQRZYL.js → chunk-WTQGE7Q6.js} +17 -17
- package/Build/Workers/{chunk-FCJQO4NC.js → chunk-WUBKZFF6.js} +2213 -1349
- package/Build/Workers/{chunk-3UQ2YMPP.js → chunk-ZAPOS52G.js} +12 -10
- package/Build/Workers/{chunk-LHFC4R7Z.js → chunk-ZCCIIBZT.js} +6 -6
- 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 +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 +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 +7 -5
- package/Source/Core/Cartesian3.js +9 -8
- package/Source/Core/Cartesian4.js +8 -6
- 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 +846 -835
- package/Source/Core/ComponentDatatype.js +4 -1
- package/Source/Core/CornerType.js +6 -1
- package/Source/Core/Credit.js +121 -124
- package/Source/Core/DeveloperError.js +2 -1
- 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/ITwinPlatform.js +1 -0
- 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 +39 -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/S2Cell.js +2 -2
- package/Source/Core/ScreenSpaceEventType.js +6 -1
- package/Source/Core/TerrainMesh.js +10 -1
- package/Source/Core/TerrainPicker.js +1 -0
- 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/WallGeometry.js +1 -1
- package/Source/Core/WallOutlineGeometry.js +1 -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/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 +4 -1
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +4 -1
- 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 +7 -1
- package/Source/Renderer/PickId.js +44 -0
- package/Source/Renderer/PixelDatatype.js +3 -1
- package/Source/Renderer/RenderState.js +2 -2
- 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/VertexArray.js +80 -0
- 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/BillboardCollection.js +65 -364
- 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 +148 -0
- package/Source/Scene/BufferPointCollection.js +138 -0
- package/Source/Scene/BufferPointMaterial.js +95 -0
- package/Source/Scene/BufferPolygon.js +516 -0
- package/Source/Scene/BufferPolygonCollection.js +370 -0
- package/Source/Scene/BufferPolygonMaterial.js +41 -0
- package/Source/Scene/BufferPolyline.js +185 -0
- package/Source/Scene/BufferPolylineCollection.js +138 -0
- package/Source/Scene/BufferPolylineMaterial.js +93 -0
- package/Source/Scene/BufferPrimitive.js +347 -0
- package/Source/Scene/BufferPrimitiveCollection.js +818 -0
- package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
- package/Source/Scene/CameraEventType.js +6 -1
- package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
- package/Source/Scene/Cesium3DTileContent.js +5 -1
- package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
- 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/Cesium3DTileStyle.js +22 -0
- package/Source/Scene/Cesium3DTileVectorFeature.js +586 -0
- package/Source/Scene/Cesium3DTileset.js +2 -1
- package/Source/Scene/ClassificationType.js +3 -1
- package/Source/Scene/ClippingPolygonCollection.js +270 -101
- package/Source/Scene/CloudType.js +3 -1
- package/Source/Scene/ColorBlendMode.js +4 -1
- package/Source/Scene/CubeMapPanorama.js +4 -4
- package/Source/Scene/CullFace.js +6 -1
- package/Source/Scene/DepthFunction.js +6 -1
- package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
- package/Source/Scene/EquirectangularPanorama.js +1 -0
- package/Source/Scene/ExpressionNodeType.js +6 -1
- package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
- package/Source/Scene/GaussianSplatPrimitive.js +413 -70
- package/Source/Scene/GetFeatureInfoFormat.js +3 -3
- 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 +215 -39
- package/Source/Scene/GltfLoaderUtil.js +14 -0
- package/Source/Scene/GltfSpzLoader.js +109 -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/ITwinData.js +1 -0
- package/Source/Scene/ImageryProvider.js +1 -1
- package/Source/Scene/ImageryState.js +6 -1
- 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/Label.js +32 -0
- package/Source/Scene/LabelCollection.js +14 -13
- package/Source/Scene/LabelStyle.js +6 -1
- package/Source/Scene/MapMode2D.js +6 -1
- 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 +118 -24
- 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/CustomShaderPipelineStage.js +3 -1
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +5 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +735 -264
- 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 +331 -3
- package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +6 -0
- package/Source/Scene/Model/ModelReader.js +475 -4
- package/Source/Scene/Model/ModelRuntimePrimitive.js +2 -1
- package/Source/Scene/Model/ModelType.js +3 -1
- package/Source/Scene/Model/ModelUtility.js +3 -1
- 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 +375 -0
- 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 +1639 -1542
- package/Source/Scene/PickedMetadataInfo.js +1 -0
- 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/SceneMode.js +4 -1
- package/Source/Scene/ScreenSpaceCameraController.js +13 -0
- package/Source/Scene/ShadowMode.js +3 -1
- package/Source/Scene/SkyBox.js +17 -8
- 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/TileBoundingRegion.js +1 -1
- package/Source/Scene/TileBoundingS2Cell.js +1 -1
- package/Source/Scene/TileBoundingSphere.js +1 -1
- package/Source/Scene/TileState.js +7 -1
- package/Source/Scene/Tonemapper.js +5 -1
- package/Source/Scene/TweenCollection.js +7 -0
- package/Source/Scene/VectorGltf3DTileContent.js +403 -0
- package/Source/Scene/VertexAttributeSemantic.js +17 -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/VoxelProvider.js +1 -0
- package/Source/Scene/VoxelShapeType.js +3 -1
- 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 +285 -0
- package/Source/Scene/renderBufferPolygonCollection.js +339 -0
- package/Source/Scene/renderBufferPolylineCollection.js +478 -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/Builtin/CzmBuiltins.js +2 -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/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/MaterialStageFS.glsl +46 -20
- package/Source/Shaders/Model/MaterialStageFS.js +46 -20
- 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/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/Source/Workers/decodeDraco.js +3 -0
- package/Source/Workers/decodeI3S.js +5 -2
- package/index.d.ts +1332 -402
- package/index.js +111 -81
- package/package.json +3 -3
- package/Build/Workers/chunk-54O3AGOA.js +0 -642
- package/Build/Workers/chunk-6U5QMZU3.js +0 -940
- package/Build/Workers/chunk-HNDE73JK.js +0 -1829
- package/Build/Workers/chunk-PAFMAR7A.js +0 -2357
- package/Build/Workers/chunk-S53HSRT6.js +0 -114
|
@@ -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;
|
|
@@ -2,12 +2,17 @@ import defined from "../../Core/defined.js";
|
|
|
2
2
|
import Cartesian3 from "../../Core/Cartesian3.js";
|
|
3
3
|
import Cartesian4 from "../../Core/Cartesian4.js";
|
|
4
4
|
import Matrix3 from "../../Core/Matrix3.js";
|
|
5
|
+
import Matrix4 from "../../Core/Matrix4.js";
|
|
6
|
+
import Transforms from "../../Core/Transforms.js";
|
|
5
7
|
import ShaderDestination from "../../Renderer/ShaderDestination.js";
|
|
6
8
|
import Pass from "../../Renderer/Pass.js";
|
|
7
9
|
import MaterialStageFS from "../../Shaders/Model/MaterialStageFS.js";
|
|
10
|
+
import ConstantLodStageVS from "../../Shaders/Model/ConstantLodStageVS.js";
|
|
11
|
+
import ConstantLodStageFS from "../../Shaders/Model/ConstantLodStageFS.js";
|
|
8
12
|
import AlphaMode from "../AlphaMode.js";
|
|
9
13
|
import ModelComponents from "../ModelComponents.js";
|
|
10
14
|
import VertexAttributeSemantic from "../VertexAttributeSemantic.js";
|
|
15
|
+
import PrimitiveType from "../../Core/PrimitiveType.js";
|
|
11
16
|
import LightingModel from "./LightingModel.js";
|
|
12
17
|
import ModelUtility from "./ModelUtility.js";
|
|
13
18
|
|
|
@@ -60,6 +65,25 @@ MaterialPipelineStage.process = function (
|
|
|
60
65
|
const material = primitive.material;
|
|
61
66
|
const { model, uniformMap, shaderBuilder } = renderResources;
|
|
62
67
|
|
|
68
|
+
if (!defined(uniformMap.u_constantLodDistance)) {
|
|
69
|
+
uniformMap.u_constantLodDistance = function () {
|
|
70
|
+
const boundingSphere = model.boundingSphere;
|
|
71
|
+
const camera = frameState.camera;
|
|
72
|
+
|
|
73
|
+
if (defined(boundingSphere) && defined(camera)) {
|
|
74
|
+
const distance = Cartesian3.distance(
|
|
75
|
+
camera.positionWC,
|
|
76
|
+
boundingSphere.center,
|
|
77
|
+
);
|
|
78
|
+
// Clamp to a minimum small distance to avoid calling log2(0) in shader
|
|
79
|
+
return Math.max(distance, 0.1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Return a fallback distance before camera/bounding sphere are available
|
|
83
|
+
return 1.0;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
63
87
|
// Classification models only use position and feature ID attributes,
|
|
64
88
|
// so textures should be disabled to avoid compile errors.
|
|
65
89
|
const hasClassification = defined(model.classificationType);
|
|
@@ -77,6 +101,7 @@ MaterialPipelineStage.process = function (
|
|
|
77
101
|
defaultNormalTexture,
|
|
78
102
|
defaultEmissiveTexture,
|
|
79
103
|
disableTextures,
|
|
104
|
+
renderResources,
|
|
80
105
|
);
|
|
81
106
|
|
|
82
107
|
if (defined(material.specularGlossiness)) {
|
|
@@ -86,6 +111,7 @@ MaterialPipelineStage.process = function (
|
|
|
86
111
|
shaderBuilder,
|
|
87
112
|
defaultTexture,
|
|
88
113
|
disableTextures,
|
|
114
|
+
renderResources,
|
|
89
115
|
);
|
|
90
116
|
} else {
|
|
91
117
|
if (
|
|
@@ -130,6 +156,7 @@ MaterialPipelineStage.process = function (
|
|
|
130
156
|
shaderBuilder,
|
|
131
157
|
defaultTexture,
|
|
132
158
|
disableTextures,
|
|
159
|
+
renderResources,
|
|
133
160
|
);
|
|
134
161
|
}
|
|
135
162
|
|
|
@@ -184,6 +211,16 @@ MaterialPipelineStage.process = function (
|
|
|
184
211
|
};
|
|
185
212
|
}
|
|
186
213
|
|
|
214
|
+
if (defined(material.lineStyle)) {
|
|
215
|
+
processLineStyleUniforms(
|
|
216
|
+
material.lineStyle,
|
|
217
|
+
primitive,
|
|
218
|
+
frameState,
|
|
219
|
+
uniformMap,
|
|
220
|
+
shaderBuilder,
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
187
224
|
shaderBuilder.addFragmentLines(MaterialStageFS);
|
|
188
225
|
|
|
189
226
|
if (material.doubleSided) {
|
|
@@ -195,6 +232,248 @@ MaterialPipelineStage.process = function (
|
|
|
195
232
|
}
|
|
196
233
|
};
|
|
197
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Process constant LOD extension for a texture
|
|
237
|
+
*
|
|
238
|
+
* @param {ShaderBuilder} shaderBuilder The shader builder to modify
|
|
239
|
+
* @param {Object<string, Function>} uniformMap The uniform map to modify.
|
|
240
|
+
* @param {ModelComponents.TextureReader} textureReader The texture to add to the shader
|
|
241
|
+
* @param {string} uniformName The name of the sampler uniform
|
|
242
|
+
* @param {string} defineName The name of the texture for use in the defines
|
|
243
|
+
* @param {PrimitiveRenderResources|undefined} renderResources The render resources
|
|
244
|
+
* @private
|
|
245
|
+
*/
|
|
246
|
+
function processConstantLod(
|
|
247
|
+
shaderBuilder,
|
|
248
|
+
uniformMap,
|
|
249
|
+
textureReader,
|
|
250
|
+
uniformName,
|
|
251
|
+
defineName,
|
|
252
|
+
renderResources,
|
|
253
|
+
) {
|
|
254
|
+
const constantLod = textureReader.constantLod;
|
|
255
|
+
|
|
256
|
+
if (!defined(constantLod)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// renderResources is required for constant LOD to transform from ECEF/world coordinates to ENU
|
|
261
|
+
if (!defined(renderResources)) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const constantLodDefine = `HAS_${defineName}_CONSTANT_LOD`;
|
|
266
|
+
shaderBuilder.addDefine(constantLodDefine, undefined, ShaderDestination.BOTH);
|
|
267
|
+
|
|
268
|
+
if (!defined(uniformMap.u_constantLodOffset)) {
|
|
269
|
+
shaderBuilder.addDefine(
|
|
270
|
+
"HAS_CONSTANT_LOD",
|
|
271
|
+
undefined,
|
|
272
|
+
ShaderDestination.BOTH,
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
shaderBuilder.addVarying("vec3", "v_constantLodUvCustom");
|
|
276
|
+
|
|
277
|
+
shaderBuilder.addUniform(
|
|
278
|
+
"vec2",
|
|
279
|
+
"u_constantLodOffset",
|
|
280
|
+
ShaderDestination.VERTEX,
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
shaderBuilder.addUniform(
|
|
284
|
+
"float",
|
|
285
|
+
"u_constantLodDistance",
|
|
286
|
+
ShaderDestination.VERTEX,
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
shaderBuilder.addUniform(
|
|
290
|
+
"mat4",
|
|
291
|
+
"u_constantLodWorldToEnu",
|
|
292
|
+
ShaderDestination.VERTEX,
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
shaderBuilder.addFragmentLines(ConstantLodStageFS);
|
|
296
|
+
|
|
297
|
+
const constantLodLines = ConstantLodStageVS.split("\n").filter((line) => {
|
|
298
|
+
return !line.trim().startsWith("//") || line.includes("#");
|
|
299
|
+
});
|
|
300
|
+
shaderBuilder.addFunctionLines("setDynamicVaryingsVS", constantLodLines);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const paramsUniformName = `${uniformName}ConstantLodParams`;
|
|
304
|
+
shaderBuilder.addUniform(
|
|
305
|
+
"vec3",
|
|
306
|
+
paramsUniformName,
|
|
307
|
+
ShaderDestination.FRAGMENT,
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
uniformMap[paramsUniformName] = function () {
|
|
311
|
+
return new Cartesian3(
|
|
312
|
+
constantLod.minClampDistance,
|
|
313
|
+
constantLod.maxClampDistance,
|
|
314
|
+
constantLod.repetitions,
|
|
315
|
+
);
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
if (!defined(uniformMap.u_constantLodOffset)) {
|
|
319
|
+
uniformMap.u_constantLodOffset = function () {
|
|
320
|
+
return constantLod.offset;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const enuMatrixInverse = Matrix4.clone(Matrix4.IDENTITY);
|
|
324
|
+
let matrixComputed = false;
|
|
325
|
+
|
|
326
|
+
uniformMap.u_constantLodWorldToEnu = function () {
|
|
327
|
+
if (!matrixComputed) {
|
|
328
|
+
const boundingSphere = renderResources.model.boundingSphere;
|
|
329
|
+
if (defined(boundingSphere)) {
|
|
330
|
+
const modelCenter = boundingSphere.center;
|
|
331
|
+
const enuFrame = Transforms.eastNorthUpToFixedFrame(modelCenter);
|
|
332
|
+
Matrix4.inverse(enuFrame, enuMatrixInverse);
|
|
333
|
+
matrixComputed = true;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return matrixComputed ? enuMatrixInverse : Matrix4.IDENTITY;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Add uniforms and defines for the BENTLEY_materials_line_style extension.
|
|
343
|
+
*
|
|
344
|
+
* @param {ModelComponents.LineStyle} lineStyle The line style properties.
|
|
345
|
+
* @param {ModelComponents.Primitive} primitive The primitive being processed.
|
|
346
|
+
* @param {FrameState} frameState The frame state.
|
|
347
|
+
* @param {object} uniformMap The uniform map for the primitive.
|
|
348
|
+
* @param {ShaderBuilder} shaderBuilder The shader builder to modify.
|
|
349
|
+
* @private
|
|
350
|
+
*/
|
|
351
|
+
function processLineStyleUniforms(
|
|
352
|
+
lineStyle,
|
|
353
|
+
primitive,
|
|
354
|
+
frameState,
|
|
355
|
+
uniformMap,
|
|
356
|
+
shaderBuilder,
|
|
357
|
+
) {
|
|
358
|
+
const { width, pattern } = lineStyle;
|
|
359
|
+
|
|
360
|
+
if (defined(width)) {
|
|
361
|
+
shaderBuilder.addUniform("float", "u_lineWidth", ShaderDestination.VERTEX);
|
|
362
|
+
uniformMap.u_lineWidth = function () {
|
|
363
|
+
return width * frameState.pixelRatio;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (defined(pattern)) {
|
|
368
|
+
shaderBuilder.addDefine(
|
|
369
|
+
"HAS_LINE_PATTERN",
|
|
370
|
+
undefined,
|
|
371
|
+
ShaderDestination.BOTH,
|
|
372
|
+
);
|
|
373
|
+
shaderBuilder.addUniform(
|
|
374
|
+
"float",
|
|
375
|
+
"u_linePattern",
|
|
376
|
+
ShaderDestination.FRAGMENT,
|
|
377
|
+
);
|
|
378
|
+
shaderBuilder.addVarying("float", "v_lineCoord");
|
|
379
|
+
uniformMap.u_linePattern = function () {
|
|
380
|
+
return pattern;
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const cumDistAttribute = ModelUtility.getAttributeBySemantic(
|
|
385
|
+
primitive,
|
|
386
|
+
VertexAttributeSemantic.CUMULATIVE_DISTANCE,
|
|
387
|
+
);
|
|
388
|
+
if (
|
|
389
|
+
defined(pattern) &&
|
|
390
|
+
defined(cumDistAttribute) &&
|
|
391
|
+
(primitive.primitiveType === PrimitiveType.LINES ||
|
|
392
|
+
primitive.primitiveType === PrimitiveType.TRIANGLE_STRIP)
|
|
393
|
+
) {
|
|
394
|
+
shaderBuilder.addDefine(
|
|
395
|
+
"HAS_LINE_CUMULATIVE_DISTANCE",
|
|
396
|
+
undefined,
|
|
397
|
+
ShaderDestination.VERTEX,
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
if (cumDistAttribute.normalized) {
|
|
401
|
+
shaderBuilder.addDefine(
|
|
402
|
+
"LINE_CUM_DIST_NORMALIZED",
|
|
403
|
+
undefined,
|
|
404
|
+
ShaderDestination.VERTEX,
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
shaderBuilder.addUniform(
|
|
409
|
+
"float",
|
|
410
|
+
"u_cumulativeDistanceMax",
|
|
411
|
+
ShaderDestination.VERTEX,
|
|
412
|
+
);
|
|
413
|
+
shaderBuilder.addUniform(
|
|
414
|
+
"float",
|
|
415
|
+
"u_pixelsPerWorld",
|
|
416
|
+
ShaderDestination.VERTEX,
|
|
417
|
+
);
|
|
418
|
+
|
|
419
|
+
const cumDistMax = defined(cumDistAttribute.max)
|
|
420
|
+
? cumDistAttribute.max
|
|
421
|
+
: 1.0;
|
|
422
|
+
uniformMap.u_cumulativeDistanceMax = function () {
|
|
423
|
+
return cumDistMax;
|
|
424
|
+
};
|
|
425
|
+
uniformMap.u_pixelsPerWorld = function () {
|
|
426
|
+
// Match iTwin behavior: stable pattern scaling in orthographic views.
|
|
427
|
+
const frustum = frameState.camera.frustum;
|
|
428
|
+
let pixelsPerWorld = 1.0;
|
|
429
|
+
let worldWidth;
|
|
430
|
+
if (defined(frustum.right) && defined(frustum.left)) {
|
|
431
|
+
worldWidth = frustum.right - frustum.left;
|
|
432
|
+
} else if (defined(frustum.width)) {
|
|
433
|
+
worldWidth = frustum.width;
|
|
434
|
+
}
|
|
435
|
+
if (defined(worldWidth) && worldWidth > 0) {
|
|
436
|
+
pixelsPerWorld = frameState.context.drawingBufferWidth / worldWidth;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return pixelsPerWorld;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
const cumDistVar =
|
|
443
|
+
ModelUtility.getAttributeInfo(cumDistAttribute).variableName;
|
|
444
|
+
shaderBuilder.addVertexLines(`
|
|
445
|
+
#ifdef HAS_LINE_CUMULATIVE_DISTANCE
|
|
446
|
+
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
447
|
+
{
|
|
448
|
+
float cumDist = attributes.${cumDistVar};
|
|
449
|
+
#ifdef LINE_CUM_DIST_NORMALIZED
|
|
450
|
+
cumDist *= u_cumulativeDistanceMax;
|
|
451
|
+
#endif
|
|
452
|
+
const float textureCoordinateBase = 8192.0;
|
|
453
|
+
v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
|
|
454
|
+
}
|
|
455
|
+
#endif
|
|
456
|
+
`);
|
|
457
|
+
} else if (defined(pattern)) {
|
|
458
|
+
shaderBuilder.addVertexLines(`
|
|
459
|
+
#ifdef HAS_LINE_PATTERN
|
|
460
|
+
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
461
|
+
{
|
|
462
|
+
vec4 posClip = gl_Position;
|
|
463
|
+
vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
464
|
+
|
|
465
|
+
const float textureCoordinateBase = 8192.0;
|
|
466
|
+
if (czm_viewport.z > czm_viewport.w) {
|
|
467
|
+
v_lineCoord = textureCoordinateBase + screenPos.x;
|
|
468
|
+
} else {
|
|
469
|
+
v_lineCoord = textureCoordinateBase + screenPos.y;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
#endif
|
|
473
|
+
`);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
198
477
|
/**
|
|
199
478
|
* Process a single texture transformation and add it to the shader and uniform map.
|
|
200
479
|
*
|
|
@@ -279,6 +558,8 @@ function processTextureScale(
|
|
|
279
558
|
* @param {ModelComponents.TextureReader} textureReader The texture to add to the shader
|
|
280
559
|
* @param {string} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>
|
|
281
560
|
* @param {string} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, "BASE_COLOR" or "EMISSIVE"
|
|
561
|
+
* @param {Texture} defaultTexture The default texture to use as a fallback if the texture is not yet loaded
|
|
562
|
+
* @param {PrimitiveRenderResources|undefined} renderResources The render resources
|
|
282
563
|
*
|
|
283
564
|
* @private
|
|
284
565
|
*/
|
|
@@ -289,6 +570,7 @@ function processTexture(
|
|
|
289
570
|
uniformName,
|
|
290
571
|
defineName,
|
|
291
572
|
defaultTexture,
|
|
573
|
+
renderResources,
|
|
292
574
|
) {
|
|
293
575
|
// Add a uniform for the texture itself
|
|
294
576
|
shaderBuilder.addUniform(
|
|
@@ -340,6 +622,16 @@ function processTexture(
|
|
|
340
622
|
defineName,
|
|
341
623
|
);
|
|
342
624
|
}
|
|
625
|
+
|
|
626
|
+
// Process constant LOD extension if present
|
|
627
|
+
processConstantLod(
|
|
628
|
+
shaderBuilder,
|
|
629
|
+
uniformMap,
|
|
630
|
+
textureReader,
|
|
631
|
+
uniformName,
|
|
632
|
+
defineName,
|
|
633
|
+
renderResources,
|
|
634
|
+
);
|
|
343
635
|
}
|
|
344
636
|
|
|
345
637
|
function processMaterialUniforms(
|
|
@@ -350,6 +642,7 @@ function processMaterialUniforms(
|
|
|
350
642
|
defaultNormalTexture,
|
|
351
643
|
defaultEmissiveTexture,
|
|
352
644
|
disableTextures,
|
|
645
|
+
renderResources,
|
|
353
646
|
) {
|
|
354
647
|
const { emissiveFactor, emissiveTexture, normalTexture, occlusionTexture } =
|
|
355
648
|
material;
|
|
@@ -384,14 +677,43 @@ function processMaterialUniforms(
|
|
|
384
677
|
}
|
|
385
678
|
}
|
|
386
679
|
|
|
680
|
+
// Extract base color constant LOD to apply to normal texture
|
|
681
|
+
let baseColorConstantLod;
|
|
682
|
+
if (
|
|
683
|
+
defined(material.metallicRoughness) &&
|
|
684
|
+
defined(material.metallicRoughness.baseColorTexture) &&
|
|
685
|
+
defined(material.metallicRoughness.baseColorTexture.constantLod)
|
|
686
|
+
) {
|
|
687
|
+
baseColorConstantLod =
|
|
688
|
+
material.metallicRoughness.baseColorTexture.constantLod;
|
|
689
|
+
} else if (
|
|
690
|
+
defined(material.specularGlossiness) &&
|
|
691
|
+
defined(material.specularGlossiness.diffuseTexture) &&
|
|
692
|
+
defined(material.specularGlossiness.diffuseTexture.constantLod)
|
|
693
|
+
) {
|
|
694
|
+
baseColorConstantLod =
|
|
695
|
+
material.specularGlossiness.diffuseTexture.constantLod;
|
|
696
|
+
}
|
|
697
|
+
|
|
387
698
|
if (defined(normalTexture) && !disableTextures) {
|
|
699
|
+
// If normal texture AND base color have constant LOD, use base color's constant LOD properties to keep textures in sync
|
|
700
|
+
let normalTextureToProcess = normalTexture;
|
|
701
|
+
if (defined(normalTexture.constantLod) && defined(baseColorConstantLod)) {
|
|
702
|
+
normalTextureToProcess = Object.create(
|
|
703
|
+
Object.getPrototypeOf(normalTexture),
|
|
704
|
+
);
|
|
705
|
+
Object.assign(normalTextureToProcess, normalTexture);
|
|
706
|
+
normalTextureToProcess.constantLod = baseColorConstantLod;
|
|
707
|
+
}
|
|
708
|
+
|
|
388
709
|
processTexture(
|
|
389
710
|
shaderBuilder,
|
|
390
711
|
uniformMap,
|
|
391
|
-
|
|
712
|
+
normalTextureToProcess,
|
|
392
713
|
"u_normalTexture",
|
|
393
714
|
"NORMAL",
|
|
394
715
|
defaultNormalTexture,
|
|
716
|
+
renderResources,
|
|
395
717
|
);
|
|
396
718
|
}
|
|
397
719
|
|
|
@@ -413,8 +735,9 @@ function processMaterialUniforms(
|
|
|
413
735
|
* @param {ModelComponents.SpecularGlossiness} specularGlossiness
|
|
414
736
|
* @param {Object<string, Function>} uniformMap The uniform map to modify.
|
|
415
737
|
* @param {ShaderBuilder} shaderBuilder
|
|
416
|
-
* @param {Texture} defaultTexture
|
|
738
|
+
* @param {Texture} defaultTexture The default texture to use as a fallback if the texture is not yet loaded
|
|
417
739
|
* @param {boolean} disableTextures
|
|
740
|
+
* @param {PrimitiveRenderResources|undefined} renderResources The render resources for the primitive
|
|
418
741
|
* @private
|
|
419
742
|
*/
|
|
420
743
|
function processSpecularGlossinessUniforms(
|
|
@@ -423,6 +746,7 @@ function processSpecularGlossinessUniforms(
|
|
|
423
746
|
shaderBuilder,
|
|
424
747
|
defaultTexture,
|
|
425
748
|
disableTextures,
|
|
749
|
+
renderResources,
|
|
426
750
|
) {
|
|
427
751
|
const {
|
|
428
752
|
diffuseTexture,
|
|
@@ -446,6 +770,7 @@ function processSpecularGlossinessUniforms(
|
|
|
446
770
|
"u_diffuseTexture",
|
|
447
771
|
"DIFFUSE",
|
|
448
772
|
defaultTexture,
|
|
773
|
+
renderResources,
|
|
449
774
|
);
|
|
450
775
|
}
|
|
451
776
|
|
|
@@ -778,8 +1103,9 @@ function processClearcoatUniforms(
|
|
|
778
1103
|
* @param {ModelComponents.MetallicRoughness} metallicRoughness
|
|
779
1104
|
* @param {Object<string, Function>} uniformMap The uniform map to modify.
|
|
780
1105
|
* @param {ShaderBuilder} shaderBuilder
|
|
781
|
-
* @param {Texture} defaultTexture
|
|
1106
|
+
* @param {Texture} defaultTexture The default texture to use as a fallback if the texture is not yet loaded
|
|
782
1107
|
* @param {boolean} disableTextures
|
|
1108
|
+
* @param {PrimitiveRenderResources|undefined} renderResources The render resources for the primitive
|
|
783
1109
|
* @private
|
|
784
1110
|
*/
|
|
785
1111
|
function processMetallicRoughnessUniforms(
|
|
@@ -788,6 +1114,7 @@ function processMetallicRoughnessUniforms(
|
|
|
788
1114
|
shaderBuilder,
|
|
789
1115
|
defaultTexture,
|
|
790
1116
|
disableTextures,
|
|
1117
|
+
renderResources,
|
|
791
1118
|
) {
|
|
792
1119
|
shaderBuilder.addDefine(
|
|
793
1120
|
"USE_METALLIC_ROUGHNESS",
|
|
@@ -804,6 +1131,7 @@ function processMetallicRoughnessUniforms(
|
|
|
804
1131
|
"u_baseColorTexture",
|
|
805
1132
|
"BASE_COLOR",
|
|
806
1133
|
defaultTexture,
|
|
1134
|
+
renderResources,
|
|
807
1135
|
);
|
|
808
1136
|
}
|
|
809
1137
|
|
|
@@ -1030,20 +1030,20 @@ function collectMetadataUsedInPointCloudStyling(
|
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
1032
|
|
|
1033
|
-
const colorVariables = style.color?.getVariables() ?? [];
|
|
1033
|
+
const colorVariables = style.color?.getVariables?.() ?? [];
|
|
1034
1034
|
for (const propertyId of colorVariables) {
|
|
1035
1035
|
usedInVertex.add(propertyId);
|
|
1036
1036
|
usedInFragment.add(propertyId);
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
|
-
const showVariables = style.show?.getVariables() ?? [];
|
|
1039
|
+
const showVariables = style.show?.getVariables?.() ?? [];
|
|
1040
1040
|
for (const propertyId of showVariables) {
|
|
1041
1041
|
usedInVertex.add(propertyId);
|
|
1042
1042
|
usedInFragment.add(propertyId);
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
1045
|
// Only used in vertex shader
|
|
1046
|
-
const pointSizeVariables = style.pointSize?.getVariables() ?? [];
|
|
1046
|
+
const pointSizeVariables = style.pointSize?.getVariables?.() ?? [];
|
|
1047
1047
|
for (const propertyId of pointSizeVariables) {
|
|
1048
1048
|
usedInVertex.add(propertyId);
|
|
1049
1049
|
}
|
|
@@ -574,6 +574,11 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) {
|
|
|
574
574
|
|
|
575
575
|
pushCommand(result, this._originalCommand, use2D);
|
|
576
576
|
|
|
577
|
+
// Push edge commands after the original command
|
|
578
|
+
if (this._needsEdgeCommands) {
|
|
579
|
+
pushCommand(result, this._edgeCommand, use2D);
|
|
580
|
+
}
|
|
581
|
+
|
|
577
582
|
return result;
|
|
578
583
|
};
|
|
579
584
|
|
|
@@ -815,6 +820,7 @@ function deriveEdgeCommand(command, renderResources) {
|
|
|
815
820
|
};
|
|
816
821
|
edgeCommand.uniformMap = uniformMap;
|
|
817
822
|
|
|
823
|
+
edgeCommand.uniformMap = uniformMap;
|
|
818
824
|
edgeCommand.castShadows = false;
|
|
819
825
|
edgeCommand.receiveShadows = false;
|
|
820
826
|
|