@cesium/engine 1.1.0 → 2.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/{AxisAlignedBoundingBox-a4321399.js → AxisAlignedBoundingBox-47525601.js} +1 -1
- package/Build/Workers/{BoundingRectangle-80d8801f.js → BoundingRectangle-93b263ac.js} +1 -1
- package/Build/Workers/{BoxGeometry-33c10a4f.js → BoxGeometry-8c4b4125.js} +1 -1
- package/Build/Workers/{Color-1bf9a6e0.js → Color-52c60ed7.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-5c5b981b.js → CoplanarPolygonGeometryLibrary-33c4c1f8.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-7cbae7a0.js → CorridorGeometryLibrary-5039cd8e.js} +1 -1
- package/Build/Workers/{CylinderGeometry-42740df0.js → CylinderGeometry-3ac44974.js} +1 -1
- package/Build/Workers/{EllipseGeometry-49a3ac21.js → EllipseGeometry-a9c9b3be.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-b891b2f8.js → EllipseGeometryLibrary-855d4681.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-fbd72e07.js → EllipseOutlineGeometry-017a5929.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-a351dba8.js → EllipsoidGeometry-826e7bce.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-3e8779bf.js → EllipsoidOutlineGeometry-784dcdb5.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-cfb50678.js → EllipsoidTangentPlane-ed9443a1.js} +1 -1
- package/Build/Workers/{FrustumGeometry-c5754412.js → FrustumGeometry-9f1ee4d8.js} +1 -1
- package/Build/Workers/{GeometryAttribute-0bfd05e8.js → GeometryAttribute-334718f8.js} +1 -1
- package/Build/Workers/{GeometryPipeline-0166905d.js → GeometryPipeline-8fb0db69.js} +1 -1
- package/Build/Workers/{IntersectionTests-a93d3de9.js → IntersectionTests-27d49265.js} +1 -1
- package/Build/Workers/{OrientedBoundingBox-b450cb61.js → OrientedBoundingBox-79ee7cbb.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-f918ac26.js → PolygonGeometryLibrary-6b5a29e9.js} +1 -1
- package/Build/Workers/{PolygonPipeline-f59a8f0a.js → PolygonPipeline-21668b3f.js} +1 -1
- package/Build/Workers/{PolylinePipeline-d8e6bd9b.js → PolylinePipeline-5e2e1b21.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-125d2edf.js → PolylineVolumeGeometryLibrary-97f0b94e.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-0d7b5ed4.js → PrimitivePipeline-5640850a.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-0768db63.js → RectangleGeometryLibrary-d5457f7b.js} +1 -1
- package/Build/Workers/{TerrainEncoding-06470d7f.js → TerrainEncoding-bfdf2021.js} +1 -1
- package/Build/Workers/{Transforms-26539bce.js → Transforms-a05e5e6e.js} +17 -0
- package/Build/Workers/{WallGeometryLibrary-6167b0fc.js → WallGeometryLibrary-6db0ebb6.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +68 -2
- package/Build/Workers/combineGeometry.js +1 -1
- package/Build/Workers/createBoxGeometry.js +1 -1
- package/Build/Workers/createBoxOutlineGeometry.js +1 -1
- package/Build/Workers/createCircleGeometry.js +1 -1
- package/Build/Workers/createCircleOutlineGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createCorridorGeometry.js +1 -1
- package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
- package/Build/Workers/createCylinderGeometry.js +1 -1
- package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipseGeometry.js +1 -1
- package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipsoidGeometry.js +1 -1
- package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/Build/Workers/createFrustumGeometry.js +1 -1
- package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
- package/Build/Workers/createGeometry.js +1 -1
- package/Build/Workers/createGroundPolylineGeometry.js +1 -1
- package/Build/Workers/createPlaneGeometry.js +1 -1
- package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
- package/Build/Workers/createPolygonGeometry.js +1 -1
- package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createPolylineGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/Build/Workers/createRectangleGeometry.js +1 -1
- package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
- package/Build/Workers/createSimplePolylineGeometry.js +1 -1
- package/Build/Workers/createSphereGeometry.js +1 -1
- package/Build/Workers/createSphereOutlineGeometry.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +1 -1
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/decodeDraco.js +9 -1
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transcodeKTX2.js +22 -2
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/README.md +14 -16
- package/Source/Core/FeatureDetection.js +18 -0
- package/Source/Core/Ion.js +1 -2
- package/Source/Core/PixelFormat.js +22 -2
- package/Source/Core/sampleTerrain.js +5 -0
- package/Source/Renderer/AutomaticUniforms.js +3 -3
- package/Source/Renderer/Context.js +4 -14
- package/Source/Renderer/ShaderBuilder.js +13 -12
- package/Source/Renderer/ShaderSource.js +31 -26
- package/Source/Renderer/demodernizeShader.js +76 -0
- package/Source/Scene/AutoExposure.js +5 -5
- package/Source/Scene/BatchTable.js +5 -5
- package/Source/Scene/BillboardCollection.js +2 -2
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/Cesium3DTile.js +8 -2
- package/Source/Scene/Cesium3DTileBatchTable.js +28 -28
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +6 -1
- package/Source/Scene/ClassificationPrimitive.js +3 -8
- package/Source/Scene/DebugAppearance.js +7 -9
- package/Source/Scene/DebugInspector.js +5 -5
- package/Source/Scene/DepthPlane.js +0 -6
- package/Source/Scene/DerivedCommand.js +8 -22
- package/Source/Scene/EllipsoidPrimitive.js +0 -7
- package/Source/Scene/GlobeTranslucencyState.js +6 -6
- package/Source/Scene/GroundPolylinePrimitive.js +2 -4
- package/Source/Scene/InvertClassification.js +9 -10
- package/Source/Scene/Material.js +6 -6
- package/Source/Scene/Megatexture.js +2 -2
- package/Source/Scene/MetadataSemantic.js +8 -0
- package/Source/Scene/Model/CustomShader.js +1 -1
- package/Source/Scene/Model/FeatureIdPipelineStage.js +4 -4
- package/Source/Scene/Model/LightingModel.js +1 -1
- package/Source/Scene/Model/MetadataPipelineStage.js +1 -1
- package/Source/Scene/Model/PickingPipelineStage.js +1 -1
- package/Source/Scene/OIT.js +211 -119
- package/Source/Scene/PickDepth.js +2 -2
- package/Source/Scene/PointCloud.js +11 -11
- package/Source/Scene/PointCloudEyeDomeLighting.js +9 -4
- package/Source/Scene/PolylineCollection.js +2 -7
- package/Source/Scene/PolylineMaterialAppearance.js +2 -3
- package/Source/Scene/PostProcessStage.js +13 -13
- package/Source/Scene/PostProcessStageLibrary.js +3 -3
- package/Source/Scene/Primitive.js +22 -31
- package/Source/Scene/ShadowMap.js +7 -7
- package/Source/Scene/ShadowMapShader.js +9 -9
- package/Source/Scene/ShadowVolumeAppearance.js +1 -1
- package/Source/Scene/TextureAtlas.js +5 -3
- package/Source/Scene/Vector3DTilePolylines.js +1 -1
- package/Source/Scene/Vector3DTilePrimitive.js +2 -2
- package/Source/Scene/VoxelEllipsoidShape.js +15 -7
- package/Source/Scene/VoxelPrimitive.js +4 -4
- package/Source/Scene/computeFlyToLocationForRectangle.js +10 -1
- package/Source/Scene/createElevationBandMaterial.js +10 -15
- package/Source/Scene/getClipAndStyleCode.js +1 -1
- package/Source/Scene/getClippingFunction.js +3 -3
- package/Source/Scene/processVoxelProperties.js +1 -1
- package/Source/Shaders/AdjustTranslucentFS.glsl +9 -6
- package/Source/Shaders/AdjustTranslucentFS.js +9 -6
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +7 -7
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +7 -7
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +12 -12
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +12 -12
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +4 -4
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +4 -4
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +6 -6
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +6 -6
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +5 -5
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +5 -5
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +7 -7
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +7 -7
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +4 -4
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +4 -4
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +8 -8
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +8 -8
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +2 -2
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +2 -2
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +5 -5
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +5 -5
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +10 -10
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +10 -10
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +12 -12
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +12 -12
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +5 -5
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +5 -5
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +8 -8
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +8 -8
- package/Source/Shaders/BillboardCollectionFS.glsl +15 -15
- package/Source/Shaders/BillboardCollectionFS.js +15 -15
- package/Source/Shaders/BillboardCollectionVS.glsl +23 -23
- package/Source/Shaders/BillboardCollectionVS.js +23 -23
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +2 -2
- package/Source/Shaders/BrdfLutGeneratorFS.js +2 -2
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.glsl +3 -3
- package/Source/Shaders/Builtin/Functions/depthClamp.js +3 -3
- package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +4 -4
- package/Source/Shaders/Builtin/Functions/getWaterNoise.js +4 -4
- package/Source/Shaders/Builtin/Functions/phong.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/phong.js +1 -1
- package/Source/Shaders/Builtin/Functions/readDepth.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/readDepth.js +1 -1
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +5 -5
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +5 -5
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +3 -3
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +3 -3
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +1 -1
- package/Source/Shaders/Builtin/Functions/textureCube.glsl +17 -0
- package/Source/Shaders/Builtin/Functions/textureCube.js +18 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +2 -2
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +2 -2
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +2 -2
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +2 -2
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +5 -8
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +5 -8
- package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +6 -6
- package/Source/Shaders/Builtin/Functions/writeLogDepth.js +6 -6
- package/Source/Shaders/CloudCollectionFS.glsl +18 -18
- package/Source/Shaders/CloudCollectionFS.js +18 -18
- package/Source/Shaders/CloudCollectionVS.glsl +11 -11
- package/Source/Shaders/CloudCollectionVS.js +11 -11
- package/Source/Shaders/CloudNoiseFS.glsl +5 -5
- package/Source/Shaders/CloudNoiseFS.js +5 -5
- package/Source/Shaders/CloudNoiseVS.glsl +2 -2
- package/Source/Shaders/CloudNoiseVS.js +2 -2
- package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +4 -4
- package/Source/Shaders/CompareAndPackTranslucentDepth.js +4 -4
- package/Source/Shaders/CompositeOITFS.glsl +6 -6
- package/Source/Shaders/CompositeOITFS.js +6 -6
- package/Source/Shaders/DepthPlaneFS.glsl +2 -2
- package/Source/Shaders/DepthPlaneFS.js +2 -2
- package/Source/Shaders/DepthPlaneVS.glsl +2 -2
- package/Source/Shaders/DepthPlaneVS.js +2 -2
- package/Source/Shaders/EllipsoidFS.glsl +5 -13
- package/Source/Shaders/EllipsoidFS.js +6 -14
- package/Source/Shaders/EllipsoidVS.glsl +2 -2
- package/Source/Shaders/EllipsoidVS.js +2 -2
- package/Source/Shaders/FXAA3_11.glsl +4 -4
- package/Source/Shaders/FXAA3_11.js +4 -4
- package/Source/Shaders/GlobeFS.glsl +15 -15
- package/Source/Shaders/GlobeFS.js +15 -15
- package/Source/Shaders/GlobeVS.glsl +17 -17
- package/Source/Shaders/GlobeVS.js +17 -17
- package/Source/Shaders/Materials/AspectRampMaterial.glsl +1 -1
- package/Source/Shaders/Materials/AspectRampMaterial.js +1 -1
- package/Source/Shaders/Materials/BumpMapMaterial.glsl +3 -3
- package/Source/Shaders/Materials/BumpMapMaterial.js +3 -3
- package/Source/Shaders/Materials/ElevationBandMaterial.glsl +3 -3
- package/Source/Shaders/Materials/ElevationBandMaterial.js +3 -3
- package/Source/Shaders/Materials/ElevationContourMaterial.glsl +2 -1
- package/Source/Shaders/Materials/ElevationContourMaterial.js +2 -1
- package/Source/Shaders/Materials/ElevationRampMaterial.glsl +1 -1
- package/Source/Shaders/Materials/ElevationRampMaterial.js +1 -1
- package/Source/Shaders/Materials/GridMaterial.glsl +3 -2
- package/Source/Shaders/Materials/GridMaterial.js +3 -2
- package/Source/Shaders/Materials/NormalMapMaterial.glsl +1 -1
- package/Source/Shaders/Materials/NormalMapMaterial.js +1 -1
- package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +3 -2
- package/Source/Shaders/Materials/PolylineArrowMaterial.js +3 -2
- package/Source/Shaders/Materials/PolylineDashMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineDashMaterial.js +1 -1
- package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineOutlineMaterial.js +1 -1
- package/Source/Shaders/Materials/SlopeRampMaterial.glsl +1 -1
- package/Source/Shaders/Materials/SlopeRampMaterial.js +1 -1
- package/Source/Shaders/Materials/Water.glsl +1 -1
- package/Source/Shaders/Materials/Water.js +1 -1
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +3 -3
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +3 -3
- package/Source/Shaders/Model/MaterialStageFS.glsl +10 -10
- package/Source/Shaders/Model/MaterialStageFS.js +10 -10
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +3 -3
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +3 -3
- package/Source/Shaders/Model/ModelFS.glsl +1 -1
- package/Source/Shaders/Model/ModelFS.js +1 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +3 -3
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +3 -3
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +1 -1
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +1 -1
- package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +8 -8
- package/Source/Shaders/OctahedralProjectionAtlasFS.js +8 -8
- package/Source/Shaders/OctahedralProjectionFS.glsl +4 -4
- package/Source/Shaders/OctahedralProjectionFS.js +4 -4
- package/Source/Shaders/OctahedralProjectionVS.glsl +3 -3
- package/Source/Shaders/OctahedralProjectionVS.js +3 -3
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +6 -6
- package/Source/Shaders/PointPrimitiveCollectionFS.js +6 -6
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +12 -12
- package/Source/Shaders/PointPrimitiveCollectionVS.js +12 -12
- package/Source/Shaders/PolylineFS.glsl +3 -3
- package/Source/Shaders/PolylineFS.js +3 -3
- package/Source/Shaders/PolylineShadowVolumeFS.glsl +12 -16
- package/Source/Shaders/PolylineShadowVolumeFS.js +12 -16
- package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +8 -8
- package/Source/Shaders/PolylineShadowVolumeMorphFS.js +8 -8
- package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +20 -20
- package/Source/Shaders/PolylineShadowVolumeMorphVS.js +20 -20
- package/Source/Shaders/PolylineShadowVolumeVS.glsl +20 -20
- package/Source/Shaders/PolylineShadowVolumeVS.js +20 -20
- package/Source/Shaders/PolylineVS.glsl +17 -17
- package/Source/Shaders/PolylineVS.js +17 -17
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +4 -4
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +4 -4
- package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +4 -4
- package/Source/Shaders/PostProcessStages/AdditiveBlend.js +4 -4
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +4 -4
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +4 -4
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +4 -4
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +4 -4
- package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +4 -4
- package/Source/Shaders/PostProcessStages/BlackAndWhite.js +4 -4
- package/Source/Shaders/PostProcessStages/BloomComposite.glsl +5 -5
- package/Source/Shaders/PostProcessStages/BloomComposite.js +5 -5
- package/Source/Shaders/PostProcessStages/BrightPass.glsl +3 -3
- package/Source/Shaders/PostProcessStages/BrightPass.js +3 -3
- package/Source/Shaders/PostProcessStages/Brightness.glsl +3 -3
- package/Source/Shaders/PostProcessStages/Brightness.js +3 -3
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +5 -5
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +5 -5
- package/Source/Shaders/PostProcessStages/ContrastBias.glsl +3 -3
- package/Source/Shaders/PostProcessStages/ContrastBias.js +3 -3
- package/Source/Shaders/PostProcessStages/DepthOfField.glsl +2 -2
- package/Source/Shaders/PostProcessStages/DepthOfField.js +2 -2
- package/Source/Shaders/PostProcessStages/DepthView.glsl +2 -2
- package/Source/Shaders/PostProcessStages/DepthView.js +2 -2
- package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +3 -3
- package/Source/Shaders/PostProcessStages/DepthViewPacked.js +3 -3
- package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +7 -7
- package/Source/Shaders/PostProcessStages/EdgeDetection.js +7 -7
- package/Source/Shaders/PostProcessStages/FXAA.glsl +3 -3
- package/Source/Shaders/PostProcessStages/FXAA.js +3 -3
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +4 -4
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +4 -4
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +5 -5
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +5 -5
- package/Source/Shaders/PostProcessStages/LensFlare.glsl +13 -13
- package/Source/Shaders/PostProcessStages/LensFlare.js +13 -13
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +4 -4
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +4 -4
- package/Source/Shaders/PostProcessStages/NightVision.glsl +3 -3
- package/Source/Shaders/PostProcessStages/NightVision.js +3 -3
- package/Source/Shaders/PostProcessStages/PassThrough.glsl +2 -2
- package/Source/Shaders/PostProcessStages/PassThrough.js +2 -2
- package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +2 -2
- package/Source/Shaders/PostProcessStages/PassThroughDepth.js +2 -2
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +7 -9
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +8 -10
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +4 -4
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +4 -4
- package/Source/Shaders/PostProcessStages/Silhouette.glsl +4 -4
- package/Source/Shaders/PostProcessStages/Silhouette.js +4 -4
- package/Source/Shaders/ReprojectWebMercatorFS.glsl +2 -2
- package/Source/Shaders/ReprojectWebMercatorFS.js +2 -2
- package/Source/Shaders/ReprojectWebMercatorVS.glsl +3 -3
- package/Source/Shaders/ReprojectWebMercatorVS.js +3 -3
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +19 -23
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +20 -24
- package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +12 -12
- package/Source/Shaders/ShadowVolumeAppearanceVS.js +12 -12
- package/Source/Shaders/ShadowVolumeFS.glsl +2 -6
- package/Source/Shaders/ShadowVolumeFS.js +3 -7
- package/Source/Shaders/SkyAtmosphereFS.glsl +6 -6
- package/Source/Shaders/SkyAtmosphereFS.js +6 -6
- package/Source/Shaders/SkyAtmosphereVS.glsl +6 -6
- package/Source/Shaders/SkyAtmosphereVS.js +6 -6
- package/Source/Shaders/SkyBoxFS.glsl +3 -3
- package/Source/Shaders/SkyBoxFS.js +3 -3
- package/Source/Shaders/SkyBoxVS.glsl +2 -2
- package/Source/Shaders/SkyBoxVS.js +2 -2
- package/Source/Shaders/SunFS.glsl +3 -3
- package/Source/Shaders/SunFS.js +3 -3
- package/Source/Shaders/SunTextureFS.glsl +2 -2
- package/Source/Shaders/SunTextureFS.js +2 -2
- package/Source/Shaders/SunVS.glsl +2 -2
- package/Source/Shaders/SunVS.js +2 -2
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +9 -13
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +9 -13
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +12 -12
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +12 -12
- package/Source/Shaders/Vector3DTilePolylinesVS.glsl +5 -5
- package/Source/Shaders/Vector3DTilePolylinesVS.js +5 -5
- package/Source/Shaders/VectorTileVS.glsl +2 -2
- package/Source/Shaders/VectorTileVS.js +2 -2
- package/Source/Shaders/ViewportQuadFS.glsl +2 -2
- package/Source/Shaders/ViewportQuadFS.js +2 -2
- package/Source/Shaders/ViewportQuadVS.glsl +3 -3
- package/Source/Shaders/ViewportQuadVS.js +3 -3
- package/Source/Shaders/Voxels/IntersectDepth.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectDepth.js +1 -1
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +12 -2
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -2
- package/Source/Shaders/Voxels/Megatexture.glsl +1 -1
- package/Source/Shaders/Voxels/Megatexture.js +1 -1
- package/Source/Shaders/Voxels/Octree.glsl +4 -4
- package/Source/Shaders/Voxels/Octree.js +4 -4
- package/Source/Shaders/Voxels/VoxelFS.glsl +2 -2
- package/Source/Shaders/Voxels/VoxelFS.js +2 -2
- package/Source/Shaders/Voxels/VoxelVS.glsl +1 -1
- package/Source/Shaders/Voxels/VoxelVS.js +1 -1
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +5 -9
- package/Source/Shaders/Voxels/convertUvToCylinder.js +5 -9
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +3 -6
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +3 -6
- package/Source/WorkersES6/decodeDraco.js +9 -1
- package/index.d.ts +26 -12
- package/index.js +53 -52
- package/package.json +1 -1
- package/Source/Renderer/modernizeShader.js +0 -242
|
@@ -40,7 +40,7 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js";
|
|
|
40
40
|
*
|
|
41
41
|
* @exception {DeveloperError} options.textureScale must be greater than 0.0 and less than or equal to 1.0.
|
|
42
42
|
* @exception {DeveloperError} options.pixelFormat must be a color format.
|
|
43
|
-
* @exception {DeveloperError} When options.pixelDatatype is FLOAT, this WebGL implementation must support
|
|
43
|
+
* @exception {DeveloperError} When options.pixelDatatype is FLOAT, this WebGL implementation must support floating point textures. Check context.floatingPointTexture.
|
|
44
44
|
*
|
|
45
45
|
* @see PostProcessStageComposite
|
|
46
46
|
*
|
|
@@ -48,12 +48,12 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js";
|
|
|
48
48
|
* // Simple stage to change the color
|
|
49
49
|
* const fs =`
|
|
50
50
|
* uniform sampler2D colorTexture;
|
|
51
|
-
*
|
|
51
|
+
* in vec2 v_textureCoordinates;
|
|
52
52
|
* uniform float scale;
|
|
53
53
|
* uniform vec3 offset;
|
|
54
54
|
* void main() {
|
|
55
|
-
* vec4 color =
|
|
56
|
-
*
|
|
55
|
+
* vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
56
|
+
* out_FragColor = vec4(color.rgb * scale + offset, 1.0);
|
|
57
57
|
* }`;
|
|
58
58
|
* scene.postProcessStages.add(new Cesium.PostProcessStage({
|
|
59
59
|
* fragmentShader : fs,
|
|
@@ -70,15 +70,15 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js";
|
|
|
70
70
|
* // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
|
|
71
71
|
* const fs =`
|
|
72
72
|
* uniform sampler2D colorTexture;
|
|
73
|
-
*
|
|
73
|
+
* in vec2 v_textureCoordinates;
|
|
74
74
|
* uniform vec4 highlight;
|
|
75
75
|
* void main() {
|
|
76
|
-
* vec4 color =
|
|
76
|
+
* vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
77
77
|
* if (czm_selected()) {
|
|
78
78
|
* vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;
|
|
79
|
-
*
|
|
79
|
+
* out_FragColor = vec4(highlighted, 1.0);
|
|
80
80
|
* } else {
|
|
81
|
-
*
|
|
81
|
+
* out_FragColor = color;
|
|
82
82
|
* }
|
|
83
83
|
* }`;
|
|
84
84
|
* const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
|
|
@@ -364,7 +364,7 @@ Object.defineProperties(PostProcessStage.prototype, {
|
|
|
364
364
|
* if (czm_selected(v_textureCoordinates)) {
|
|
365
365
|
* // apply post-process stage
|
|
366
366
|
* } else {
|
|
367
|
-
*
|
|
367
|
+
* out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
368
368
|
* }
|
|
369
369
|
* </code>
|
|
370
370
|
* </p>
|
|
@@ -556,22 +556,22 @@ function createDrawCommand(stage, context) {
|
|
|
556
556
|
if (defined(stage._selectedIdTexture)) {
|
|
557
557
|
const width = stage._selectedIdTexture.width;
|
|
558
558
|
|
|
559
|
-
fs = fs.replace(/
|
|
559
|
+
fs = fs.replace(/in\s+vec2\s+v_textureCoordinates;/g, "");
|
|
560
560
|
fs =
|
|
561
561
|
`${
|
|
562
562
|
"#define CZM_SELECTED_FEATURE \n" +
|
|
563
563
|
"uniform sampler2D czm_idTexture; \n" +
|
|
564
564
|
"uniform sampler2D czm_selectedIdTexture; \n" +
|
|
565
565
|
"uniform float czm_selectedIdTextureStep; \n" +
|
|
566
|
-
"
|
|
566
|
+
"in vec2 v_textureCoordinates; \n" +
|
|
567
567
|
"bool czm_selected(vec2 offset) \n" +
|
|
568
568
|
"{ \n" +
|
|
569
569
|
" bool selected = false;\n" +
|
|
570
|
-
" vec4 id =
|
|
570
|
+
" vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); \n" +
|
|
571
571
|
" for (int i = 0; i < "
|
|
572
572
|
}${width}; ++i) \n` +
|
|
573
573
|
` { \n` +
|
|
574
|
-
` vec4 selectedId =
|
|
574
|
+
` vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n` +
|
|
575
575
|
` if (all(equal(id, selectedId))) \n` +
|
|
576
576
|
` { \n` +
|
|
577
577
|
` return true; \n` +
|
|
@@ -283,7 +283,7 @@ function getSilhouetteEdgeDetection(edgeDetectionStages) {
|
|
|
283
283
|
for (let i = 0; i < edgeDetectionStages.length; ++i) {
|
|
284
284
|
fsDecl += `uniform sampler2D edgeTexture${i}; \n`;
|
|
285
285
|
fsLoop +=
|
|
286
|
-
` vec4 edge${i} =
|
|
286
|
+
` vec4 edge${i} = texture(edgeTexture${i}, v_textureCoordinates); \n` +
|
|
287
287
|
` if (edge${i}.a > 0.0) \n` +
|
|
288
288
|
` { \n` +
|
|
289
289
|
` color = edge${i}; \n` +
|
|
@@ -293,12 +293,12 @@ function getSilhouetteEdgeDetection(edgeDetectionStages) {
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
const fs =
|
|
296
|
-
`${fsDecl}
|
|
296
|
+
`${fsDecl}in vec2 v_textureCoordinates; \n` +
|
|
297
297
|
`void main() { \n` +
|
|
298
298
|
` vec4 color = vec4(0.0); \n` +
|
|
299
299
|
` for (int i = 0; i < ${edgeDetectionStages.length}; i++) \n` +
|
|
300
300
|
` { \n${fsLoop} } \n` +
|
|
301
|
-
`
|
|
301
|
+
` out_FragColor = color; \n` +
|
|
302
302
|
`} \n`;
|
|
303
303
|
|
|
304
304
|
const edgeComposite = new PostProcessStage({
|
|
@@ -743,7 +743,7 @@ function cloneInstance(instance, geometry) {
|
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
-
const positionRegex = /
|
|
746
|
+
const positionRegex = /in\s+vec(?:3|4)\s+(.*)3DHigh;/g;
|
|
747
747
|
|
|
748
748
|
Primitive._modifyShaderPosition = function (
|
|
749
749
|
primitive,
|
|
@@ -771,8 +771,7 @@ Primitive._modifyShaderPosition = function (
|
|
|
771
771
|
if (!defined(primitive.rtcCenter)) {
|
|
772
772
|
// Use GPU RTE
|
|
773
773
|
if (!scene3DOnly) {
|
|
774
|
-
attributes +=
|
|
775
|
-
`attribute vec3 ${name}2DHigh;\n` + `attribute vec3 ${name}2DLow;\n`;
|
|
774
|
+
attributes += `in vec3 ${name}2DHigh;\nin vec3 ${name}2DLow;\n`;
|
|
776
775
|
|
|
777
776
|
computeFunctions +=
|
|
778
777
|
`${functionName}\n` +
|
|
@@ -805,16 +804,16 @@ Primitive._modifyShaderPosition = function (
|
|
|
805
804
|
} else {
|
|
806
805
|
// Use RTC
|
|
807
806
|
vertexShaderSource = vertexShaderSource.replace(
|
|
808
|
-
/
|
|
807
|
+
/in\s+vec(?:3|4)\s+position3DHigh;/g,
|
|
809
808
|
""
|
|
810
809
|
);
|
|
811
810
|
vertexShaderSource = vertexShaderSource.replace(
|
|
812
|
-
/
|
|
811
|
+
/in\s+vec(?:3|4)\s+position3DLow;/g,
|
|
813
812
|
""
|
|
814
813
|
);
|
|
815
814
|
|
|
816
815
|
forwardDecl += "uniform mat4 u_modifiedModelView;\n";
|
|
817
|
-
attributes += "
|
|
816
|
+
attributes += "in vec4 position;\n";
|
|
818
817
|
|
|
819
818
|
computeFunctions +=
|
|
820
819
|
`${functionName}\n` +
|
|
@@ -871,7 +870,7 @@ Primitive._updateColorAttribute = function (
|
|
|
871
870
|
return vertexShaderSource;
|
|
872
871
|
}
|
|
873
872
|
|
|
874
|
-
if (vertexShaderSource.search(/
|
|
873
|
+
if (vertexShaderSource.search(/in\s+vec4\s+color;/g) === -1) {
|
|
875
874
|
return vertexShaderSource;
|
|
876
875
|
}
|
|
877
876
|
|
|
@@ -887,7 +886,7 @@ Primitive._updateColorAttribute = function (
|
|
|
887
886
|
//>>includeEnd('debug');
|
|
888
887
|
|
|
889
888
|
let modifiedVS = vertexShaderSource;
|
|
890
|
-
modifiedVS = modifiedVS.replace(/
|
|
889
|
+
modifiedVS = modifiedVS.replace(/in\s+vec4\s+color;/g, "");
|
|
891
890
|
if (!isDepthFail) {
|
|
892
891
|
modifiedVS = modifiedVS.replace(
|
|
893
892
|
/(\b)color(\b)/g,
|
|
@@ -905,7 +904,7 @@ Primitive._updateColorAttribute = function (
|
|
|
905
904
|
function appendPickToVertexShader(source) {
|
|
906
905
|
const renamedVS = ShaderSource.replaceMain(source, "czm_non_pick_main");
|
|
907
906
|
const pickMain =
|
|
908
|
-
"
|
|
907
|
+
"out vec4 v_pickColor; \n" +
|
|
909
908
|
"void main() \n" +
|
|
910
909
|
"{ \n" +
|
|
911
910
|
" czm_non_pick_main(); \n" +
|
|
@@ -916,11 +915,11 @@ function appendPickToVertexShader(source) {
|
|
|
916
915
|
}
|
|
917
916
|
|
|
918
917
|
function appendPickToFragmentShader(source) {
|
|
919
|
-
return `
|
|
918
|
+
return `in vec4 v_pickColor;\n${source}`;
|
|
920
919
|
}
|
|
921
920
|
|
|
922
921
|
Primitive._updatePickColorAttribute = function (source) {
|
|
923
|
-
let vsPick = source.replace(/
|
|
922
|
+
let vsPick = source.replace(/in\s+vec4\s+pickColor;/g, "");
|
|
924
923
|
vsPick = vsPick.replace(
|
|
925
924
|
/(\b)pickColor(\b)/g,
|
|
926
925
|
"$1czm_batchTable_pickColor(batchId)$2"
|
|
@@ -933,10 +932,10 @@ Primitive._appendOffsetToShader = function (primitive, vertexShaderSource) {
|
|
|
933
932
|
return vertexShaderSource;
|
|
934
933
|
}
|
|
935
934
|
|
|
936
|
-
let attr = "
|
|
937
|
-
attr += "
|
|
935
|
+
let attr = "in float batchId;\n";
|
|
936
|
+
attr += "in float applyOffset;";
|
|
938
937
|
let modifiedShader = vertexShaderSource.replace(
|
|
939
|
-
/
|
|
938
|
+
/in\s+float\s+batchId;/g,
|
|
940
939
|
attr
|
|
941
940
|
);
|
|
942
941
|
|
|
@@ -1033,17 +1032,16 @@ function modifyForEncodedNormals(primitive, vertexShaderSource) {
|
|
|
1033
1032
|
}
|
|
1034
1033
|
|
|
1035
1034
|
const containsNormal =
|
|
1036
|
-
vertexShaderSource.search(/
|
|
1037
|
-
const containsSt =
|
|
1038
|
-
vertexShaderSource.search(/attribute\s+vec2\s+st;/g) !== -1;
|
|
1035
|
+
vertexShaderSource.search(/in\s+vec3\s+normal;/g) !== -1;
|
|
1036
|
+
const containsSt = vertexShaderSource.search(/in\s+vec2\s+st;/g) !== -1;
|
|
1039
1037
|
if (!containsNormal && !containsSt) {
|
|
1040
1038
|
return vertexShaderSource;
|
|
1041
1039
|
}
|
|
1042
1040
|
|
|
1043
1041
|
const containsTangent =
|
|
1044
|
-
vertexShaderSource.search(/
|
|
1042
|
+
vertexShaderSource.search(/in\s+vec3\s+tangent;/g) !== -1;
|
|
1045
1043
|
const containsBitangent =
|
|
1046
|
-
vertexShaderSource.search(/
|
|
1044
|
+
vertexShaderSource.search(/in\s+vec3\s+bitangent;/g) !== -1;
|
|
1047
1045
|
|
|
1048
1046
|
let numComponents = containsSt && containsNormal ? 2.0 : 1.0;
|
|
1049
1047
|
numComponents += containsTangent || containsBitangent ? 1 : 0;
|
|
@@ -1051,7 +1049,7 @@ function modifyForEncodedNormals(primitive, vertexShaderSource) {
|
|
|
1051
1049
|
const type = numComponents > 1 ? `vec${numComponents}` : "float";
|
|
1052
1050
|
|
|
1053
1051
|
const attributeName = "compressedAttributes";
|
|
1054
|
-
const attributeDecl = `
|
|
1052
|
+
const attributeDecl = `in ${type} ${attributeName};`;
|
|
1055
1053
|
|
|
1056
1054
|
let globalDecl = "";
|
|
1057
1055
|
let decode = "";
|
|
@@ -1092,10 +1090,10 @@ function modifyForEncodedNormals(primitive, vertexShaderSource) {
|
|
|
1092
1090
|
}
|
|
1093
1091
|
|
|
1094
1092
|
let modifiedVS = vertexShaderSource;
|
|
1095
|
-
modifiedVS = modifiedVS.replace(/
|
|
1096
|
-
modifiedVS = modifiedVS.replace(/
|
|
1097
|
-
modifiedVS = modifiedVS.replace(/
|
|
1098
|
-
modifiedVS = modifiedVS.replace(/
|
|
1093
|
+
modifiedVS = modifiedVS.replace(/in\s+vec3\s+normal;/g, "");
|
|
1094
|
+
modifiedVS = modifiedVS.replace(/in\s+vec2\s+st;/g, "");
|
|
1095
|
+
modifiedVS = modifiedVS.replace(/in\s+vec3\s+tangent;/g, "");
|
|
1096
|
+
modifiedVS = modifiedVS.replace(/in\s+vec3\s+bitangent;/g, "");
|
|
1099
1097
|
modifiedVS = ShaderSource.replaceMain(modifiedVS, "czm_non_compressed_main");
|
|
1100
1098
|
const compressedMain =
|
|
1101
1099
|
`${"void main() \n" + "{ \n"}${decode} czm_non_compressed_main(); \n` +
|
|
@@ -1125,19 +1123,12 @@ function depthClampFS(fragmentShaderSource) {
|
|
|
1125
1123
|
modifiedFS +=
|
|
1126
1124
|
"void main() {\n" +
|
|
1127
1125
|
" czm_non_depth_clamp_main();\n" +
|
|
1128
|
-
"#if defined(GL_EXT_frag_depth)\n" +
|
|
1129
1126
|
" #if defined(LOG_DEPTH)\n" +
|
|
1130
1127
|
" czm_writeLogDepth();\n" +
|
|
1131
1128
|
" #else\n" +
|
|
1132
1129
|
" czm_writeDepthClamp();\n" +
|
|
1133
1130
|
" #endif\n" +
|
|
1134
|
-
"#endif\n" +
|
|
1135
1131
|
"}\n";
|
|
1136
|
-
modifiedFS = `${
|
|
1137
|
-
"#ifdef GL_EXT_frag_depth\n" +
|
|
1138
|
-
"#extension GL_EXT_frag_depth : enable\n" +
|
|
1139
|
-
"#endif\n"
|
|
1140
|
-
}${modifiedFS}`;
|
|
1141
1132
|
return modifiedFS;
|
|
1142
1133
|
}
|
|
1143
1134
|
|
|
@@ -763,7 +763,7 @@ function createDebugShadowViewCommand(shadowMap, context) {
|
|
|
763
763
|
if (shadowMap._isPointLight) {
|
|
764
764
|
fs =
|
|
765
765
|
"uniform samplerCube shadowMap_textureCube; \n" +
|
|
766
|
-
"
|
|
766
|
+
"in vec2 v_textureCoordinates; \n" +
|
|
767
767
|
"void main() \n" +
|
|
768
768
|
"{ \n" +
|
|
769
769
|
" vec2 uv = v_textureCoordinates; \n" +
|
|
@@ -812,21 +812,21 @@ function createDebugShadowViewCommand(shadowMap, context) {
|
|
|
812
812
|
" } \n" +
|
|
813
813
|
" } \n" +
|
|
814
814
|
" \n" +
|
|
815
|
-
" float shadow = czm_unpackDepth(
|
|
816
|
-
"
|
|
815
|
+
" float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); \n" +
|
|
816
|
+
" out_FragColor = vec4(vec3(shadow), 1.0); \n" +
|
|
817
817
|
"} \n";
|
|
818
818
|
} else {
|
|
819
819
|
fs =
|
|
820
820
|
`${
|
|
821
821
|
"uniform sampler2D shadowMap_texture; \n" +
|
|
822
|
-
"
|
|
822
|
+
"in vec2 v_textureCoordinates; \n" +
|
|
823
823
|
"void main() \n" +
|
|
824
824
|
"{ \n"
|
|
825
825
|
}${
|
|
826
826
|
shadowMap._usesDepthTexture
|
|
827
|
-
? " float shadow =
|
|
828
|
-
: " float shadow = czm_unpackDepth(
|
|
829
|
-
}
|
|
827
|
+
? " float shadow = texture(shadowMap_texture, v_textureCoordinates).r; \n"
|
|
828
|
+
: " float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); \n"
|
|
829
|
+
} out_FragColor = vec4(vec3(shadow), 1.0); \n` + `} \n`;
|
|
830
830
|
}
|
|
831
831
|
|
|
832
832
|
const drawCommand = context.createViewportQuadCommand(fs, {
|
|
@@ -39,7 +39,7 @@ ShadowMapShader.createShadowCastVertexShader = function (
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const shadowVS =
|
|
42
|
-
"
|
|
42
|
+
"in vec3 v_positionEC; \n" +
|
|
43
43
|
"void main() \n" +
|
|
44
44
|
"{ \n" +
|
|
45
45
|
" czm_shadow_cast_main(); \n" +
|
|
@@ -80,7 +80,7 @@ ShadowMapShader.createShadowCastFragmentShader = function (
|
|
|
80
80
|
|
|
81
81
|
if (isPointLight) {
|
|
82
82
|
if (!hasPositionVarying) {
|
|
83
|
-
fsSource += "
|
|
83
|
+
fsSource += "in vec3 v_positionEC; \n";
|
|
84
84
|
}
|
|
85
85
|
fsSource += "uniform vec4 shadowMap_lightPositionEC; \n";
|
|
86
86
|
}
|
|
@@ -92,7 +92,7 @@ ShadowMapShader.createShadowCastFragmentShader = function (
|
|
|
92
92
|
"void main() \n" +
|
|
93
93
|
"{ \n" +
|
|
94
94
|
" czm_shadow_cast_main(); \n" +
|
|
95
|
-
" if (
|
|
95
|
+
" if (out_FragColor.a == 0.0) \n" +
|
|
96
96
|
" { \n" +
|
|
97
97
|
" discard; \n" +
|
|
98
98
|
" } \n";
|
|
@@ -106,11 +106,11 @@ ShadowMapShader.createShadowCastFragmentShader = function (
|
|
|
106
106
|
` discard; \n` +
|
|
107
107
|
` } \n` +
|
|
108
108
|
` distance /= shadowMap_lightPositionEC.w; // radius \n` +
|
|
109
|
-
`
|
|
109
|
+
` out_FragColor = czm_packDepth(distance); \n`;
|
|
110
110
|
} else if (usesDepthTexture) {
|
|
111
|
-
fsSource += "
|
|
111
|
+
fsSource += " out_FragColor = vec4(1.0); \n";
|
|
112
112
|
} else {
|
|
113
|
-
fsSource += "
|
|
113
|
+
fsSource += " out_FragColor = czm_packDepth(gl_FragCoord.z); \n";
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
fsSource += "} \n";
|
|
@@ -257,7 +257,7 @@ ShadowMapShader.createShadowReceiveFragmentShader = function (
|
|
|
257
257
|
"uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \n" +
|
|
258
258
|
"uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n" +
|
|
259
259
|
"#ifdef LOG_DEPTH \n" +
|
|
260
|
-
"
|
|
260
|
+
"in vec3 v_logPositionEC; \n" +
|
|
261
261
|
"#endif \n" +
|
|
262
262
|
"vec4 getPositionEC() \n" +
|
|
263
263
|
"{ \n"
|
|
@@ -364,7 +364,7 @@ ShadowMapShader.createShadowReceiveFragmentShader = function (
|
|
|
364
364
|
}${
|
|
365
365
|
debugCascadeColors
|
|
366
366
|
? " // Draw cascade colors for debugging \n" +
|
|
367
|
-
"
|
|
367
|
+
" out_FragColor *= czm_cascadeColor(weights); \n"
|
|
368
368
|
: ""
|
|
369
369
|
}`;
|
|
370
370
|
} else {
|
|
@@ -383,7 +383,7 @@ ShadowMapShader.createShadowReceiveFragmentShader = function (
|
|
|
383
383
|
" float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n";
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
fsSource += "
|
|
386
|
+
fsSource += " out_FragColor.rgb *= visibility; \n" + "} \n";
|
|
387
387
|
|
|
388
388
|
sources.push(fsSource);
|
|
389
389
|
|
|
@@ -498,17 +498,19 @@ TextureAtlas.prototype.addSubRegion = function (id, subRegion) {
|
|
|
498
498
|
}
|
|
499
499
|
const atlasWidth = that._texture.width;
|
|
500
500
|
const atlasHeight = that._texture.height;
|
|
501
|
-
const numImages = that.numberOfImages;
|
|
502
501
|
|
|
503
502
|
const baseRegion = that._textureCoordinates[index];
|
|
504
503
|
const x = baseRegion.x + subRegion.x / atlasWidth;
|
|
505
504
|
const y = baseRegion.y + subRegion.y / atlasHeight;
|
|
506
505
|
const w = subRegion.width / atlasWidth;
|
|
507
506
|
const h = subRegion.height / atlasHeight;
|
|
508
|
-
|
|
507
|
+
const newIndex =
|
|
508
|
+
that._textureCoordinates.push(new BoundingRectangle(x, y, w, h)) - 1;
|
|
509
|
+
that._indexHash[id] = newIndex;
|
|
510
|
+
|
|
509
511
|
that._guid = createGuid();
|
|
510
512
|
|
|
511
|
-
return
|
|
513
|
+
return newIndex;
|
|
512
514
|
});
|
|
513
515
|
};
|
|
514
516
|
|
|
@@ -283,7 +283,7 @@ function createShaders(primitive, context) {
|
|
|
283
283
|
`${fragmentShaderSource}void main() \n` +
|
|
284
284
|
`{ \n` +
|
|
285
285
|
` czm_non_pick_main(); \n` +
|
|
286
|
-
`
|
|
286
|
+
` out_FragColor = ${pickId}; \n` +
|
|
287
287
|
`} \n`;
|
|
288
288
|
primitive._spPick = ShaderProgram.fromCache({
|
|
289
289
|
context: context,
|
|
@@ -343,7 +343,7 @@ function createShaders(primitive, context) {
|
|
|
343
343
|
`void main() \n` +
|
|
344
344
|
`{ \n` +
|
|
345
345
|
` czm_non_pick_main(); \n` +
|
|
346
|
-
`
|
|
346
|
+
` out_FragColor = ${pickId}; \n` +
|
|
347
347
|
`} \n`;
|
|
348
348
|
|
|
349
349
|
const pickVS = new ShaderSource({
|
|
@@ -104,6 +104,7 @@ function VoxelEllipsoidShape() {
|
|
|
104
104
|
ellipsoidInverseHeightDifferenceUv: 0.0,
|
|
105
105
|
ellipseInnerRadiiUv: new Cartesian2(),
|
|
106
106
|
ellipsoidInverseInnerScaleUv: 0.0,
|
|
107
|
+
ellipsoidInverseOuterScaleUv: 0.0,
|
|
107
108
|
};
|
|
108
109
|
|
|
109
110
|
/**
|
|
@@ -131,7 +132,9 @@ function VoxelEllipsoidShape() {
|
|
|
131
132
|
ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO: undefined,
|
|
132
133
|
ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE: undefined,
|
|
133
134
|
ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO: undefined,
|
|
135
|
+
ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX: undefined,
|
|
134
136
|
ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN: undefined,
|
|
137
|
+
ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT: undefined,
|
|
135
138
|
ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN: undefined,
|
|
136
139
|
ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT: undefined,
|
|
137
140
|
ELLIPSOID_IS_SPHERE: undefined,
|
|
@@ -305,7 +308,6 @@ VoxelEllipsoidShape.prototype.update = function (
|
|
|
305
308
|
),
|
|
306
309
|
scratchRenderOuterExtent
|
|
307
310
|
);
|
|
308
|
-
const renderMaxExtent = Cartesian3.maximumComponent(renderOuterExtent);
|
|
309
311
|
|
|
310
312
|
// Exit early if the shape is not visible.
|
|
311
313
|
// Note that minLongitude may be greater than maxLongitude when crossing the 180th meridian.
|
|
@@ -355,7 +357,7 @@ VoxelEllipsoidShape.prototype.update = function (
|
|
|
355
357
|
);
|
|
356
358
|
|
|
357
359
|
this.shapeTransform = Matrix4.fromRotationTranslation(
|
|
358
|
-
Matrix3.setScale(this._rotation,
|
|
360
|
+
Matrix3.setScale(this._rotation, shapeOuterExtent, scratchRotationScale),
|
|
359
361
|
this._translation,
|
|
360
362
|
this.shapeTransform
|
|
361
363
|
);
|
|
@@ -393,7 +395,7 @@ VoxelEllipsoidShape.prototype.update = function (
|
|
|
393
395
|
renderIsLongitudeRangeHalf ||
|
|
394
396
|
renderIsLongitudeRangeOverHalf;
|
|
395
397
|
|
|
396
|
-
const shapeIsLongitudeReversed =
|
|
398
|
+
const shapeIsLongitudeReversed = shapeMaxLongitude < shapeMinLongitude;
|
|
397
399
|
const shapeLongitudeRange =
|
|
398
400
|
shapeMaxLongitude -
|
|
399
401
|
shapeMinLongitude +
|
|
@@ -532,12 +534,18 @@ VoxelEllipsoidShape.prototype.update = function (
|
|
|
532
534
|
] = intersectionCount;
|
|
533
535
|
intersectionCount += 1;
|
|
534
536
|
|
|
535
|
-
// The inverse of the percent of space that is taken up by the inner ellipsoid
|
|
537
|
+
// The inverse of the percent of space that is taken up by the inner ellipsoid, relative to the shape bounds
|
|
536
538
|
// 1.0 / (1.0 - thickness) // thickness = percent of space that is between the min and max height.
|
|
537
|
-
// 1.0 / (1.0 - (
|
|
538
|
-
//
|
|
539
|
+
// 1.0 / (1.0 - (shapeMaxHeight - renderMinHeight) / shapeMaxExtent)
|
|
540
|
+
// shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight))
|
|
539
541
|
shaderUniforms.ellipsoidInverseInnerScaleUv =
|
|
540
|
-
|
|
542
|
+
shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (renderHasMaxHeight) {
|
|
546
|
+
shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX"] = true;
|
|
547
|
+
shaderUniforms.ellipsoidInverseOuterScaleUv =
|
|
548
|
+
shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMaxHeight));
|
|
541
549
|
}
|
|
542
550
|
}
|
|
543
551
|
|
|
@@ -1137,13 +1137,13 @@ VoxelPrimitive.prototype.update = function (frameState) {
|
|
|
1137
1137
|
uniforms.ndcSpaceAxisAlignedBoundingBox
|
|
1138
1138
|
);
|
|
1139
1139
|
const transformPositionViewToWorld = context.uniformState.inverseView;
|
|
1140
|
-
uniforms.transformPositionViewToUv = Matrix4.
|
|
1140
|
+
uniforms.transformPositionViewToUv = Matrix4.multiplyTransformation(
|
|
1141
1141
|
this._transformPositionWorldToUv,
|
|
1142
1142
|
transformPositionViewToWorld,
|
|
1143
1143
|
uniforms.transformPositionViewToUv
|
|
1144
1144
|
);
|
|
1145
1145
|
const transformPositionWorldToView = context.uniformState.view;
|
|
1146
|
-
uniforms.transformPositionUvToView = Matrix4.
|
|
1146
|
+
uniforms.transformPositionUvToView = Matrix4.multiplyTransformation(
|
|
1147
1147
|
transformPositionWorldToView,
|
|
1148
1148
|
this._transformPositionUvToWorld,
|
|
1149
1149
|
uniforms.transformPositionUvToView
|
|
@@ -1365,12 +1365,12 @@ function updateShapeAndTransforms(primitive, shape, provider) {
|
|
|
1365
1365
|
// Set member variables when the shape is dirty
|
|
1366
1366
|
const dimensions = provider.dimensions;
|
|
1367
1367
|
primitive._stepSizeUv = shape.computeApproximateStepSize(dimensions);
|
|
1368
|
-
primitive._transformPositionWorldToUv = Matrix4.
|
|
1368
|
+
primitive._transformPositionWorldToUv = Matrix4.multiplyTransformation(
|
|
1369
1369
|
transformPositionLocalToUv,
|
|
1370
1370
|
transformPositionWorldToLocal,
|
|
1371
1371
|
primitive._transformPositionWorldToUv
|
|
1372
1372
|
);
|
|
1373
|
-
primitive._transformPositionUvToWorld = Matrix4.
|
|
1373
|
+
primitive._transformPositionUvToWorld = Matrix4.multiplyTransformation(
|
|
1374
1374
|
transformPositionLocalToWorld,
|
|
1375
1375
|
transformPositionUvToLocal,
|
|
1376
1376
|
primitive._transformPositionUvToWorld
|
|
@@ -49,16 +49,25 @@ function computeFlyToLocationForRectangle(rectangle, scene) {
|
|
|
49
49
|
return computeFlyToLocationForRectangle
|
|
50
50
|
._sampleTerrainMostDetailed(terrainProvider, cartographics)
|
|
51
51
|
.then(function (positionsOnTerrain) {
|
|
52
|
+
let heightFound = false;
|
|
52
53
|
const maxHeight = positionsOnTerrain.reduce(function (
|
|
53
54
|
currentMax,
|
|
54
55
|
item
|
|
55
56
|
) {
|
|
57
|
+
if (!defined(item.height)) {
|
|
58
|
+
return currentMax;
|
|
59
|
+
}
|
|
60
|
+
heightFound = true;
|
|
56
61
|
return Math.max(item.height, currentMax);
|
|
57
62
|
},
|
|
58
63
|
-Number.MAX_VALUE);
|
|
59
64
|
|
|
60
65
|
const finalPosition = positionWithoutTerrain;
|
|
61
|
-
|
|
66
|
+
|
|
67
|
+
if (heightFound) {
|
|
68
|
+
finalPosition.height += maxHeight;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
return finalPosition;
|
|
63
72
|
});
|
|
64
73
|
});
|
|
@@ -462,9 +462,7 @@ function createLayeredEntries(layers) {
|
|
|
462
462
|
* });
|
|
463
463
|
*/
|
|
464
464
|
function createElevationBandMaterial(options) {
|
|
465
|
-
|
|
466
|
-
const scene = options.scene;
|
|
467
|
-
const layers = options.layers;
|
|
465
|
+
const { scene, layers } = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
468
466
|
|
|
469
467
|
//>>includeStart('debug', pragmas.debug);
|
|
470
468
|
Check.typeOf.object("options.scene", scene);
|
|
@@ -472,36 +470,34 @@ function createElevationBandMaterial(options) {
|
|
|
472
470
|
Check.typeOf.number.greaterThan("options.layers.length", layers.length, 0);
|
|
473
471
|
//>>includeEnd('debug');
|
|
474
472
|
|
|
473
|
+
const { context } = scene;
|
|
475
474
|
const entries = createLayeredEntries(layers);
|
|
476
475
|
const entriesLength = entries.length;
|
|
477
|
-
let i;
|
|
478
476
|
|
|
479
477
|
let heightTexBuffer;
|
|
480
478
|
let heightTexDatatype;
|
|
481
479
|
let heightTexFormat;
|
|
482
480
|
|
|
483
|
-
const isPackedHeight = !createElevationBandMaterial._useFloatTexture(
|
|
484
|
-
scene.context
|
|
485
|
-
);
|
|
481
|
+
const isPackedHeight = !createElevationBandMaterial._useFloatTexture(context);
|
|
486
482
|
if (isPackedHeight) {
|
|
487
483
|
heightTexDatatype = PixelDatatype.UNSIGNED_BYTE;
|
|
488
484
|
heightTexFormat = PixelFormat.RGBA;
|
|
489
485
|
heightTexBuffer = new Uint8Array(entriesLength * 4);
|
|
490
|
-
for (i = 0; i < entriesLength; i++) {
|
|
486
|
+
for (let i = 0; i < entriesLength; i++) {
|
|
491
487
|
Cartesian4.packFloat(entries[i].height, scratchPackedFloat);
|
|
492
488
|
Cartesian4.pack(scratchPackedFloat, heightTexBuffer, i * 4);
|
|
493
489
|
}
|
|
494
490
|
} else {
|
|
495
491
|
heightTexDatatype = PixelDatatype.FLOAT;
|
|
496
|
-
heightTexFormat = PixelFormat.LUMINANCE;
|
|
492
|
+
heightTexFormat = context.webgl2 ? PixelFormat.RED : PixelFormat.LUMINANCE;
|
|
497
493
|
heightTexBuffer = new Float32Array(entriesLength);
|
|
498
|
-
for (i = 0; i < entriesLength; i++) {
|
|
494
|
+
for (let i = 0; i < entriesLength; i++) {
|
|
499
495
|
heightTexBuffer[i] = entries[i].height;
|
|
500
496
|
}
|
|
501
497
|
}
|
|
502
498
|
|
|
503
499
|
const heightsTex = Texture.create({
|
|
504
|
-
context:
|
|
500
|
+
context: context,
|
|
505
501
|
pixelFormat: heightTexFormat,
|
|
506
502
|
pixelDatatype: heightTexDatatype,
|
|
507
503
|
source: {
|
|
@@ -518,7 +514,7 @@ function createElevationBandMaterial(options) {
|
|
|
518
514
|
});
|
|
519
515
|
|
|
520
516
|
const colorsArray = new Uint8Array(entriesLength * 4);
|
|
521
|
-
for (i = 0; i < entriesLength; i++) {
|
|
517
|
+
for (let i = 0; i < entriesLength; i++) {
|
|
522
518
|
const color = entries[i].color;
|
|
523
519
|
color.toBytes(scratchColorBytes);
|
|
524
520
|
colorsArray[i * 4 + 0] = scratchColorBytes[0];
|
|
@@ -528,7 +524,7 @@ function createElevationBandMaterial(options) {
|
|
|
528
524
|
}
|
|
529
525
|
|
|
530
526
|
const colorsTex = Texture.create({
|
|
531
|
-
context:
|
|
527
|
+
context: context,
|
|
532
528
|
pixelFormat: PixelFormat.RGBA,
|
|
533
529
|
pixelDatatype: PixelDatatype.UNSIGNED_BYTE,
|
|
534
530
|
source: {
|
|
@@ -544,11 +540,10 @@ function createElevationBandMaterial(options) {
|
|
|
544
540
|
}),
|
|
545
541
|
});
|
|
546
542
|
|
|
547
|
-
|
|
543
|
+
return Material.fromType("ElevationBand", {
|
|
548
544
|
heights: heightsTex,
|
|
549
545
|
colors: colorsTex,
|
|
550
546
|
});
|
|
551
|
-
return material;
|
|
552
547
|
}
|
|
553
548
|
|
|
554
549
|
/**
|
|
@@ -27,7 +27,7 @@ function getClipAndStyleCode(
|
|
|
27
27
|
` float clippingPlanesEdgeWidth = ${styleUniformName}.a; \n` +
|
|
28
28
|
` if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n` +
|
|
29
29
|
` { \n` +
|
|
30
|
-
`
|
|
30
|
+
` out_FragColor = clippingPlanesEdgeColor;\n` +
|
|
31
31
|
` } \n`;
|
|
32
32
|
return shaderCode;
|
|
33
33
|
}
|