@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
package/Source/Scene/OIT.js
CHANGED
|
@@ -18,6 +18,8 @@ import BlendFunction from "./BlendFunction.js";
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @private
|
|
21
|
+
* @constructor
|
|
22
|
+
* @param {Context} context
|
|
21
23
|
*/
|
|
22
24
|
function OIT(context) {
|
|
23
25
|
this._numSamples = 1;
|
|
@@ -90,6 +92,10 @@ function OIT(context) {
|
|
|
90
92
|
this._useHDR = false;
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
/**
|
|
96
|
+
* @private
|
|
97
|
+
* @param {OIT} oit
|
|
98
|
+
*/
|
|
93
99
|
function destroyTextures(oit) {
|
|
94
100
|
oit._accumulationTexture =
|
|
95
101
|
oit._accumulationTexture &&
|
|
@@ -101,6 +107,10 @@ function destroyTextures(oit) {
|
|
|
101
107
|
oit._revealageTexture.destroy();
|
|
102
108
|
}
|
|
103
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @private
|
|
112
|
+
* @param {OIT} oit
|
|
113
|
+
*/
|
|
104
114
|
function destroyFramebuffers(oit) {
|
|
105
115
|
oit._translucentFBO.destroy();
|
|
106
116
|
oit._alphaFBO.destroy();
|
|
@@ -108,11 +118,22 @@ function destroyFramebuffers(oit) {
|
|
|
108
118
|
oit._adjustAlphaFBO.destroy();
|
|
109
119
|
}
|
|
110
120
|
|
|
121
|
+
/**
|
|
122
|
+
* @private
|
|
123
|
+
* @param {OIT} oit
|
|
124
|
+
*/
|
|
111
125
|
function destroyResources(oit) {
|
|
112
126
|
destroyTextures(oit);
|
|
113
127
|
destroyFramebuffers(oit);
|
|
114
128
|
}
|
|
115
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @private
|
|
132
|
+
* @param {OIT} oit
|
|
133
|
+
* @param {Context} context
|
|
134
|
+
* @param {Number} width
|
|
135
|
+
* @param {Number} height
|
|
136
|
+
*/
|
|
116
137
|
function updateTextures(oit, context, width, height) {
|
|
117
138
|
destroyTextures(oit);
|
|
118
139
|
|
|
@@ -140,14 +161,19 @@ function updateTextures(oit, context, width, height) {
|
|
|
140
161
|
});
|
|
141
162
|
}
|
|
142
163
|
|
|
164
|
+
/**
|
|
165
|
+
* @private
|
|
166
|
+
* @param {OIT} oit
|
|
167
|
+
* @param {Context} context
|
|
168
|
+
* @returns {Boolean}
|
|
169
|
+
*/
|
|
143
170
|
function updateFramebuffers(oit, context) {
|
|
144
171
|
destroyFramebuffers(oit);
|
|
145
172
|
|
|
146
173
|
const completeFBO = WebGLConstants.FRAMEBUFFER_COMPLETE;
|
|
147
174
|
let supported = true;
|
|
148
175
|
|
|
149
|
-
const width = oit._accumulationTexture
|
|
150
|
-
const height = oit._accumulationTexture.height;
|
|
176
|
+
const { width, height } = oit._accumulationTexture;
|
|
151
177
|
|
|
152
178
|
// if MRT is supported, attempt to make an FBO with multiple color attachments
|
|
153
179
|
if (oit._translucentMRTSupport) {
|
|
@@ -205,6 +231,14 @@ function updateFramebuffers(oit, context) {
|
|
|
205
231
|
return supported;
|
|
206
232
|
}
|
|
207
233
|
|
|
234
|
+
/**
|
|
235
|
+
* @private
|
|
236
|
+
* @param {Context} context
|
|
237
|
+
* @param {PassState} passState
|
|
238
|
+
* @param {Framebuffer} framebuffer
|
|
239
|
+
* @param {Boolean} useHDR
|
|
240
|
+
* @param {Number} numSamples
|
|
241
|
+
*/
|
|
208
242
|
OIT.prototype.update = function (
|
|
209
243
|
context,
|
|
210
244
|
passState,
|
|
@@ -220,8 +254,7 @@ OIT.prototype.update = function (
|
|
|
220
254
|
this._opaqueTexture = framebuffer.getColorTexture(0);
|
|
221
255
|
this._depthStencilTexture = framebuffer.getDepthStencilTexture();
|
|
222
256
|
|
|
223
|
-
const width = this._opaqueTexture
|
|
224
|
-
const height = this._opaqueTexture.height;
|
|
257
|
+
const { width, height } = this._opaqueTexture;
|
|
225
258
|
|
|
226
259
|
const accumulationTexture = this._accumulationTexture;
|
|
227
260
|
const textureChanged =
|
|
@@ -458,76 +491,83 @@ function getTranslucentAlphaRenderState(oit, context, renderState) {
|
|
|
458
491
|
}
|
|
459
492
|
|
|
460
493
|
const mrtShaderSource =
|
|
461
|
-
" vec3 Ci =
|
|
462
|
-
" float ai =
|
|
494
|
+
" vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\n" +
|
|
495
|
+
" float ai = czm_out_FragColor.a;\n" +
|
|
463
496
|
" float wzi = czm_alphaWeight(ai);\n" +
|
|
464
|
-
"
|
|
465
|
-
"
|
|
497
|
+
" out_FragData_0 = vec4(Ci * wzi, ai);\n" +
|
|
498
|
+
" out_FragData_1 = vec4(ai * wzi);\n";
|
|
466
499
|
|
|
467
500
|
const colorShaderSource =
|
|
468
|
-
" vec3 Ci =
|
|
469
|
-
" float ai =
|
|
501
|
+
" vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\n" +
|
|
502
|
+
" float ai = czm_out_FragColor.a;\n" +
|
|
470
503
|
" float wzi = czm_alphaWeight(ai);\n" +
|
|
471
|
-
"
|
|
504
|
+
" out_FragColor = vec4(Ci, ai) * wzi;\n";
|
|
472
505
|
|
|
473
506
|
const alphaShaderSource =
|
|
474
|
-
" float ai =
|
|
507
|
+
" float ai = czm_out_FragColor.a;\n" + " out_FragColor = vec4(ai);\n";
|
|
475
508
|
|
|
509
|
+
/**
|
|
510
|
+
* @private
|
|
511
|
+
* @param {Context} context
|
|
512
|
+
* @param {ShaderProgram} shaderProgram
|
|
513
|
+
* @param {String} keyword
|
|
514
|
+
* @param {String} source
|
|
515
|
+
* @returns {ShaderProgram}
|
|
516
|
+
*/
|
|
476
517
|
function getTranslucentShaderProgram(context, shaderProgram, keyword, source) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
const attributeLocations = shaderProgram._attributeLocations;
|
|
483
|
-
|
|
484
|
-
const fs = shaderProgram.fragmentShaderSource.clone();
|
|
485
|
-
|
|
486
|
-
fs.sources = fs.sources.map(function (source) {
|
|
487
|
-
source = ShaderSource.replaceMain(source, "czm_translucent_main");
|
|
488
|
-
source = source.replace(/gl_FragColor/g, "czm_gl_FragColor");
|
|
489
|
-
source = source.replace(/\bdiscard\b/g, "czm_discard = true");
|
|
490
|
-
source = source.replace(/czm_phong/g, "czm_translucentPhong");
|
|
491
|
-
return source;
|
|
492
|
-
});
|
|
518
|
+
const { shaderCache } = context;
|
|
519
|
+
const shader = shaderCache.getDerivedShaderProgram(shaderProgram, keyword);
|
|
520
|
+
if (defined(shader)) {
|
|
521
|
+
return shader;
|
|
522
|
+
}
|
|
493
523
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
524
|
+
const attributeLocations = shaderProgram._attributeLocations;
|
|
525
|
+
const fs = shaderProgram.fragmentShaderSource.clone();
|
|
526
|
+
|
|
527
|
+
fs.sources = fs.sources.map(function (fsSource) {
|
|
528
|
+
return ShaderSource.replaceMain(fsSource, "czm_translucent_main")
|
|
529
|
+
.replace(/out_FragColor/g, "czm_out_FragColor")
|
|
530
|
+
.replace(
|
|
531
|
+
/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,
|
|
532
|
+
""
|
|
533
|
+
)
|
|
534
|
+
.replace(/\bdiscard\b/g, "czm_discard = true")
|
|
535
|
+
.replace(/czm_phong/g, "czm_translucentPhong");
|
|
536
|
+
});
|
|
506
537
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
" discard;\n" +
|
|
515
|
-
" }\n"
|
|
516
|
-
}${source}}\n`
|
|
517
|
-
);
|
|
538
|
+
// Discarding the fragment in main is a workaround for ANGLE D3D9
|
|
539
|
+
// shader compilation errors.
|
|
540
|
+
fs.sources.splice(
|
|
541
|
+
0,
|
|
542
|
+
0,
|
|
543
|
+
`vec4 czm_out_FragColor;\n` + `bool czm_discard = false;\n`
|
|
544
|
+
);
|
|
518
545
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
fragmentShaderSource: fs,
|
|
525
|
-
attributeLocations: attributeLocations,
|
|
526
|
-
}
|
|
527
|
-
);
|
|
546
|
+
const fragDataMatches = [...source.matchAll(/out_FragData_(\d+)/g)];
|
|
547
|
+
let fragDataDeclarations = ``;
|
|
548
|
+
for (let i = 0; i < fragDataMatches.length; i++) {
|
|
549
|
+
const fragDataMatch = fragDataMatches[i];
|
|
550
|
+
fragDataDeclarations = `layout (location = ${fragDataMatch[1]}) out vec4 ${fragDataMatch[0]};\n${fragDataDeclarations}`;
|
|
528
551
|
}
|
|
552
|
+
fs.sources.push(fragDataDeclarations);
|
|
553
|
+
|
|
554
|
+
fs.sources.push(
|
|
555
|
+
`${
|
|
556
|
+
"void main()\n" +
|
|
557
|
+
"{\n" +
|
|
558
|
+
" czm_translucent_main();\n" +
|
|
559
|
+
" if (czm_discard)\n" +
|
|
560
|
+
" {\n" +
|
|
561
|
+
" discard;\n" +
|
|
562
|
+
" }\n"
|
|
563
|
+
}${source}}\n`
|
|
564
|
+
);
|
|
529
565
|
|
|
530
|
-
return
|
|
566
|
+
return shaderCache.createDerivedShaderProgram(shaderProgram, keyword, {
|
|
567
|
+
vertexShaderSource: shaderProgram.vertexShaderSource,
|
|
568
|
+
fragmentShaderSource: fs,
|
|
569
|
+
attributeLocations: attributeLocations,
|
|
570
|
+
});
|
|
531
571
|
}
|
|
532
572
|
|
|
533
573
|
function getTranslucentMRTShaderProgram(context, shaderProgram) {
|
|
@@ -557,6 +597,13 @@ function getTranslucentAlphaShaderProgram(context, shaderProgram) {
|
|
|
557
597
|
);
|
|
558
598
|
}
|
|
559
599
|
|
|
600
|
+
/**
|
|
601
|
+
* @private
|
|
602
|
+
* @param {DrawCommand} command
|
|
603
|
+
* @param {Context} context
|
|
604
|
+
* @param {*} result
|
|
605
|
+
* @returns {*}
|
|
606
|
+
*/
|
|
560
607
|
OIT.prototype.createDerivedCommands = function (command, context, result) {
|
|
561
608
|
if (!defined(result)) {
|
|
562
609
|
result = {};
|
|
@@ -593,61 +640,68 @@ OIT.prototype.createDerivedCommands = function (command, context, result) {
|
|
|
593
640
|
result.translucentCommand.shaderProgram = translucentShader;
|
|
594
641
|
result.translucentCommand.renderState = translucentRenderState;
|
|
595
642
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
let colorRenderState;
|
|
599
|
-
let alphaShader;
|
|
600
|
-
let alphaRenderState;
|
|
601
|
-
if (defined(result.translucentCommand)) {
|
|
602
|
-
colorShader = result.translucentCommand.shaderProgram;
|
|
603
|
-
colorRenderState = result.translucentCommand.renderState;
|
|
604
|
-
alphaShader = result.alphaCommand.shaderProgram;
|
|
605
|
-
alphaRenderState = result.alphaCommand.renderState;
|
|
606
|
-
}
|
|
643
|
+
return result;
|
|
644
|
+
}
|
|
607
645
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
646
|
+
let colorShader;
|
|
647
|
+
let colorRenderState;
|
|
648
|
+
let alphaShader;
|
|
649
|
+
let alphaRenderState;
|
|
650
|
+
if (defined(result.translucentCommand)) {
|
|
651
|
+
colorShader = result.translucentCommand.shaderProgram;
|
|
652
|
+
colorRenderState = result.translucentCommand.renderState;
|
|
653
|
+
alphaShader = result.alphaCommand.shaderProgram;
|
|
654
|
+
alphaRenderState = result.alphaCommand.renderState;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
result.translucentCommand = DrawCommand.shallowClone(
|
|
658
|
+
command,
|
|
659
|
+
result.translucentCommand
|
|
660
|
+
);
|
|
661
|
+
result.alphaCommand = DrawCommand.shallowClone(command, result.alphaCommand);
|
|
662
|
+
|
|
663
|
+
if (
|
|
664
|
+
!defined(colorShader) ||
|
|
665
|
+
result.shaderProgramId !== command.shaderProgram.id
|
|
666
|
+
) {
|
|
667
|
+
result.translucentCommand.shaderProgram = getTranslucentColorShaderProgram(
|
|
668
|
+
context,
|
|
669
|
+
command.shaderProgram
|
|
611
670
|
);
|
|
612
|
-
result.
|
|
613
|
-
|
|
614
|
-
|
|
671
|
+
result.translucentCommand.renderState = getTranslucentColorRenderState(
|
|
672
|
+
this,
|
|
673
|
+
context,
|
|
674
|
+
command.renderState
|
|
615
675
|
);
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
context,
|
|
632
|
-
command.shaderProgram
|
|
633
|
-
);
|
|
634
|
-
result.alphaCommand.renderState = getTranslucentAlphaRenderState(
|
|
635
|
-
this,
|
|
636
|
-
context,
|
|
637
|
-
command.renderState
|
|
638
|
-
);
|
|
639
|
-
result.shaderProgramId = command.shaderProgram.id;
|
|
640
|
-
} else {
|
|
641
|
-
result.translucentCommand.shaderProgram = colorShader;
|
|
642
|
-
result.translucentCommand.renderState = colorRenderState;
|
|
643
|
-
result.alphaCommand.shaderProgram = alphaShader;
|
|
644
|
-
result.alphaCommand.renderState = alphaRenderState;
|
|
645
|
-
}
|
|
676
|
+
result.alphaCommand.shaderProgram = getTranslucentAlphaShaderProgram(
|
|
677
|
+
context,
|
|
678
|
+
command.shaderProgram
|
|
679
|
+
);
|
|
680
|
+
result.alphaCommand.renderState = getTranslucentAlphaRenderState(
|
|
681
|
+
this,
|
|
682
|
+
context,
|
|
683
|
+
command.renderState
|
|
684
|
+
);
|
|
685
|
+
result.shaderProgramId = command.shaderProgram.id;
|
|
686
|
+
} else {
|
|
687
|
+
result.translucentCommand.shaderProgram = colorShader;
|
|
688
|
+
result.translucentCommand.renderState = colorRenderState;
|
|
689
|
+
result.alphaCommand.shaderProgram = alphaShader;
|
|
690
|
+
result.alphaCommand.renderState = alphaRenderState;
|
|
646
691
|
}
|
|
647
692
|
|
|
648
693
|
return result;
|
|
649
694
|
};
|
|
650
695
|
|
|
696
|
+
/**
|
|
697
|
+
* @private
|
|
698
|
+
* @param {OIT} oit
|
|
699
|
+
* @param {Scene} scene
|
|
700
|
+
* @param {Function} executeFunction
|
|
701
|
+
* @param {PassState} passState
|
|
702
|
+
* @param {DrawCommand[]} commands
|
|
703
|
+
* @param {InvertClassification} invertClassification
|
|
704
|
+
*/
|
|
651
705
|
function executeTranslucentCommandsSortedMultipass(
|
|
652
706
|
oit,
|
|
653
707
|
scene,
|
|
@@ -660,13 +714,12 @@ function executeTranslucentCommandsSortedMultipass(
|
|
|
660
714
|
let derivedCommand;
|
|
661
715
|
let j;
|
|
662
716
|
|
|
663
|
-
const context = scene
|
|
664
|
-
const useLogDepth =
|
|
717
|
+
const { context, frameState } = scene;
|
|
718
|
+
const { useLogDepth, shadowState } = frameState;
|
|
665
719
|
const useHdr = scene._hdr;
|
|
666
720
|
const framebuffer = passState.framebuffer;
|
|
667
|
-
const length = commands.length;
|
|
668
721
|
|
|
669
|
-
const lightShadowsEnabled =
|
|
722
|
+
const lightShadowsEnabled = shadowState.lightShadowsEnabled;
|
|
670
723
|
|
|
671
724
|
passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;
|
|
672
725
|
oit._adjustTranslucentCommand.execute(context, passState);
|
|
@@ -676,7 +729,7 @@ function executeTranslucentCommandsSortedMultipass(
|
|
|
676
729
|
const debugFramebuffer = oit._opaqueFBO.framebuffer;
|
|
677
730
|
passState.framebuffer = oit._translucentFBO.framebuffer;
|
|
678
731
|
|
|
679
|
-
for (j = 0; j < length; ++j) {
|
|
732
|
+
for (j = 0; j < commands.length; ++j) {
|
|
680
733
|
command = commands[j];
|
|
681
734
|
command = useLogDepth ? command.derivedCommands.logDepth.command : command;
|
|
682
735
|
command = useHdr ? command.derivedCommands.hdr.command : command;
|
|
@@ -710,7 +763,7 @@ function executeTranslucentCommandsSortedMultipass(
|
|
|
710
763
|
|
|
711
764
|
passState.framebuffer = oit._alphaFBO.framebuffer;
|
|
712
765
|
|
|
713
|
-
for (j = 0; j < length; ++j) {
|
|
766
|
+
for (j = 0; j < commands.length; ++j) {
|
|
714
767
|
command = commands[j];
|
|
715
768
|
command = useLogDepth ? command.derivedCommands.logDepth.command : command;
|
|
716
769
|
command = useHdr ? command.derivedCommands.hdr.command : command;
|
|
@@ -745,6 +798,15 @@ function executeTranslucentCommandsSortedMultipass(
|
|
|
745
798
|
passState.framebuffer = framebuffer;
|
|
746
799
|
}
|
|
747
800
|
|
|
801
|
+
/**
|
|
802
|
+
* @private
|
|
803
|
+
* @param {OIT} oit
|
|
804
|
+
* @param {Scene} scene
|
|
805
|
+
* @param {Function} executeFunction
|
|
806
|
+
* @param {PassState} passState
|
|
807
|
+
* @param {DrawCommand[]} commands
|
|
808
|
+
* @param {InvertClassification} invertClassification
|
|
809
|
+
*/
|
|
748
810
|
function executeTranslucentCommandsSortedMRT(
|
|
749
811
|
oit,
|
|
750
812
|
scene,
|
|
@@ -753,13 +815,12 @@ function executeTranslucentCommandsSortedMRT(
|
|
|
753
815
|
commands,
|
|
754
816
|
invertClassification
|
|
755
817
|
) {
|
|
756
|
-
const context = scene
|
|
757
|
-
const useLogDepth =
|
|
818
|
+
const { context, frameState } = scene;
|
|
819
|
+
const { useLogDepth, shadowState } = frameState;
|
|
758
820
|
const useHdr = scene._hdr;
|
|
759
821
|
const framebuffer = passState.framebuffer;
|
|
760
|
-
const length = commands.length;
|
|
761
822
|
|
|
762
|
-
const lightShadowsEnabled =
|
|
823
|
+
const lightShadowsEnabled = shadowState.lightShadowsEnabled;
|
|
763
824
|
|
|
764
825
|
passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;
|
|
765
826
|
oit._adjustTranslucentCommand.execute(context, passState);
|
|
@@ -770,7 +831,7 @@ function executeTranslucentCommandsSortedMRT(
|
|
|
770
831
|
let command;
|
|
771
832
|
let derivedCommand;
|
|
772
833
|
|
|
773
|
-
for (let j = 0; j < length; ++j) {
|
|
834
|
+
for (let j = 0; j < commands.length; ++j) {
|
|
774
835
|
command = commands[j];
|
|
775
836
|
command = useLogDepth ? command.derivedCommands.logDepth.command : command;
|
|
776
837
|
command = useHdr ? command.derivedCommands.hdr.command : command;
|
|
@@ -805,6 +866,14 @@ function executeTranslucentCommandsSortedMRT(
|
|
|
805
866
|
passState.framebuffer = framebuffer;
|
|
806
867
|
}
|
|
807
868
|
|
|
869
|
+
/**
|
|
870
|
+
* @private
|
|
871
|
+
* @param {Scene} scene
|
|
872
|
+
* @param {Function} executeFunction
|
|
873
|
+
* @param {PassState} passState
|
|
874
|
+
* @param {DrawCommand[]} commands
|
|
875
|
+
* @param {InvertClassification} invertClassification
|
|
876
|
+
*/
|
|
808
877
|
OIT.prototype.executeCommands = function (
|
|
809
878
|
scene,
|
|
810
879
|
executeFunction,
|
|
@@ -834,10 +903,21 @@ OIT.prototype.executeCommands = function (
|
|
|
834
903
|
);
|
|
835
904
|
};
|
|
836
905
|
|
|
906
|
+
/**
|
|
907
|
+
* @private
|
|
908
|
+
* @param {Context} context
|
|
909
|
+
* @param {PassState} passState
|
|
910
|
+
*/
|
|
837
911
|
OIT.prototype.execute = function (context, passState) {
|
|
838
912
|
this._compositeCommand.execute(context, passState);
|
|
839
913
|
};
|
|
840
914
|
|
|
915
|
+
/**
|
|
916
|
+
* @private
|
|
917
|
+
* @param {Context} context
|
|
918
|
+
* @param {PassState} passState
|
|
919
|
+
* @param {Color} clearColor
|
|
920
|
+
*/
|
|
841
921
|
OIT.prototype.clear = function (context, passState, clearColor) {
|
|
842
922
|
const framebuffer = passState.framebuffer;
|
|
843
923
|
|
|
@@ -859,14 +939,25 @@ OIT.prototype.clear = function (context, passState, clearColor) {
|
|
|
859
939
|
passState.framebuffer = framebuffer;
|
|
860
940
|
};
|
|
861
941
|
|
|
942
|
+
/**
|
|
943
|
+
* @private
|
|
944
|
+
* @returns {Boolean}
|
|
945
|
+
*/
|
|
862
946
|
OIT.prototype.isSupported = function () {
|
|
863
947
|
return this._translucentMRTSupport || this._translucentMultipassSupport;
|
|
864
948
|
};
|
|
865
949
|
|
|
950
|
+
/**
|
|
951
|
+
* @private
|
|
952
|
+
* @returns {Boolean}
|
|
953
|
+
*/
|
|
866
954
|
OIT.prototype.isDestroyed = function () {
|
|
867
955
|
return false;
|
|
868
956
|
};
|
|
869
957
|
|
|
958
|
+
/**
|
|
959
|
+
* @private
|
|
960
|
+
*/
|
|
870
961
|
OIT.prototype.destroy = function () {
|
|
871
962
|
destroyResources(this);
|
|
872
963
|
|
|
@@ -890,4 +981,5 @@ OIT.prototype.destroy = function () {
|
|
|
890
981
|
|
|
891
982
|
return destroyObject(this);
|
|
892
983
|
};
|
|
984
|
+
|
|
893
985
|
export default OIT;
|
|
@@ -32,10 +32,10 @@ function updateCopyCommands(pickDepth, context, depthTexture) {
|
|
|
32
32
|
if (!defined(pickDepth._copyDepthCommand)) {
|
|
33
33
|
const fs =
|
|
34
34
|
"uniform highp sampler2D u_texture;\n" +
|
|
35
|
-
"
|
|
35
|
+
"in vec2 v_textureCoordinates;\n" +
|
|
36
36
|
"void main()\n" +
|
|
37
37
|
"{\n" +
|
|
38
|
-
"
|
|
38
|
+
" out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r);\n" +
|
|
39
39
|
"}\n";
|
|
40
40
|
pickDepth._copyDepthCommand = context.createViewportQuadCommand(fs, {
|
|
41
41
|
renderState: RenderState.fromCache(),
|
|
@@ -947,15 +947,15 @@ function createShaders(pointCloud, frameState, style) {
|
|
|
947
947
|
attributeType = `vec${componentCount}`;
|
|
948
948
|
}
|
|
949
949
|
|
|
950
|
-
attributeDeclarations += `
|
|
950
|
+
attributeDeclarations += `in ${attributeType} ${attributeName}; \n`;
|
|
951
951
|
attributeLocations[attributeName] = attribute.location;
|
|
952
952
|
}
|
|
953
953
|
|
|
954
954
|
createUniformMap(pointCloud, frameState);
|
|
955
955
|
|
|
956
956
|
let vs =
|
|
957
|
-
"
|
|
958
|
-
"
|
|
957
|
+
"in vec3 a_position; \n" +
|
|
958
|
+
"out vec4 v_color; \n" +
|
|
959
959
|
"uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \n" +
|
|
960
960
|
"uniform vec4 u_constantColor; \n" +
|
|
961
961
|
"uniform vec4 u_highlightColor; \n";
|
|
@@ -972,10 +972,10 @@ function createShaders(pointCloud, frameState, style) {
|
|
|
972
972
|
|
|
973
973
|
if (usesColors) {
|
|
974
974
|
if (isTranslucent) {
|
|
975
|
-
vs += "
|
|
975
|
+
vs += "in vec4 a_color; \n";
|
|
976
976
|
} else if (isRGB565) {
|
|
977
977
|
vs +=
|
|
978
|
-
"
|
|
978
|
+
"in float a_color; \n" +
|
|
979
979
|
"const float SHIFT_RIGHT_11 = 1.0 / 2048.0; \n" +
|
|
980
980
|
"const float SHIFT_RIGHT_5 = 1.0 / 32.0; \n" +
|
|
981
981
|
"const float SHIFT_LEFT_11 = 2048.0; \n" +
|
|
@@ -983,19 +983,19 @@ function createShaders(pointCloud, frameState, style) {
|
|
|
983
983
|
"const float NORMALIZE_6 = 1.0 / 64.0; \n" +
|
|
984
984
|
"const float NORMALIZE_5 = 1.0 / 32.0; \n";
|
|
985
985
|
} else {
|
|
986
|
-
vs += "
|
|
986
|
+
vs += "in vec3 a_color; \n";
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
if (usesNormals) {
|
|
990
990
|
if (isOctEncoded16P || isOctEncodedDraco) {
|
|
991
|
-
vs += "
|
|
991
|
+
vs += "in vec2 a_normal; \n";
|
|
992
992
|
} else {
|
|
993
|
-
vs += "
|
|
993
|
+
vs += "in vec3 a_normal; \n";
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
|
|
997
997
|
if (hasBatchIds) {
|
|
998
|
-
vs += "
|
|
998
|
+
vs += "in float a_batchId; \n";
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
1001
|
if (isQuantized || isQuantizedDraco || isOctEncodedDraco) {
|
|
@@ -1121,7 +1121,7 @@ function createShaders(pointCloud, frameState, style) {
|
|
|
1121
1121
|
|
|
1122
1122
|
vs += "} \n";
|
|
1123
1123
|
|
|
1124
|
-
let fs = "
|
|
1124
|
+
let fs = "in vec4 v_color; \n";
|
|
1125
1125
|
|
|
1126
1126
|
if (hasClippedContent) {
|
|
1127
1127
|
fs +=
|
|
@@ -1136,7 +1136,7 @@ function createShaders(pointCloud, frameState, style) {
|
|
|
1136
1136
|
fs +=
|
|
1137
1137
|
"void main() \n" +
|
|
1138
1138
|
"{ \n" +
|
|
1139
|
-
"
|
|
1139
|
+
" out_FragColor = czm_gammaCorrect(v_color); \n";
|
|
1140
1140
|
|
|
1141
1141
|
if (hasClippedContent) {
|
|
1142
1142
|
fs += getClipAndStyleCode(
|
|
@@ -126,25 +126,30 @@ function getECShaderProgram(context, shaderProgram) {
|
|
|
126
126
|
|
|
127
127
|
const fs = shaderProgram.fragmentShaderSource.clone();
|
|
128
128
|
|
|
129
|
+
fs.sources.splice(
|
|
130
|
+
0,
|
|
131
|
+
0,
|
|
132
|
+
`layout (location = 0) out vec4 out_FragData_0;\nlayout (location = 1) out vec4 out_FragData_1;`
|
|
133
|
+
);
|
|
134
|
+
|
|
129
135
|
fs.sources = fs.sources.map(function (source) {
|
|
130
136
|
source = ShaderSource.replaceMain(
|
|
131
137
|
source,
|
|
132
138
|
"czm_point_cloud_post_process_main"
|
|
133
139
|
);
|
|
134
|
-
source = source.
|
|
140
|
+
source = source.replaceAll(/out_FragColor/g, "out_FragData_0");
|
|
135
141
|
return source;
|
|
136
142
|
});
|
|
137
143
|
|
|
138
|
-
fs.sources.unshift("#extension GL_EXT_draw_buffers : enable \n");
|
|
139
144
|
fs.sources.push(
|
|
140
145
|
"void main() \n" +
|
|
141
146
|
"{ \n" +
|
|
142
147
|
" czm_point_cloud_post_process_main(); \n" +
|
|
143
148
|
"#ifdef LOG_DEPTH\n" +
|
|
144
149
|
" czm_writeLogDepth();\n" +
|
|
145
|
-
"
|
|
150
|
+
" out_FragData_1 = czm_packDepth(gl_FragDepth); \n" +
|
|
146
151
|
"#else\n" +
|
|
147
|
-
"
|
|
152
|
+
" out_FragData_1 = czm_packDepth(gl_FragCoord.z);\n" +
|
|
148
153
|
"#endif\n" +
|
|
149
154
|
"}"
|
|
150
155
|
);
|
|
@@ -1294,8 +1294,7 @@ PolylineBucket.prototype.updateShader = function (
|
|
|
1294
1294
|
|
|
1295
1295
|
// Check for use of v_polylineAngle in material shader
|
|
1296
1296
|
if (
|
|
1297
|
-
this.material.shaderSource.search(/
|
|
1298
|
-
-1
|
|
1297
|
+
this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g) !== -1
|
|
1299
1298
|
) {
|
|
1300
1299
|
defines.push("POLYLINE_DASH");
|
|
1301
1300
|
}
|
|
@@ -1306,11 +1305,7 @@ PolylineBucket.prototype.updateShader = function (
|
|
|
1306
1305
|
|
|
1307
1306
|
const fs = new ShaderSource({
|
|
1308
1307
|
defines: defines,
|
|
1309
|
-
sources: [
|
|
1310
|
-
"varying vec4 v_pickColor;\n",
|
|
1311
|
-
this.material.shaderSource,
|
|
1312
|
-
PolylineFS,
|
|
1313
|
-
],
|
|
1308
|
+
sources: ["in vec4 v_pickColor;\n", this.material.shaderSource, PolylineFS],
|
|
1314
1309
|
});
|
|
1315
1310
|
|
|
1316
1311
|
const vsSource = batchTable.getVertexShaderCallback()(PolylineVS);
|
|
@@ -111,9 +111,8 @@ Object.defineProperties(PolylineMaterialAppearance.prototype, {
|
|
|
111
111
|
get: function () {
|
|
112
112
|
let vs = this._vertexShaderSource;
|
|
113
113
|
if (
|
|
114
|
-
this.material.shaderSource.search(
|
|
115
|
-
|
|
116
|
-
) !== -1
|
|
114
|
+
this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g) !==
|
|
115
|
+
-1
|
|
117
116
|
) {
|
|
118
117
|
vs = `#define POLYLINE_DASH\n${vs}`;
|
|
119
118
|
}
|