@cesium/engine 1.0.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/{AttributeCompression-4589338a.js → AttributeCompression-b646d393.js} +1 -1
- package/Build/Workers/{AxisAlignedBoundingBox-bfb1234f.js → AxisAlignedBoundingBox-47525601.js} +1 -1
- package/Build/Workers/{BoundingRectangle-7ffc2153.js → BoundingRectangle-93b263ac.js} +1 -1
- package/Build/Workers/{BoxGeometry-93f344a3.js → BoxGeometry-8c4b4125.js} +1 -1
- package/Build/Workers/{Color-0c5aaf47.js → Color-52c60ed7.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-6597982a.js → CoplanarPolygonGeometryLibrary-33c4c1f8.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-2119580e.js → CorridorGeometryLibrary-5039cd8e.js} +1 -1
- package/Build/Workers/{CylinderGeometry-f9503c6d.js → CylinderGeometry-3ac44974.js} +1 -1
- package/Build/Workers/{EllipseGeometry-fedf72d5.js → EllipseGeometry-a9c9b3be.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-4ea68687.js → EllipseGeometryLibrary-855d4681.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-e2ae6a35.js → EllipseOutlineGeometry-017a5929.js} +1 -1
- package/Build/Workers/{EllipsoidGeodesic-16de63ea.js → EllipsoidGeodesic-98c62a56.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-95c0330e.js → EllipsoidGeometry-826e7bce.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-d6d2ceec.js → EllipsoidOutlineGeometry-784dcdb5.js} +1 -1
- package/Build/Workers/{EllipsoidRhumbLine-ae5e65e0.js → EllipsoidRhumbLine-19756602.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-bfc674bf.js → EllipsoidTangentPlane-ed9443a1.js} +1 -1
- package/Build/Workers/{EncodedCartesian3-f473ea18.js → EncodedCartesian3-81f70735.js} +1 -1
- package/Build/Workers/{FrustumGeometry-3bf2e4eb.js → FrustumGeometry-9f1ee4d8.js} +1 -1
- package/Build/Workers/{GeometryAttribute-df5f473e.js → GeometryAttribute-334718f8.js} +1 -1
- package/Build/Workers/{GeometryInstance-aa75b4cf.js → GeometryInstance-451dc1cd.js} +1 -1
- package/Build/Workers/{GeometryPipeline-f0e46c42.js → GeometryPipeline-8fb0db69.js} +1 -1
- package/Build/Workers/{IntersectionTests-9de29d51.js → IntersectionTests-27d49265.js} +1 -1
- package/Build/Workers/{Matrix2-ce637455.js → Matrix2-13178034.js} +4 -2
- package/Build/Workers/{Matrix3-4f4df527.js → Matrix3-315394f6.js} +2 -1
- package/Build/Workers/{OrientedBoundingBox-d3ff3d4d.js → OrientedBoundingBox-79ee7cbb.js} +5 -5
- package/Build/Workers/{Plane-b81241c2.js → Plane-900aa728.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-6f4937bb.js → PolygonGeometryLibrary-6b5a29e9.js} +1 -1
- package/Build/Workers/PolygonPipeline-21668b3f.js +1345 -0
- package/Build/Workers/{PolylinePipeline-2e2b015c.js → PolylinePipeline-5e2e1b21.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-7ee1d449.js → PolylineVolumeGeometryLibrary-97f0b94e.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-a9b7aae0.js → PrimitivePipeline-5640850a.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-9aa6c8f6.js → RectangleGeometryLibrary-d5457f7b.js} +1 -1
- package/Build/Workers/{TerrainEncoding-b52dcfc5.js → TerrainEncoding-bfdf2021.js} +1 -1
- package/Build/Workers/{Transforms-2f755df8.js → Transforms-a05e5e6e.js} +114 -83
- package/Build/Workers/{WallGeometryLibrary-ab19a93d.js → WallGeometryLibrary-6db0ebb6.js} +1 -1
- package/Build/Workers/{WebMercatorProjection-9f25de49.js → WebMercatorProjection-13a90d41.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +92 -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/createVectorTileClampedPolylines.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePoints.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVectorTilePolylines.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +7 -3
- 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/decodeI3S.js +1 -1
- package/Build/Workers/package.js +25 -1
- package/Build/Workers/transcodeKTX2.js +22 -2
- package/Build/Workers/transferTypedArrayTest.js +25 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/README.md +14 -16
- package/Source/Core/EarthOrientationParameters.js +67 -63
- package/Source/Core/FeatureDetection.js +18 -0
- package/Source/Core/Ion.js +1 -2
- package/Source/Core/Matrix2.js +2 -1
- package/Source/Core/Matrix3.js +2 -1
- package/Source/Core/Matrix4.js +1 -0
- package/Source/Core/OrientedBoundingBox.js +4 -4
- package/Source/Core/PixelFormat.js +22 -2
- package/Source/Core/S2Cell.js +3 -3
- package/Source/Core/Transforms.js +3 -7
- package/Source/Core/sampleTerrain.js +5 -0
- package/Source/DataSources/GpxDataSource.js +4 -6
- package/Source/DataSources/KmlDataSource.js +3 -5
- package/Source/Renderer/AutomaticUniforms.js +3 -3
- package/Source/Renderer/Context.js +20 -12
- package/Source/Renderer/Pass.js +3 -2
- 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/Cesium3DTileContentType.js +19 -0
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +494 -0
- package/Source/Scene/Cesium3DTileset.js +6 -1
- package/Source/Scene/Cesium3DTilesetMetadata.js +2 -2
- package/Source/Scene/ClassificationPrimitive.js +3 -8
- package/Source/Scene/ContentMetadata.js +2 -2
- 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 +15 -22
- package/Source/Scene/EllipsoidPrimitive.js +0 -7
- package/Source/Scene/Expression.js +1 -1
- package/Source/Scene/Globe.js +10 -0
- package/Source/Scene/GlobeSurfaceTileProvider.js +7 -0
- package/Source/Scene/GlobeTranslucencyState.js +6 -6
- package/Source/Scene/GltfImageLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +10 -2
- package/Source/Scene/GroundPolylinePrimitive.js +2 -4
- package/Source/Scene/GroupMetadata.js +2 -2
- package/Source/Scene/ImplicitMetadataView.js +2 -2
- package/Source/Scene/ImplicitSubtreeCache.js +127 -0
- package/Source/Scene/ImplicitSubtreeMetadata.js +2 -2
- package/Source/Scene/ImplicitTileset.js +3 -2
- package/Source/Scene/InvertClassification.js +9 -10
- package/Source/Scene/KeyframeNode.js +47 -0
- package/Source/Scene/Material.js +6 -6
- package/Source/Scene/Megatexture.js +490 -0
- package/Source/Scene/MetadataClass.js +60 -25
- package/Source/Scene/MetadataClassProperty.js +132 -68
- package/Source/Scene/MetadataComponentType.js +78 -57
- package/Source/Scene/MetadataEnum.js +59 -23
- package/Source/Scene/MetadataEnumValue.js +49 -15
- package/Source/Scene/MetadataSchema.js +53 -24
- package/Source/Scene/MetadataSchemaLoader.js +2 -2
- package/Source/Scene/MetadataSemantic.js +8 -0
- package/Source/Scene/MetadataTableProperty.js +2 -2
- package/Source/Scene/MetadataType.js +6 -14
- package/Source/Scene/Model/CustomShader.js +1 -1
- package/Source/Scene/Model/FeatureIdPipelineStage.js +4 -4
- package/Source/Scene/Model/GeoJsonLoader.js +1 -1
- package/Source/Scene/Model/LightingModel.js +1 -1
- package/Source/Scene/Model/MetadataPipelineStage.js +1 -1
- package/Source/Scene/Model/Model.js +2 -3
- package/Source/Scene/Model/PickingPipelineStage.js +1 -1
- package/Source/Scene/Model/buildDrawCommand.js +19 -11
- package/Source/Scene/OIT.js +211 -119
- package/Source/Scene/PickDepth.js +2 -2
- package/Source/Scene/PointCloud.js +12 -12
- 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/PropertyAttribute.js +2 -2
- package/Source/Scene/PropertyAttributeProperty.js +2 -2
- package/Source/Scene/PropertyTable.js +2 -2
- package/Source/Scene/PropertyTexture.js +2 -2
- package/Source/Scene/PropertyTextureProperty.js +2 -2
- package/Source/Scene/ResourceCache.js +9 -1
- package/Source/Scene/ResourceCacheKey.js +9 -1
- package/Source/Scene/Scene.js +17 -0
- package/Source/Scene/ShadowMap.js +7 -7
- package/Source/Scene/ShadowMapShader.js +9 -9
- package/Source/Scene/ShadowVolumeAppearance.js +1 -1
- package/Source/Scene/SpatialNode.js +375 -0
- package/Source/Scene/StructuralMetadata.js +2 -2
- package/Source/Scene/TextureAtlas.js +5 -3
- package/Source/Scene/TileMetadata.js +2 -2
- package/Source/Scene/TilesetMetadata.js +2 -2
- package/Source/Scene/Vector3DTilePolylines.js +1 -1
- package/Source/Scene/Vector3DTilePrimitive.js +2 -2
- package/Source/Scene/VoxelBoxShape.js +527 -0
- package/Source/Scene/VoxelContent.js +169 -0
- package/Source/Scene/VoxelCylinderShape.js +937 -0
- package/Source/Scene/VoxelEllipsoidShape.js +945 -0
- package/Source/Scene/VoxelPrimitive.js +1919 -0
- package/Source/Scene/VoxelProvider.js +255 -0
- package/Source/Scene/VoxelRenderResources.js +224 -0
- package/Source/Scene/VoxelShape.js +152 -0
- package/Source/Scene/VoxelShapeType.js +105 -0
- package/Source/Scene/VoxelTraversal.js +1144 -0
- package/Source/Scene/buildVoxelDrawCommands.js +116 -0
- 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/parseBatchTable.js +18 -2
- package/Source/Scene/preprocess3DTileContent.js +8 -0
- package/Source/Scene/processVoxelProperties.js +455 -0
- 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 +24 -24
- package/Source/Shaders/BillboardCollectionVS.js +24 -24
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +2 -2
- package/Source/Shaders/BrdfLutGeneratorFS.js +2 -2
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passVoxels.js +11 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +19 -15
- 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/windowToEyeCoordinates.glsl +55 -43
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +55 -43
- 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 +17 -16
- package/Source/Shaders/GlobeFS.js +17 -16
- 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 +17 -14
- package/Source/Shaders/PointPrimitiveCollectionVS.js +17 -14
- 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/IntersectBox.glsl +79 -0
- package/Source/Shaders/Voxels/IntersectBox.js +81 -0
- package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +70 -0
- package/Source/Shaders/Voxels/IntersectClippingPlanes.js +72 -0
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +273 -0
- package/Source/Shaders/Voxels/IntersectCylinder.js +275 -0
- package/Source/Shaders/Voxels/IntersectDepth.glsl +23 -0
- package/Source/Shaders/Voxels/IntersectDepth.js +25 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +347 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +349 -0
- package/Source/Shaders/Voxels/Intersection.glsl +54 -0
- package/Source/Shaders/Voxels/Intersection.js +56 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +151 -0
- package/Source/Shaders/Voxels/IntersectionUtils.js +153 -0
- package/Source/Shaders/Voxels/Megatexture.glsl +136 -0
- package/Source/Shaders/Voxels/Megatexture.js +138 -0
- package/Source/Shaders/Voxels/Octree.glsl +221 -0
- package/Source/Shaders/Voxels/Octree.js +223 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +150 -0
- package/Source/Shaders/Voxels/VoxelFS.js +152 -0
- package/Source/Shaders/Voxels/VoxelVS.glsl +11 -0
- package/Source/Shaders/Voxels/VoxelVS.js +13 -0
- package/Source/Shaders/Voxels/convertUvToBox.glsl +16 -0
- package/Source/Shaders/Voxels/convertUvToBox.js +18 -0
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +75 -0
- package/Source/Shaders/Voxels/convertUvToCylinder.js +77 -0
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +130 -0
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +132 -0
- package/Source/ThirdParty/Workers/z-worker-pako.js +0 -0
- package/Source/WorkersES6/decodeDraco.js +9 -1
- package/index.d.ts +3148 -2297
- package/index.js +1118 -1085
- package/package.json +3 -4
- package/Build/Workers/PolygonPipeline-774a8aaf.js +0 -1341
- package/Source/Renderer/modernizeShader.js +0 -242
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//This file is automatically rebuilt by the Cesium build process.
|
|
2
2
|
export default "#ifdef QUANTIZATION_BITS12\n\
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
in vec4 compressed0;\n\
|
|
4
|
+
in float compressed1;\n\
|
|
5
5
|
#else\n\
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
in vec4 position3DAndHeight;\n\
|
|
7
|
+
in vec4 textureCoordAndEncodedNormals;\n\
|
|
8
8
|
#endif\n\
|
|
9
9
|
\n\
|
|
10
10
|
#ifdef GEODETIC_SURFACE_NORMALS\n\
|
|
11
|
-
|
|
11
|
+
in vec3 geodeticSurfaceNormal;\n\
|
|
12
12
|
#endif\n\
|
|
13
13
|
\n\
|
|
14
14
|
#ifdef EXAGGERATION\n\
|
|
@@ -24,27 +24,27 @@ uniform vec4 u_tileRectangle;\n\
|
|
|
24
24
|
uniform vec2 u_southAndNorthLatitude;\n\
|
|
25
25
|
uniform vec2 u_southMercatorYAndOneOverHeight;\n\
|
|
26
26
|
\n\
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
out vec3 v_positionMC;\n\
|
|
28
|
+
out vec3 v_positionEC;\n\
|
|
29
29
|
\n\
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
out vec3 v_textureCoordinates;\n\
|
|
31
|
+
out vec3 v_normalMC;\n\
|
|
32
|
+
out vec3 v_normalEC;\n\
|
|
33
33
|
\n\
|
|
34
34
|
#ifdef APPLY_MATERIAL\n\
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
out float v_slope;\n\
|
|
36
|
+
out float v_aspect;\n\
|
|
37
|
+
out float v_height;\n\
|
|
38
38
|
#endif\n\
|
|
39
39
|
\n\
|
|
40
40
|
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\n\
|
|
41
|
-
|
|
41
|
+
out float v_distance;\n\
|
|
42
42
|
#endif\n\
|
|
43
43
|
\n\
|
|
44
44
|
#if defined(FOG) || defined(GROUND_ATMOSPHERE)\n\
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
out vec3 v_atmosphereRayleighColor;\n\
|
|
46
|
+
out vec3 v_atmosphereMieColor;\n\
|
|
47
|
+
out float v_atmosphereOpacity;\n\
|
|
48
48
|
#endif\n\
|
|
49
49
|
\n\
|
|
50
50
|
// These functions are generated at runtime.\n\
|
|
@@ -3,7 +3,7 @@ uniform sampler2D image;
|
|
|
3
3
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
4
4
|
{
|
|
5
5
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
6
|
-
vec4 rampColor =
|
|
6
|
+
vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
|
|
7
7
|
rampColor = czm_gammaCorrect(rampColor);
|
|
8
8
|
material.diffuse = rampColor.rgb;
|
|
9
9
|
material.alpha = rampColor.a;
|
|
@@ -4,7 +4,7 @@ export default "uniform sampler2D image;\n\
|
|
|
4
4
|
czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
5
5
|
{\n\
|
|
6
6
|
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
|
7
|
-
vec4 rampColor =
|
|
7
|
+
vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\n\
|
|
8
8
|
rampColor = czm_gammaCorrect(rampColor);\n\
|
|
9
9
|
material.diffuse = rampColor.rgb;\n\
|
|
10
10
|
material.alpha = rampColor.a;\n\
|
|
@@ -9,15 +9,15 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
9
9
|
vec2 st = materialInput.st;
|
|
10
10
|
|
|
11
11
|
vec2 centerPixel = fract(repeat * st);
|
|
12
|
-
float centerBump =
|
|
12
|
+
float centerBump = texture(image, centerPixel).channel;
|
|
13
13
|
|
|
14
14
|
float imageWidth = float(imageDimensions.x);
|
|
15
15
|
vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
|
|
16
|
-
float rightBump =
|
|
16
|
+
float rightBump = texture(image, rightPixel).channel;
|
|
17
17
|
|
|
18
18
|
float imageHeight = float(imageDimensions.y);
|
|
19
19
|
vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
|
|
20
|
-
float topBump =
|
|
20
|
+
float topBump = texture(image, leftPixel).channel;
|
|
21
21
|
|
|
22
22
|
vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
|
|
23
23
|
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
|
|
@@ -10,15 +10,15 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
10
10
|
vec2 st = materialInput.st;\n\
|
|
11
11
|
\n\
|
|
12
12
|
vec2 centerPixel = fract(repeat * st);\n\
|
|
13
|
-
float centerBump =
|
|
13
|
+
float centerBump = texture(image, centerPixel).channel;\n\
|
|
14
14
|
\n\
|
|
15
15
|
float imageWidth = float(imageDimensions.x);\n\
|
|
16
16
|
vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\n\
|
|
17
|
-
float rightBump =
|
|
17
|
+
float rightBump = texture(image, rightPixel).channel;\n\
|
|
18
18
|
\n\
|
|
19
19
|
float imageHeight = float(imageDimensions.y);\n\
|
|
20
20
|
vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\n\
|
|
21
|
-
float topBump =
|
|
21
|
+
float topBump = texture(image, leftPixel).channel;\n\
|
|
22
22
|
\n\
|
|
23
23
|
vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\n\
|
|
24
24
|
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n\
|
|
@@ -7,9 +7,9 @@ float getHeight(int idx, float invTexSize)
|
|
|
7
7
|
{
|
|
8
8
|
vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
|
|
9
9
|
#ifdef OES_texture_float
|
|
10
|
-
return
|
|
10
|
+
return texture(heights, uv).x;
|
|
11
11
|
#else
|
|
12
|
-
return czm_unpackFloat(
|
|
12
|
+
return czm_unpackFloat(texture(heights, uv));
|
|
13
13
|
#endif
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -58,7 +58,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
58
58
|
|
|
59
59
|
float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
|
|
60
60
|
vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
|
|
61
|
-
vec4 color =
|
|
61
|
+
vec4 color = texture(colors, colorUv);
|
|
62
62
|
|
|
63
63
|
// undo preumultiplied alpha
|
|
64
64
|
if (color.a > 0.0)
|
|
@@ -8,9 +8,9 @@ float getHeight(int idx, float invTexSize)\n\
|
|
|
8
8
|
{\n\
|
|
9
9
|
vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\n\
|
|
10
10
|
#ifdef OES_texture_float\n\
|
|
11
|
-
return
|
|
11
|
+
return texture(heights, uv).x;\n\
|
|
12
12
|
#else\n\
|
|
13
|
-
return czm_unpackFloat(
|
|
13
|
+
return czm_unpackFloat(texture(heights, uv));\n\
|
|
14
14
|
#endif\n\
|
|
15
15
|
}\n\
|
|
16
16
|
\n\
|
|
@@ -59,7 +59,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
59
59
|
\n\
|
|
60
60
|
float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\n\
|
|
61
61
|
vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\n\
|
|
62
|
-
vec4 color =
|
|
62
|
+
vec4 color = texture(colors, colorUv);\n\
|
|
63
63
|
\n\
|
|
64
64
|
// undo preumultiplied alpha\n\
|
|
65
65
|
if (color.a > 0.0) \n\
|
|
@@ -12,12 +12,13 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
12
12
|
|
|
13
13
|
float distanceToContour = mod(materialInput.height, spacing);
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
16
16
|
float dxc = abs(dFdx(materialInput.height));
|
|
17
17
|
float dyc = abs(dFdy(materialInput.height));
|
|
18
18
|
float dF = max(dxc, dyc) * czm_pixelRatio * width;
|
|
19
19
|
float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
|
|
20
20
|
#else
|
|
21
|
+
// If no derivatives available (IE 10?), use pixel ratio
|
|
21
22
|
float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
|
|
22
23
|
#endif
|
|
23
24
|
|
|
@@ -13,12 +13,13 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
13
13
|
\n\
|
|
14
14
|
float distanceToContour = mod(materialInput.height, spacing);\n\
|
|
15
15
|
\n\
|
|
16
|
-
#
|
|
16
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n\
|
|
17
17
|
float dxc = abs(dFdx(materialInput.height));\n\
|
|
18
18
|
float dyc = abs(dFdy(materialInput.height));\n\
|
|
19
19
|
float dF = max(dxc, dyc) * czm_pixelRatio * width;\n\
|
|
20
20
|
float alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n\
|
|
21
21
|
#else\n\
|
|
22
|
+
// If no derivatives available (IE 10?), use pixel ratio\n\
|
|
22
23
|
float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n\
|
|
23
24
|
#endif\n\
|
|
24
25
|
\n\
|
|
@@ -6,7 +6,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
6
6
|
{
|
|
7
7
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
8
8
|
float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
|
|
9
|
-
vec4 rampColor =
|
|
9
|
+
vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
|
|
10
10
|
rampColor = czm_gammaCorrect(rampColor);
|
|
11
11
|
material.diffuse = rampColor.rgb;
|
|
12
12
|
material.alpha = rampColor.a;
|
|
@@ -7,7 +7,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
7
7
|
{\n\
|
|
8
8
|
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
|
9
9
|
float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\n\
|
|
10
|
-
vec4 rampColor =
|
|
10
|
+
vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));\n\
|
|
11
11
|
rampColor = czm_gammaCorrect(rampColor);\n\
|
|
12
12
|
material.diffuse = rampColor.rgb;\n\
|
|
13
13
|
material.alpha = rampColor.a;\n\
|
|
@@ -20,8 +20,9 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
20
20
|
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
|
|
21
21
|
|
|
22
22
|
float value;
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
// Fuzz Factor - Controls blurriness of lines
|
|
25
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
25
26
|
const float fuzz = 1.2;
|
|
26
27
|
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
|
|
27
28
|
|
|
@@ -33,7 +34,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
33
34
|
smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
|
|
34
35
|
smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
|
|
35
36
|
#else
|
|
36
|
-
//
|
|
37
|
+
// If no derivatives available (IE 10?), revert to view-dependent fuzz
|
|
37
38
|
const float fuzz = 0.05;
|
|
38
39
|
|
|
39
40
|
vec2 range = 0.5 - (lineThickness * 0.05);
|
|
@@ -21,8 +21,9 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
21
21
|
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\
|
|
22
22
|
\n\
|
|
23
23
|
float value;\n\
|
|
24
|
-
|
|
24
|
+
\n\
|
|
25
25
|
// Fuzz Factor - Controls blurriness of lines\n\
|
|
26
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n\
|
|
26
27
|
const float fuzz = 1.2;\n\
|
|
27
28
|
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\n\
|
|
28
29
|
\n\
|
|
@@ -34,7 +35,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
34
35
|
smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n\
|
|
35
36
|
smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n\
|
|
36
37
|
#else\n\
|
|
37
|
-
//
|
|
38
|
+
// If no derivatives available (IE 10?), revert to view-dependent fuzz\n\
|
|
38
39
|
const float fuzz = 0.05;\n\
|
|
39
40
|
\n\
|
|
40
41
|
vec2 range = 0.5 - (lineThickness * 0.05);\n\
|
|
@@ -6,7 +6,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
6
6
|
{
|
|
7
7
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
8
8
|
|
|
9
|
-
vec4 textureValue =
|
|
9
|
+
vec4 textureValue = texture(image, fract(repeat * materialInput.st));
|
|
10
10
|
vec3 normalTangentSpace = textureValue.channels;
|
|
11
11
|
normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
|
|
12
12
|
normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
|
|
@@ -7,7 +7,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
7
7
|
{\n\
|
|
8
8
|
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
|
9
9
|
\n\
|
|
10
|
-
vec4 textureValue =
|
|
10
|
+
vec4 textureValue = texture(image, fract(repeat * materialInput.st));\n\
|
|
11
11
|
vec3 normalTangentSpace = textureValue.channels;\n\
|
|
12
12
|
normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\n\
|
|
13
13
|
normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\n\
|
|
@@ -16,10 +16,11 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
16
16
|
|
|
17
17
|
vec2 st = materialInput.st;
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
20
20
|
float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
|
|
21
21
|
#else
|
|
22
|
-
|
|
22
|
+
// If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
|
|
23
|
+
float base = 0.975;
|
|
23
24
|
#endif
|
|
24
25
|
|
|
25
26
|
vec2 center = vec2(1.0, 0.5);
|
|
@@ -17,10 +17,11 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
17
17
|
\n\
|
|
18
18
|
vec2 st = materialInput.st;\n\
|
|
19
19
|
\n\
|
|
20
|
-
#
|
|
20
|
+
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n\
|
|
21
21
|
float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n\
|
|
22
22
|
#else\n\
|
|
23
|
-
|
|
23
|
+
// If no derivatives available (IE 10?), 2.5% of the line will be the arrow head\n\
|
|
24
|
+
float base = 0.975;\n\
|
|
24
25
|
#endif\n\
|
|
25
26
|
\n\
|
|
26
27
|
vec2 center = vec2(1.0, 0.5);\n\
|
|
@@ -3,7 +3,7 @@ uniform sampler2D image;
|
|
|
3
3
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
4
4
|
{
|
|
5
5
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
6
|
-
vec4 rampColor =
|
|
6
|
+
vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
|
|
7
7
|
rampColor = czm_gammaCorrect(rampColor);
|
|
8
8
|
material.diffuse = rampColor.rgb;
|
|
9
9
|
material.alpha = rampColor.a;
|
|
@@ -4,7 +4,7 @@ export default "uniform sampler2D image;\n\
|
|
|
4
4
|
czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
5
5
|
{\n\
|
|
6
6
|
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
|
7
|
-
vec4 rampColor =
|
|
7
|
+
vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\n\
|
|
8
8
|
rampColor = czm_gammaCorrect(rampColor);\n\
|
|
9
9
|
material.diffuse = rampColor.rgb;\n\
|
|
10
10
|
material.alpha = rampColor.a;\n\
|
|
@@ -20,7 +20,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
20
20
|
// fade is a function of the distance from the fragment and the frequency of the waves
|
|
21
21
|
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
|
|
22
22
|
|
|
23
|
-
float specularMapValue =
|
|
23
|
+
float specularMapValue = texture(specularMap, materialInput.st).r;
|
|
24
24
|
|
|
25
25
|
// note: not using directional motion at this time, just set the angle to 0.0;
|
|
26
26
|
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
|
|
@@ -21,7 +21,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
21
21
|
// fade is a function of the distance from the fragment and the frequency of the waves\n\
|
|
22
22
|
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\n\
|
|
23
23
|
\n\
|
|
24
|
-
float specularMapValue =
|
|
24
|
+
float specularMapValue = texture(specularMap, materialInput.st).r;\n\
|
|
25
25
|
\n\
|
|
26
26
|
// note: not using directional motion at this time, just set the angle to 0.0;\n\
|
|
27
27
|
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\n\
|
|
@@ -30,7 +30,7 @@ vec3 proceduralIBL(
|
|
|
30
30
|
|
|
31
31
|
float inverseRoughness = 1.04 - roughness;
|
|
32
32
|
inverseRoughness *= inverseRoughness;
|
|
33
|
-
vec3 sceneSkyBox =
|
|
33
|
+
vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness;
|
|
34
34
|
|
|
35
35
|
float atmosphereHeight = 0.05;
|
|
36
36
|
float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);
|
|
@@ -67,7 +67,7 @@ vec3 proceduralIBL(
|
|
|
67
67
|
float luminance = model_luminanceAtZenith * (numerator / denominator);
|
|
68
68
|
#endif
|
|
69
69
|
|
|
70
|
-
vec2 brdfLut =
|
|
70
|
+
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
|
|
71
71
|
vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);
|
|
72
72
|
float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);
|
|
73
73
|
vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);
|
|
@@ -122,7 +122,7 @@ vec3 textureIBL(
|
|
|
122
122
|
vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
|
|
123
123
|
vec3 F = fresnelSchlick2(r0, r90, VdotH);
|
|
124
124
|
|
|
125
|
-
vec2 brdfLut =
|
|
125
|
+
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
|
|
126
126
|
#ifdef CUSTOM_SPECULAR_IBL
|
|
127
127
|
vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);
|
|
128
128
|
#else
|
|
@@ -31,7 +31,7 @@ export default "vec3 proceduralIBL(\n\
|
|
|
31
31
|
\n\
|
|
32
32
|
float inverseRoughness = 1.04 - roughness;\n\
|
|
33
33
|
inverseRoughness *= inverseRoughness;\n\
|
|
34
|
-
vec3 sceneSkyBox =
|
|
34
|
+
vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n\
|
|
35
35
|
\n\
|
|
36
36
|
float atmosphereHeight = 0.05;\n\
|
|
37
37
|
float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n\
|
|
@@ -68,7 +68,7 @@ export default "vec3 proceduralIBL(\n\
|
|
|
68
68
|
float luminance = model_luminanceAtZenith * (numerator / denominator);\n\
|
|
69
69
|
#endif \n\
|
|
70
70
|
\n\
|
|
71
|
-
vec2 brdfLut =
|
|
71
|
+
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
|
|
72
72
|
vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);\n\
|
|
73
73
|
float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n\
|
|
74
74
|
vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n\
|
|
@@ -123,7 +123,7 @@ vec3 textureIBL(\n\
|
|
|
123
123
|
vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n\
|
|
124
124
|
vec3 F = fresnelSchlick2(r0, r90, VdotH);\n\
|
|
125
125
|
\n\
|
|
126
|
-
vec2 brdfLut =
|
|
126
|
+
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
|
|
127
127
|
#ifdef CUSTOM_SPECULAR_IBL \n\
|
|
128
128
|
vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);\n\
|
|
129
129
|
#else \n\
|
|
@@ -34,10 +34,10 @@ vec3 computeNormal(ProcessedAttributes attributes)
|
|
|
34
34
|
vec3 t = attributes.tangentEC;
|
|
35
35
|
vec3 b = attributes.bitangentEC;
|
|
36
36
|
mat3 tbn = mat3(t, b, ng);
|
|
37
|
-
vec3 n =
|
|
37
|
+
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
|
|
38
38
|
normal = normalize(tbn * (2.0 * n - 1.0));
|
|
39
|
-
#elif defined(GL_OES_standard_derivatives)
|
|
40
|
-
//
|
|
39
|
+
#elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
40
|
+
// If derivatives are available (not IE 10), compute tangents
|
|
41
41
|
vec3 positionEC = attributes.positionEC;
|
|
42
42
|
vec3 pos_dx = dFdx(positionEC);
|
|
43
43
|
vec3 pos_dy = dFdy(positionEC);
|
|
@@ -47,7 +47,7 @@ vec3 computeNormal(ProcessedAttributes attributes)
|
|
|
47
47
|
t = normalize(t - ng * dot(ng, t));
|
|
48
48
|
vec3 b = normalize(cross(ng, t));
|
|
49
49
|
mat3 tbn = mat3(t, b, ng);
|
|
50
|
-
vec3 n =
|
|
50
|
+
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
|
|
51
51
|
normal = normalize(tbn * (2.0 * n - 1.0));
|
|
52
52
|
#endif
|
|
53
53
|
#endif
|
|
@@ -77,7 +77,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
77
77
|
baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
|
|
78
78
|
#endif
|
|
79
79
|
|
|
80
|
-
baseColorWithAlpha = czm_srgbToLinear(
|
|
80
|
+
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
|
|
81
81
|
|
|
82
82
|
#ifdef HAS_BASE_COLOR_FACTOR
|
|
83
83
|
baseColorWithAlpha *= u_baseColorFactor;
|
|
@@ -109,7 +109,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
109
109
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
|
|
110
110
|
occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
|
|
111
111
|
#endif
|
|
112
|
-
material.occlusion =
|
|
112
|
+
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
|
|
113
113
|
#endif
|
|
114
114
|
|
|
115
115
|
#ifdef HAS_EMISSIVE_TEXTURE
|
|
@@ -118,7 +118,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
118
118
|
emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
|
|
119
119
|
#endif
|
|
120
120
|
|
|
121
|
-
vec3 emissive = czm_srgbToLinear(
|
|
121
|
+
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
|
|
122
122
|
#ifdef HAS_EMISSIVE_FACTOR
|
|
123
123
|
emissive *= u_emissiveFactor;
|
|
124
124
|
#endif
|
|
@@ -134,7 +134,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
134
134
|
specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
|
|
135
135
|
#endif
|
|
136
136
|
|
|
137
|
-
vec4 specularGlossiness = czm_srgbToLinear(
|
|
137
|
+
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
|
|
138
138
|
vec3 specular = specularGlossiness.rgb;
|
|
139
139
|
float glossiness = specularGlossiness.a;
|
|
140
140
|
#ifdef HAS_SPECULAR_FACTOR
|
|
@@ -164,7 +164,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
164
164
|
diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
|
|
165
165
|
#endif
|
|
166
166
|
|
|
167
|
-
vec4 diffuse = czm_srgbToLinear(
|
|
167
|
+
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
|
|
168
168
|
#ifdef HAS_DIFFUSE_FACTOR
|
|
169
169
|
diffuse *= u_diffuseFactor;
|
|
170
170
|
#endif
|
|
@@ -191,7 +191,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
191
191
|
metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
|
|
192
192
|
#endif
|
|
193
193
|
|
|
194
|
-
vec3 metallicRoughness =
|
|
194
|
+
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
|
|
195
195
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
|
|
196
196
|
float roughness = clamp(metallicRoughness.g, 0.04, 1.0);
|
|
197
197
|
#ifdef HAS_METALLIC_FACTOR
|
|
@@ -35,10 +35,10 @@ vec3 computeNormal(ProcessedAttributes attributes)\n\
|
|
|
35
35
|
vec3 t = attributes.tangentEC;\n\
|
|
36
36
|
vec3 b = attributes.bitangentEC;\n\
|
|
37
37
|
mat3 tbn = mat3(t, b, ng);\n\
|
|
38
|
-
vec3 n =
|
|
38
|
+
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;\n\
|
|
39
39
|
normal = normalize(tbn * (2.0 * n - 1.0));\n\
|
|
40
|
-
#elif defined(GL_OES_standard_derivatives)\n\
|
|
41
|
-
//
|
|
40
|
+
#elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n\
|
|
41
|
+
// If derivatives are available (not IE 10), compute tangents\n\
|
|
42
42
|
vec3 positionEC = attributes.positionEC;\n\
|
|
43
43
|
vec3 pos_dx = dFdx(positionEC);\n\
|
|
44
44
|
vec3 pos_dy = dFdy(positionEC);\n\
|
|
@@ -48,7 +48,7 @@ vec3 computeNormal(ProcessedAttributes attributes)\n\
|
|
|
48
48
|
t = normalize(t - ng * dot(ng, t));\n\
|
|
49
49
|
vec3 b = normalize(cross(ng, t));\n\
|
|
50
50
|
mat3 tbn = mat3(t, b, ng);\n\
|
|
51
|
-
vec3 n =
|
|
51
|
+
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;\n\
|
|
52
52
|
normal = normalize(tbn * (2.0 * n - 1.0));\n\
|
|
53
53
|
#endif\n\
|
|
54
54
|
#endif\n\
|
|
@@ -78,7 +78,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
78
78
|
baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\n\
|
|
79
79
|
#endif\n\
|
|
80
80
|
\n\
|
|
81
|
-
baseColorWithAlpha = czm_srgbToLinear(
|
|
81
|
+
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));\n\
|
|
82
82
|
\n\
|
|
83
83
|
#ifdef HAS_BASE_COLOR_FACTOR\n\
|
|
84
84
|
baseColorWithAlpha *= u_baseColorFactor;\n\
|
|
@@ -110,7 +110,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
110
110
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\n\
|
|
111
111
|
occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\n\
|
|
112
112
|
#endif\n\
|
|
113
|
-
material.occlusion =
|
|
113
|
+
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;\n\
|
|
114
114
|
#endif\n\
|
|
115
115
|
\n\
|
|
116
116
|
#ifdef HAS_EMISSIVE_TEXTURE\n\
|
|
@@ -119,7 +119,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
119
119
|
emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\n\
|
|
120
120
|
#endif\n\
|
|
121
121
|
\n\
|
|
122
|
-
vec3 emissive = czm_srgbToLinear(
|
|
122
|
+
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);\n\
|
|
123
123
|
#ifdef HAS_EMISSIVE_FACTOR\n\
|
|
124
124
|
emissive *= u_emissiveFactor;\n\
|
|
125
125
|
#endif\n\
|
|
@@ -135,7 +135,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
135
135
|
specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\n\
|
|
136
136
|
#endif\n\
|
|
137
137
|
\n\
|
|
138
|
-
vec4 specularGlossiness = czm_srgbToLinear(
|
|
138
|
+
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));\n\
|
|
139
139
|
vec3 specular = specularGlossiness.rgb;\n\
|
|
140
140
|
float glossiness = specularGlossiness.a;\n\
|
|
141
141
|
#ifdef HAS_SPECULAR_FACTOR\n\
|
|
@@ -165,7 +165,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
165
165
|
diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\n\
|
|
166
166
|
#endif\n\
|
|
167
167
|
\n\
|
|
168
|
-
vec4 diffuse = czm_srgbToLinear(
|
|
168
|
+
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));\n\
|
|
169
169
|
#ifdef HAS_DIFFUSE_FACTOR\n\
|
|
170
170
|
diffuse *= u_diffuseFactor;\n\
|
|
171
171
|
#endif\n\
|
|
@@ -192,7 +192,7 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
192
192
|
metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\n\
|
|
193
193
|
#endif\n\
|
|
194
194
|
\n\
|
|
195
|
-
vec3 metallicRoughness =
|
|
195
|
+
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n\
|
|
196
196
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n\
|
|
197
197
|
float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n\
|
|
198
198
|
#ifdef HAS_METALLIC_FACTOR\n\
|
|
@@ -10,7 +10,7 @@ vec4 getClippingPlane(
|
|
|
10
10
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
11
11
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
12
12
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
13
|
-
vec4 plane =
|
|
13
|
+
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
14
14
|
return czm_transformPlane(plane, transform);
|
|
15
15
|
}
|
|
16
16
|
#else
|
|
@@ -27,11 +27,11 @@ vec4 getClippingPlane(
|
|
|
27
27
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
28
28
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
29
29
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
30
|
-
vec4 oct32 =
|
|
30
|
+
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
31
31
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
32
32
|
vec4 plane;
|
|
33
33
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
34
|
-
plane.w = czm_unpackFloat(
|
|
34
|
+
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
|
|
35
35
|
return czm_transformPlane(plane, transform);
|
|
36
36
|
}
|
|
37
37
|
#endif
|