@cesium/engine 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/{chunk-AA4GZKOT.js → chunk-2EDC3QGH.js} +1 -1
- package/Build/Workers/{chunk-DKVHRNFY.js → chunk-2MKRG7L7.js} +5 -5
- package/Build/Workers/{chunk-X23FRWHJ.js → chunk-2RZYNSMR.js} +6 -6
- package/Build/Workers/{chunk-TO2PVHKI.js → chunk-4NBRIKB3.js} +2 -2
- package/Build/Workers/{chunk-GRAT5GE7.js → chunk-4TK5YR6Q.js} +5 -5
- package/Build/Workers/{chunk-XD445VDH.js → chunk-54VC7SCM.js} +7 -7
- package/Build/Workers/{chunk-G3YR53LY.js → chunk-5IY5BXCT.js} +13 -13
- package/Build/Workers/{chunk-O3JCMSS3.js → chunk-6FFGOENI.js} +54 -7
- package/Build/Workers/{chunk-7XGC6YB2.js → chunk-6PJIHPQB.js} +13 -13
- package/Build/Workers/{chunk-GR3CDLCP.js → chunk-6ZREIBKS.js} +7 -7
- package/Build/Workers/{chunk-4MSUJ4I7.js → chunk-AI3O7UN2.js} +6 -6
- package/Build/Workers/{chunk-COYFZ5VA.js → chunk-AS7P4BHI.js} +6 -6
- package/Build/Workers/{chunk-JYAHOGGL.js → chunk-AUM45VEG.js} +16 -15
- package/Build/Workers/{chunk-BDFNKFOE.js → chunk-BBO6BGLC.js} +13 -13
- package/Build/Workers/{chunk-AVI4IUWC.js → chunk-BH5ZEN4I.js} +10 -10
- package/Build/Workers/{chunk-4BAE4PWO.js → chunk-BJ3WF5RW.js} +6 -6
- package/Build/Workers/{chunk-Q55ECN3Y.js → chunk-BUOFSNFW.js} +1 -1
- package/Build/Workers/{chunk-QX5XS4LC.js → chunk-BZXF3GNX.js} +2 -2
- package/Build/Workers/{chunk-PYHLO636.js → chunk-DJXXI7UF.js} +5 -5
- package/Build/Workers/{chunk-LCLJJ2MZ.js → chunk-DVAIU7A4.js} +17 -17
- package/Build/Workers/{chunk-SYCPRK3D.js → chunk-FJT3ERV7.js} +9 -9
- package/Build/Workers/{chunk-L6RTJ3RE.js → chunk-GOHDOWU5.js} +14 -14
- package/Build/Workers/{chunk-MSKXMXJI.js → chunk-HA6TZ3XT.js} +4 -4
- package/Build/Workers/{chunk-PCP4YQST.js → chunk-HBZSCVZC.js} +11 -11
- package/Build/Workers/{chunk-5S7OLEPK.js → chunk-HC7RYWPZ.js} +12 -12
- package/Build/Workers/{chunk-VE7BFUIX.js → chunk-HFMJM3SX.js} +1 -1
- package/Build/Workers/{chunk-OOK53QUQ.js → chunk-HFPMX5L2.js} +1 -1
- package/Build/Workers/{chunk-VFBNELXB.js → chunk-HO2NTC7I.js} +6 -6
- package/Build/Workers/{chunk-DOXCPOG4.js → chunk-HZPMWR4H.js} +7 -7
- package/Build/Workers/{chunk-I2RC4XVN.js → chunk-IBG5FVXC.js} +4 -4
- package/Build/Workers/{chunk-LEABCTLP.js → chunk-IXLNNST6.js} +4 -4
- package/Build/Workers/{chunk-4YSNMHZ4.js → chunk-JYUCC5NV.js} +6 -6
- package/Build/Workers/{chunk-BCL4PHHT.js → chunk-KFW4UNQH.js} +10 -10
- package/Build/Workers/{chunk-R6B7UCQB.js → chunk-KKAEXHDY.js} +2 -2
- package/Build/Workers/{chunk-BJF5LOWE.js → chunk-L6FARMF6.js} +7 -7
- package/Build/Workers/{chunk-C2CGMAIU.js → chunk-N3BIL6WA.js} +13 -13
- package/Build/Workers/{chunk-STBBMQGG.js → chunk-O5SSW3B3.js} +6 -6
- package/Build/Workers/{chunk-S3PI2KFM.js → chunk-OC4MYPVW.js} +2 -2
- package/Build/Workers/{chunk-MDHQR3ZS.js → chunk-OOA6GXKD.js} +7 -7
- package/Build/Workers/{chunk-AD5HBJ2F.js → chunk-OSCHEWSG.js} +7 -7
- package/Build/Workers/{chunk-NTXTUNEF.js → chunk-QGT2GMOK.js} +4 -4
- package/Build/Workers/{chunk-VO3ACQB2.js → chunk-RFQYEYAL.js} +17 -17
- package/Build/Workers/{chunk-KUN2ZA5X.js → chunk-RJF5ZP76.js} +4 -4
- package/Build/Workers/{chunk-QD4KM3GO.js → chunk-SIZXFNJY.js} +6 -5
- package/Build/Workers/{chunk-FXIHSF7O.js → chunk-SRZJCF7G.js} +9 -9
- package/Build/Workers/{chunk-T77JILCU.js → chunk-T4MB73MC.js} +2 -2
- package/Build/Workers/{chunk-3WUV74WM.js → chunk-TTI2SUWJ.js} +2 -2
- package/Build/Workers/{chunk-QMLTCCYG.js → chunk-VHJ5ESXF.js} +1 -1
- package/Build/Workers/{chunk-2J3JKXCP.js → chunk-VSFFJGTA.js} +9 -5
- package/Build/Workers/{chunk-DGS5QNIO.js → chunk-WQRXRDCZ.js} +11 -11
- package/Build/Workers/{chunk-OORVMGDU.js → chunk-WXDGOYTT.js} +12 -7
- package/Build/Workers/{chunk-RJYML24O.js → chunk-XLCZE6DD.js} +423 -448
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +24 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +28 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +20 -22
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/CompressedTextureBuffer.js +11 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/KTX2Transcoder.js +9 -16
- package/Source/Core/PixelFormat.js +1 -15
- package/Source/Core/Simon1994PlanetaryPositions.js +2 -1
- package/Source/Core/Transforms.js +137 -2
- package/Source/DataSources/BillboardGraphics.js +16 -0
- package/Source/DataSources/BillboardVisualizer.js +7 -0
- package/Source/DataSources/CallbackProperty.js +8 -2
- package/Source/DataSources/CheckerboardMaterialProperty.js +7 -1
- package/Source/DataSources/ColorMaterialProperty.js +7 -1
- package/Source/DataSources/CompositeMaterialProperty.js +5 -4
- package/Source/DataSources/CompositePositionProperty.js +7 -1
- package/Source/DataSources/CompositeProperty.js +5 -5
- package/Source/DataSources/ConstantPositionProperty.js +7 -1
- package/Source/DataSources/Entity.js +1 -1
- package/Source/DataSources/GridMaterialProperty.js +7 -1
- package/Source/DataSources/ImageMaterialProperty.js +8 -1
- package/Source/DataSources/MaterialProperty.js +7 -1
- package/Source/DataSources/NodeTransformationProperty.js +7 -1
- package/Source/DataSources/PathVisualizer.js +4 -4
- package/Source/DataSources/PointGraphics.js +17 -0
- package/Source/DataSources/PointVisualizer.js +12 -0
- package/Source/DataSources/PolylineArrowMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineDashMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineGlowMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineOutlineMaterialProperty.js +7 -1
- package/Source/DataSources/PositionProperty.js +5 -8
- package/Source/DataSources/PositionPropertyArray.js +7 -1
- package/Source/DataSources/Property.js +1 -1
- package/Source/DataSources/PropertyArray.js +5 -5
- package/Source/DataSources/PropertyBag.js +5 -4
- package/Source/DataSources/ReferenceProperty.js +7 -1
- package/Source/DataSources/SampledPositionProperty.js +7 -1
- package/Source/DataSources/SampledProperty.js +6 -4
- package/Source/DataSources/ScaledPositionProperty.js +6 -0
- package/Source/DataSources/StripeMaterialProperty.js +7 -1
- package/Source/DataSources/TerrainOffsetProperty.js +9 -0
- package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +7 -1
- package/Source/DataSources/TimeIntervalCollectionProperty.js +5 -5
- package/Source/DataSources/VelocityOrientationProperty.js +6 -1
- package/Source/DataSources/VelocityVectorProperty.js +3 -5
- package/Source/Renderer/AutomaticUniforms.js +3 -18
- package/Source/Renderer/Context.js +15 -0
- package/Source/Renderer/CubeMap.js +326 -348
- package/Source/Renderer/CubeMapFace.js +26 -48
- package/Source/Renderer/PixelDatatype.js +23 -0
- package/Source/Renderer/Sampler.js +7 -13
- package/Source/Renderer/ShaderProgram.js +7 -0
- package/Source/Renderer/Texture.js +396 -332
- package/Source/Renderer/UniformState.js +8 -33
- package/Source/Renderer/demodernizeShader.js +2 -0
- package/Source/Renderer/loadCubeMap.js +3 -8
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +29 -2
- package/Source/Scene/BillboardCollection.js +49 -0
- package/Source/Scene/BingMapsImageryProvider.js +10 -1
- package/Source/Scene/CameraEventAggregator.js +49 -5
- package/Source/Scene/Globe.js +1 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +29 -24
- package/Source/Scene/GlobeSurfaceTileProvider.js +5 -3
- package/Source/Scene/ImageBasedLighting.js +36 -36
- package/Source/Scene/Label.js +2 -2
- package/Source/Scene/Material.js +24 -2
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +7 -15
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/PointPrimitive.js +28 -2
- package/Source/Scene/PointPrimitiveCollection.js +22 -9
- package/Source/Scene/PostProcessStageCollection.js +45 -15
- package/Source/Scene/PostProcessStageLibrary.js +26 -0
- package/Source/Scene/Scene.js +20 -22
- package/Source/Scene/SceneTransforms.js +0 -62
- package/Source/Scene/ScreenSpaceCameraController.js +11 -4
- package/Source/Scene/SkyBox.js +13 -19
- package/Source/Scene/SpecularEnvironmentCubeMap.js +240 -0
- package/Source/Scene/Tonemapper.js +35 -23
- package/Source/Scene/VoxelPrimitive.js +0 -29
- package/Source/Scene/VoxelRenderResources.js +0 -3
- package/Source/Shaders/BillboardCollectionFS.glsl +4 -0
- package/Source/Shaders/BillboardCollectionFS.js +4 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +3 -1
- package/Source/Shaders/BillboardCollectionVS.js +3 -1
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +30 -13
- package/Source/Shaders/BrdfLutGeneratorFS.js +30 -13
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -2
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +42 -41
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +42 -41
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.glsl +23 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.js +25 -0
- package/Source/Shaders/Builtin/Functions/textureCube.glsl +21 -2
- package/Source/Shaders/Builtin/Functions/textureCube.js +21 -2
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +2 -0
- package/Source/Shaders/Builtin/Structs/materialInput.js +2 -0
- package/Source/Shaders/GlobeFS.glsl +10 -4
- package/Source/Shaders/GlobeFS.js +10 -4
- package/Source/Shaders/Materials/WaterMaskMaterial.glsl +15 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.js +17 -0
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +1 -1
- package/Source/Shaders/Model/AtmosphereStageFS.js +1 -1
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +57 -46
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +57 -46
- package/Source/Shaders/Model/LightingStageFS.glsl +8 -7
- package/Source/Shaders/Model/LightingStageFS.js +8 -7
- package/Source/Shaders/Model/MaterialStageFS.glsl +10 -14
- package/Source/Shaders/Model/MaterialStageFS.js +10 -14
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +4 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +4 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +9 -7
- package/Source/Shaders/PointPrimitiveCollectionVS.js +9 -7
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +4 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +4 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +4 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +4 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.glsl +25 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.js +27 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +4 -0
- package/Source/Shaders/SkyAtmosphereFS.glsl +1 -1
- package/Source/Shaders/SkyAtmosphereFS.js +1 -1
- package/Source/Widget/CesiumWidget.js +1 -1
- package/index.d.ts +191 -106
- package/index.js +133 -134
- package/package.json +4 -4
- package/Source/Scene/OctahedralProjectedCubeMap.js +0 -445
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +0 -78
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +0 -80
- package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +0 -89
- package/Source/Shaders/OctahedralProjectionAtlasFS.js +0 -91
- package/Source/Shaders/OctahedralProjectionFS.glsl +0 -14
- package/Source/Shaders/OctahedralProjectionFS.js +0 -16
- package/Source/Shaders/OctahedralProjectionVS.glsl +0 -10
- package/Source/Shaders/OctahedralProjectionVS.js +0 -12
|
@@ -4,7 +4,7 @@ vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColor
|
|
|
4
4
|
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
|
|
5
5
|
// Environment maps were provided, use them for IBL
|
|
6
6
|
vec3 viewDirection = -normalize(position);
|
|
7
|
-
vec3 iblColor = textureIBL(viewDirection, normal,
|
|
7
|
+
vec3 iblColor = textureIBL(viewDirection, normal, material);
|
|
8
8
|
#else
|
|
9
9
|
// Use procedural IBL if there are no environment maps
|
|
10
10
|
vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);
|
|
@@ -34,18 +34,19 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
|
|
|
34
34
|
|
|
35
35
|
// compute specular reflection from direct lighting
|
|
36
36
|
float roughness = material.clearcoatRoughness;
|
|
37
|
-
float
|
|
37
|
+
float alphaRoughness = roughness * roughness;
|
|
38
|
+
float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
|
|
38
39
|
vec3 directReflection = F * directStrength * NdotL;
|
|
39
40
|
vec3 color = lightColorHdr * directReflection;
|
|
40
41
|
|
|
41
42
|
#ifdef SPECULAR_IBL
|
|
42
43
|
// Find the direction in which to sample the environment map
|
|
43
|
-
vec3
|
|
44
|
-
vec3 iblColor = computeSpecularIBL(
|
|
44
|
+
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
|
|
45
|
+
vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
|
|
45
46
|
color += iblColor * material.occlusion;
|
|
46
47
|
#elif defined(USE_IBL_LIGHTING)
|
|
47
48
|
vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));
|
|
48
|
-
vec3 reflectionWC = normalize(czm_inverseViewRotation *
|
|
49
|
+
vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirection, normal));
|
|
49
50
|
vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);
|
|
50
51
|
|
|
51
52
|
vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);
|
|
@@ -57,7 +58,7 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
|
|
|
57
58
|
#endif
|
|
58
59
|
float maximumComponent = czm_maximumComponent(lightColorHdr);
|
|
59
60
|
vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);
|
|
60
|
-
color += clampedLightColor* iblColor * material.occlusion;
|
|
61
|
+
color += clampedLightColor * iblColor * material.occlusion;
|
|
61
62
|
#endif
|
|
62
63
|
|
|
63
64
|
float clearcoatFactor = material.clearcoatFactor;
|
|
@@ -119,7 +120,7 @@ void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
119
120
|
// tonemapping. However, if HDR is not enabled, we must tonemap else large
|
|
120
121
|
// values may be clamped to 1.0
|
|
121
122
|
#ifndef HDR
|
|
122
|
-
color =
|
|
123
|
+
color = czm_pbrNeutralTonemapping(color);
|
|
123
124
|
#endif
|
|
124
125
|
#else // unlit
|
|
125
126
|
vec3 color = material.diffuse;
|
|
@@ -5,7 +5,7 @@ vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColor
|
|
|
5
5
|
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\n\
|
|
6
6
|
// Environment maps were provided, use them for IBL\n\
|
|
7
7
|
vec3 viewDirection = -normalize(position);\n\
|
|
8
|
-
vec3 iblColor = textureIBL(viewDirection, normal,
|
|
8
|
+
vec3 iblColor = textureIBL(viewDirection, normal, material);\n\
|
|
9
9
|
#else\n\
|
|
10
10
|
// Use procedural IBL if there are no environment maps\n\
|
|
11
11
|
vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);\n\
|
|
@@ -35,18 +35,19 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
|
|
|
35
35
|
\n\
|
|
36
36
|
// compute specular reflection from direct lighting\n\
|
|
37
37
|
float roughness = material.clearcoatRoughness;\n\
|
|
38
|
-
float
|
|
38
|
+
float alphaRoughness = roughness * roughness;\n\
|
|
39
|
+
float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);\n\
|
|
39
40
|
vec3 directReflection = F * directStrength * NdotL;\n\
|
|
40
41
|
vec3 color = lightColorHdr * directReflection;\n\
|
|
41
42
|
\n\
|
|
42
43
|
#ifdef SPECULAR_IBL\n\
|
|
43
44
|
// Find the direction in which to sample the environment map\n\
|
|
44
|
-
vec3
|
|
45
|
-
vec3 iblColor = computeSpecularIBL(
|
|
45
|
+
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));\n\
|
|
46
|
+
vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);\n\
|
|
46
47
|
color += iblColor * material.occlusion;\n\
|
|
47
48
|
#elif defined(USE_IBL_LIGHTING)\n\
|
|
48
49
|
vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));\n\
|
|
49
|
-
vec3 reflectionWC = normalize(czm_inverseViewRotation *
|
|
50
|
+
vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirection, normal));\n\
|
|
50
51
|
vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);\n\
|
|
51
52
|
\n\
|
|
52
53
|
vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);\n\
|
|
@@ -58,7 +59,7 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
|
|
|
58
59
|
#endif\n\
|
|
59
60
|
float maximumComponent = czm_maximumComponent(lightColorHdr);\n\
|
|
60
61
|
vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);\n\
|
|
61
|
-
color += clampedLightColor* iblColor * material.occlusion;\n\
|
|
62
|
+
color += clampedLightColor * iblColor * material.occlusion;\n\
|
|
62
63
|
#endif\n\
|
|
63
64
|
\n\
|
|
64
65
|
float clearcoatFactor = material.clearcoatFactor;\n\
|
|
@@ -120,7 +121,7 @@ void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
120
121
|
// tonemapping. However, if HDR is not enabled, we must tonemap else large\n\
|
|
121
122
|
// values may be clamped to 1.0\n\
|
|
122
123
|
#ifndef HDR\n\
|
|
123
|
-
color =
|
|
124
|
+
color = czm_pbrNeutralTonemapping(color);\n\
|
|
124
125
|
#endif\n\
|
|
125
126
|
#else // unlit\n\
|
|
126
127
|
vec3 color = material.diffuse;\n\
|
|
@@ -258,8 +258,7 @@ void setSpecularGlossiness(inout czm_modelMaterial material)
|
|
|
258
258
|
material.specular = specular;
|
|
259
259
|
|
|
260
260
|
// glossiness is the opposite of roughness, but easier for artists to use.
|
|
261
|
-
|
|
262
|
-
material.roughness = roughness * roughness;
|
|
261
|
+
material.roughness = 1.0 - glossiness;
|
|
263
262
|
}
|
|
264
263
|
#elif defined(LIGHTING_PBR)
|
|
265
264
|
float setMetallicRoughness(inout czm_modelMaterial material)
|
|
@@ -272,7 +271,7 @@ float setMetallicRoughness(inout czm_modelMaterial material)
|
|
|
272
271
|
|
|
273
272
|
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
|
|
274
273
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
|
|
275
|
-
float roughness = clamp(metallicRoughness.g, 0.
|
|
274
|
+
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
|
|
276
275
|
#ifdef HAS_METALLIC_FACTOR
|
|
277
276
|
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
|
|
278
277
|
#endif
|
|
@@ -288,7 +287,7 @@ float setMetallicRoughness(inout czm_modelMaterial material)
|
|
|
288
287
|
#endif
|
|
289
288
|
|
|
290
289
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
291
|
-
float roughness = clamp(u_roughnessFactor, 0.
|
|
290
|
+
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
|
|
292
291
|
#else
|
|
293
292
|
float roughness = 1.0;
|
|
294
293
|
#endif
|
|
@@ -303,9 +302,8 @@ float setMetallicRoughness(inout czm_modelMaterial material)
|
|
|
303
302
|
// diffuse only applies to dielectrics.
|
|
304
303
|
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
|
|
305
304
|
|
|
306
|
-
// roughness is
|
|
307
|
-
|
|
308
|
-
material.roughness = roughness * roughness;
|
|
305
|
+
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
306
|
+
material.roughness = roughness;
|
|
309
307
|
|
|
310
308
|
return metalness;
|
|
311
309
|
}
|
|
@@ -418,9 +416,8 @@ void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attri
|
|
|
418
416
|
#endif
|
|
419
417
|
|
|
420
418
|
material.clearcoatFactor = clearcoatFactor;
|
|
421
|
-
// roughness is
|
|
422
|
-
|
|
423
|
-
material.clearcoatRoughness = clearcoatRoughness * clearcoatRoughness;
|
|
419
|
+
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
420
|
+
material.clearcoatRoughness = clearcoatRoughness;
|
|
424
421
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
425
422
|
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
|
|
426
423
|
#else
|
|
@@ -458,14 +455,13 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
458
455
|
baseColorWithAlpha *= color;
|
|
459
456
|
#endif
|
|
460
457
|
|
|
458
|
+
#ifdef USE_CPU_STYLING
|
|
459
|
+
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
|
|
460
|
+
#endif
|
|
461
461
|
material.baseColor = baseColorWithAlpha;
|
|
462
462
|
material.diffuse = baseColorWithAlpha.rgb;
|
|
463
463
|
material.alpha = baseColorWithAlpha.a;
|
|
464
464
|
|
|
465
|
-
#ifdef USE_CPU_STYLING
|
|
466
|
-
material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);
|
|
467
|
-
#endif
|
|
468
|
-
|
|
469
465
|
#ifdef HAS_OCCLUSION_TEXTURE
|
|
470
466
|
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
|
|
471
467
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
|
|
@@ -259,8 +259,7 @@ void setSpecularGlossiness(inout czm_modelMaterial material)\n\
|
|
|
259
259
|
material.specular = specular;\n\
|
|
260
260
|
\n\
|
|
261
261
|
// glossiness is the opposite of roughness, but easier for artists to use.\n\
|
|
262
|
-
|
|
263
|
-
material.roughness = roughness * roughness;\n\
|
|
262
|
+
material.roughness = 1.0 - glossiness;\n\
|
|
264
263
|
}\n\
|
|
265
264
|
#elif defined(LIGHTING_PBR)\n\
|
|
266
265
|
float setMetallicRoughness(inout czm_modelMaterial material)\n\
|
|
@@ -273,7 +272,7 @@ float setMetallicRoughness(inout czm_modelMaterial material)\n\
|
|
|
273
272
|
\n\
|
|
274
273
|
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n\
|
|
275
274
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n\
|
|
276
|
-
float roughness = clamp(metallicRoughness.g, 0.
|
|
275
|
+
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);\n\
|
|
277
276
|
#ifdef HAS_METALLIC_FACTOR\n\
|
|
278
277
|
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);\n\
|
|
279
278
|
#endif\n\
|
|
@@ -289,7 +288,7 @@ float setMetallicRoughness(inout czm_modelMaterial material)\n\
|
|
|
289
288
|
#endif\n\
|
|
290
289
|
\n\
|
|
291
290
|
#ifdef HAS_ROUGHNESS_FACTOR\n\
|
|
292
|
-
float roughness = clamp(u_roughnessFactor, 0.
|
|
291
|
+
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);\n\
|
|
293
292
|
#else\n\
|
|
294
293
|
float roughness = 1.0;\n\
|
|
295
294
|
#endif\n\
|
|
@@ -304,9 +303,8 @@ float setMetallicRoughness(inout czm_modelMaterial material)\n\
|
|
|
304
303
|
// diffuse only applies to dielectrics.\n\
|
|
305
304
|
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);\n\
|
|
306
305
|
\n\
|
|
307
|
-
// roughness is
|
|
308
|
-
|
|
309
|
-
material.roughness = roughness * roughness;\n\
|
|
306
|
+
// This is perceptual roughness. The square of this value is used for direct lighting\n\
|
|
307
|
+
material.roughness = roughness;\n\
|
|
310
308
|
\n\
|
|
311
309
|
return metalness;\n\
|
|
312
310
|
}\n\
|
|
@@ -419,9 +417,8 @@ void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attri
|
|
|
419
417
|
#endif\n\
|
|
420
418
|
\n\
|
|
421
419
|
material.clearcoatFactor = clearcoatFactor;\n\
|
|
422
|
-
// roughness is
|
|
423
|
-
|
|
424
|
-
material.clearcoatRoughness = clearcoatRoughness * clearcoatRoughness;\n\
|
|
420
|
+
// This is perceptual roughness. The square of this value is used for direct lighting\n\
|
|
421
|
+
material.clearcoatRoughness = clearcoatRoughness;\n\
|
|
425
422
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE\n\
|
|
426
423
|
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);\n\
|
|
427
424
|
#else\n\
|
|
@@ -459,13 +456,12 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
459
456
|
baseColorWithAlpha *= color;\n\
|
|
460
457
|
#endif\n\
|
|
461
458
|
\n\
|
|
459
|
+
#ifdef USE_CPU_STYLING\n\
|
|
460
|
+
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);\n\
|
|
461
|
+
#endif\n\
|
|
462
462
|
material.baseColor = baseColorWithAlpha;\n\
|
|
463
463
|
material.diffuse = baseColorWithAlpha.rgb;\n\
|
|
464
464
|
material.alpha = baseColorWithAlpha.a;\n\
|
|
465
|
-
\n\
|
|
466
|
-
#ifdef USE_CPU_STYLING\n\
|
|
467
|
-
material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\n\
|
|
468
|
-
#endif\n\
|
|
469
465
|
\n\
|
|
470
466
|
#ifdef HAS_OCCLUSION_TEXTURE\n\
|
|
471
467
|
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\n\
|
|
@@ -3,9 +3,13 @@ in vec4 v_outlineColor;
|
|
|
3
3
|
in float v_innerPercent;
|
|
4
4
|
in float v_pixelDistance;
|
|
5
5
|
in vec4 v_pickColor;
|
|
6
|
+
in float v_splitDirection;
|
|
6
7
|
|
|
7
8
|
void main()
|
|
8
9
|
{
|
|
10
|
+
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
11
|
+
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
12
|
+
|
|
9
13
|
// The distance in UV space from this fragment to the center of the point, at most 0.5.
|
|
10
14
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
11
15
|
// The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
|
|
@@ -4,9 +4,13 @@ in vec4 v_outlineColor;\n\
|
|
|
4
4
|
in float v_innerPercent;\n\
|
|
5
5
|
in float v_pixelDistance;\n\
|
|
6
6
|
in vec4 v_pickColor;\n\
|
|
7
|
+
in float v_splitDirection;\n\
|
|
7
8
|
\n\
|
|
8
9
|
void main()\n\
|
|
9
10
|
{\n\
|
|
11
|
+
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\n\
|
|
12
|
+
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\n\
|
|
13
|
+
\n\
|
|
10
14
|
// The distance in UV space from this fragment to the center of the point, at most 0.5.\n\
|
|
11
15
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n\
|
|
12
16
|
// The max distance stops one pixel shy of the edge to leave space for anti-aliasing.\n\
|
|
@@ -2,16 +2,17 @@ uniform float u_maxTotalPointSize;
|
|
|
2
2
|
|
|
3
3
|
in vec4 positionHighAndSize;
|
|
4
4
|
in vec4 positionLowAndOutline;
|
|
5
|
-
in vec4 compressedAttribute0;
|
|
6
|
-
in vec4 compressedAttribute1;
|
|
7
|
-
in vec4 scaleByDistance;
|
|
8
|
-
in
|
|
5
|
+
in vec4 compressedAttribute0; // color, outlineColor, pick color
|
|
6
|
+
in vec4 compressedAttribute1; // show, translucency by distance, some free space
|
|
7
|
+
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
8
|
+
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
|
|
9
9
|
|
|
10
10
|
out vec4 v_color;
|
|
11
11
|
out vec4 v_outlineColor;
|
|
12
12
|
out float v_innerPercent;
|
|
13
13
|
out float v_pixelDistance;
|
|
14
14
|
out vec4 v_pickColor;
|
|
15
|
+
out float v_splitDirection;
|
|
15
16
|
|
|
16
17
|
const float SHIFT_LEFT8 = 256.0;
|
|
17
18
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
@@ -135,8 +136,8 @@ void main()
|
|
|
135
136
|
#endif
|
|
136
137
|
|
|
137
138
|
#ifdef DISTANCE_DISPLAY_CONDITION
|
|
138
|
-
float nearSq =
|
|
139
|
-
float farSq =
|
|
139
|
+
float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
|
|
140
|
+
float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
|
|
140
141
|
if (lengthSq < nearSq || lengthSq > farSq) {
|
|
141
142
|
// push vertex behind camera to force it to be clipped
|
|
142
143
|
positionEC.xyz = vec3(0.0, 0.0, 1.0);
|
|
@@ -147,7 +148,7 @@ void main()
|
|
|
147
148
|
czm_vertexLogDepth();
|
|
148
149
|
|
|
149
150
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
150
|
-
float disableDepthTestDistance =
|
|
151
|
+
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
|
|
151
152
|
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
152
153
|
{
|
|
153
154
|
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
|
|
@@ -180,4 +181,5 @@ void main()
|
|
|
180
181
|
gl_Position *= show;
|
|
181
182
|
|
|
182
183
|
v_pickColor = pickColor;
|
|
184
|
+
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
|
|
183
185
|
}
|
|
@@ -3,16 +3,17 @@ export default "uniform float u_maxTotalPointSize;\n\
|
|
|
3
3
|
\n\
|
|
4
4
|
in vec4 positionHighAndSize;\n\
|
|
5
5
|
in vec4 positionLowAndOutline;\n\
|
|
6
|
-
in vec4 compressedAttribute0;
|
|
7
|
-
in vec4 compressedAttribute1;
|
|
8
|
-
in vec4 scaleByDistance;
|
|
9
|
-
in
|
|
6
|
+
in vec4 compressedAttribute0; // color, outlineColor, pick color\n\
|
|
7
|
+
in vec4 compressedAttribute1; // show, translucency by distance, some free space\n\
|
|
8
|
+
in vec4 scaleByDistance; // near, nearScale, far, farScale\n\
|
|
9
|
+
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection\n\
|
|
10
10
|
\n\
|
|
11
11
|
out vec4 v_color;\n\
|
|
12
12
|
out vec4 v_outlineColor;\n\
|
|
13
13
|
out float v_innerPercent;\n\
|
|
14
14
|
out float v_pixelDistance;\n\
|
|
15
15
|
out vec4 v_pickColor;\n\
|
|
16
|
+
out float v_splitDirection;\n\
|
|
16
17
|
\n\
|
|
17
18
|
const float SHIFT_LEFT8 = 256.0;\n\
|
|
18
19
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;\n\
|
|
@@ -136,8 +137,8 @@ void main()\n\
|
|
|
136
137
|
#endif\n\
|
|
137
138
|
\n\
|
|
138
139
|
#ifdef DISTANCE_DISPLAY_CONDITION\n\
|
|
139
|
-
float nearSq =
|
|
140
|
-
float farSq =
|
|
140
|
+
float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;\n\
|
|
141
|
+
float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;\n\
|
|
141
142
|
if (lengthSq < nearSq || lengthSq > farSq) {\n\
|
|
142
143
|
// push vertex behind camera to force it to be clipped\n\
|
|
143
144
|
positionEC.xyz = vec3(0.0, 0.0, 1.0);\n\
|
|
@@ -148,7 +149,7 @@ void main()\n\
|
|
|
148
149
|
czm_vertexLogDepth();\n\
|
|
149
150
|
\n\
|
|
150
151
|
#ifdef DISABLE_DEPTH_DISTANCE\n\
|
|
151
|
-
float disableDepthTestDistance =
|
|
152
|
+
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;\n\
|
|
152
153
|
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n\
|
|
153
154
|
{\n\
|
|
154
155
|
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n\
|
|
@@ -181,5 +182,6 @@ void main()\n\
|
|
|
181
182
|
gl_Position *= show;\n\
|
|
182
183
|
\n\
|
|
183
184
|
v_pickColor = pickColor;\n\
|
|
185
|
+
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;\n\
|
|
184
186
|
}\n\
|
|
185
187
|
";
|
|
@@ -4,6 +4,8 @@ in vec2 v_textureCoordinates;
|
|
|
4
4
|
|
|
5
5
|
#ifdef AUTO_EXPOSURE
|
|
6
6
|
uniform sampler2D autoExposure;
|
|
7
|
+
#else
|
|
8
|
+
uniform float exposure;
|
|
7
9
|
#endif
|
|
8
10
|
|
|
9
11
|
void main()
|
|
@@ -13,6 +15,8 @@ void main()
|
|
|
13
15
|
|
|
14
16
|
#ifdef AUTO_EXPOSURE
|
|
15
17
|
color /= texture(autoExposure, vec2(0.5)).r;
|
|
18
|
+
#else
|
|
19
|
+
color *= vec3(exposure);
|
|
16
20
|
#endif
|
|
17
21
|
color = czm_acesTonemapping(color);
|
|
18
22
|
color = czm_inverseGamma(color);
|
|
@@ -5,6 +5,8 @@ in vec2 v_textureCoordinates;\n\
|
|
|
5
5
|
\n\
|
|
6
6
|
#ifdef AUTO_EXPOSURE\n\
|
|
7
7
|
uniform sampler2D autoExposure;\n\
|
|
8
|
+
#else\n\
|
|
9
|
+
uniform float exposure;\n\
|
|
8
10
|
#endif\n\
|
|
9
11
|
\n\
|
|
10
12
|
void main()\n\
|
|
@@ -14,6 +16,8 @@ void main()\n\
|
|
|
14
16
|
\n\
|
|
15
17
|
#ifdef AUTO_EXPOSURE\n\
|
|
16
18
|
color /= texture(autoExposure, vec2(0.5)).r;\n\
|
|
19
|
+
#else\n\
|
|
20
|
+
color *= vec3(exposure);\n\
|
|
17
21
|
#endif\n\
|
|
18
22
|
color = czm_acesTonemapping(color);\n\
|
|
19
23
|
color = czm_inverseGamma(color);\n\
|
|
@@ -4,6 +4,8 @@ in vec2 v_textureCoordinates;
|
|
|
4
4
|
|
|
5
5
|
#ifdef AUTO_EXPOSURE
|
|
6
6
|
uniform sampler2D autoExposure;
|
|
7
|
+
#else
|
|
8
|
+
uniform float exposure;
|
|
7
9
|
#endif
|
|
8
10
|
|
|
9
11
|
// See slides 142 and 143:
|
|
@@ -17,6 +19,8 @@ void main()
|
|
|
17
19
|
#ifdef AUTO_EXPOSURE
|
|
18
20
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
19
21
|
color /= exposure;
|
|
22
|
+
#else
|
|
23
|
+
color *= vec3(exposure);
|
|
20
24
|
#endif
|
|
21
25
|
|
|
22
26
|
const float A = 0.22; // shoulder strength
|
|
@@ -5,6 +5,8 @@ in vec2 v_textureCoordinates;\n\
|
|
|
5
5
|
\n\
|
|
6
6
|
#ifdef AUTO_EXPOSURE\n\
|
|
7
7
|
uniform sampler2D autoExposure;\n\
|
|
8
|
+
#else\n\
|
|
9
|
+
uniform float exposure;\n\
|
|
8
10
|
#endif\n\
|
|
9
11
|
\n\
|
|
10
12
|
// See slides 142 and 143:\n\
|
|
@@ -18,6 +20,8 @@ void main()\n\
|
|
|
18
20
|
#ifdef AUTO_EXPOSURE\n\
|
|
19
21
|
float exposure = texture(autoExposure, vec2(0.5)).r;\n\
|
|
20
22
|
color /= exposure;\n\
|
|
23
|
+
#else\n\
|
|
24
|
+
color *= vec3(exposure);\n\
|
|
21
25
|
#endif\n\
|
|
22
26
|
\n\
|
|
23
27
|
const float A = 0.22; // shoulder strength\n\
|
|
@@ -5,6 +5,8 @@ in vec2 v_textureCoordinates;
|
|
|
5
5
|
|
|
6
6
|
#ifdef AUTO_EXPOSURE
|
|
7
7
|
uniform sampler2D autoExposure;
|
|
8
|
+
#else
|
|
9
|
+
uniform float exposure;
|
|
8
10
|
#endif
|
|
9
11
|
|
|
10
12
|
// See equation 4:
|
|
@@ -17,6 +19,8 @@ void main()
|
|
|
17
19
|
#ifdef AUTO_EXPOSURE
|
|
18
20
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
19
21
|
color /= exposure;
|
|
22
|
+
#else
|
|
23
|
+
color *= vec3(exposure);
|
|
20
24
|
#endif
|
|
21
25
|
color = (color * (1.0 + color / white)) / (1.0 + color);
|
|
22
26
|
color = czm_inverseGamma(color);
|
|
@@ -6,6 +6,8 @@ in vec2 v_textureCoordinates;\n\
|
|
|
6
6
|
\n\
|
|
7
7
|
#ifdef AUTO_EXPOSURE\n\
|
|
8
8
|
uniform sampler2D autoExposure;\n\
|
|
9
|
+
#else\n\
|
|
10
|
+
uniform float exposure;\n\
|
|
9
11
|
#endif\n\
|
|
10
12
|
\n\
|
|
11
13
|
// See equation 4:\n\
|
|
@@ -18,6 +20,8 @@ void main()\n\
|
|
|
18
20
|
#ifdef AUTO_EXPOSURE\n\
|
|
19
21
|
float exposure = texture(autoExposure, vec2(0.5)).r;\n\
|
|
20
22
|
color /= exposure;\n\
|
|
23
|
+
#else\n\
|
|
24
|
+
color *= vec3(exposure);\n\
|
|
21
25
|
#endif\n\
|
|
22
26
|
color = (color * (1.0 + color / white)) / (1.0 + color);\n\
|
|
23
27
|
color = czm_inverseGamma(color);\n\
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
uniform sampler2D colorTexture;
|
|
2
|
+
|
|
3
|
+
in vec2 v_textureCoordinates;
|
|
4
|
+
|
|
5
|
+
#ifdef AUTO_EXPOSURE
|
|
6
|
+
uniform sampler2D autoExposure;
|
|
7
|
+
#else
|
|
8
|
+
uniform float exposure;
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
void main()
|
|
12
|
+
{
|
|
13
|
+
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
|
|
14
|
+
vec3 color = fragmentColor.rgb;
|
|
15
|
+
|
|
16
|
+
#ifdef AUTO_EXPOSURE
|
|
17
|
+
color /= texture(autoExposure, vec2(0.5)).r;
|
|
18
|
+
#else
|
|
19
|
+
color *= vec3(exposure);
|
|
20
|
+
#endif
|
|
21
|
+
color = czm_pbrNeutralTonemapping(color);
|
|
22
|
+
color = czm_inverseGamma(color);
|
|
23
|
+
|
|
24
|
+
out_FragColor = vec4(color, fragmentColor.a);
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "uniform sampler2D colorTexture;\n\
|
|
3
|
+
\n\
|
|
4
|
+
in vec2 v_textureCoordinates;\n\
|
|
5
|
+
\n\
|
|
6
|
+
#ifdef AUTO_EXPOSURE\n\
|
|
7
|
+
uniform sampler2D autoExposure;\n\
|
|
8
|
+
#else\n\
|
|
9
|
+
uniform float exposure;\n\
|
|
10
|
+
#endif\n\
|
|
11
|
+
\n\
|
|
12
|
+
void main()\n\
|
|
13
|
+
{\n\
|
|
14
|
+
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\n\
|
|
15
|
+
vec3 color = fragmentColor.rgb;\n\
|
|
16
|
+
\n\
|
|
17
|
+
#ifdef AUTO_EXPOSURE\n\
|
|
18
|
+
color /= texture(autoExposure, vec2(0.5)).r;\n\
|
|
19
|
+
#else\n\
|
|
20
|
+
color *= vec3(exposure);\n\
|
|
21
|
+
#endif\n\
|
|
22
|
+
color = czm_pbrNeutralTonemapping(color);\n\
|
|
23
|
+
color = czm_inverseGamma(color);\n\
|
|
24
|
+
\n\
|
|
25
|
+
out_FragColor = vec4(color, fragmentColor.a);\n\
|
|
26
|
+
}\n\
|
|
27
|
+
";
|
|
@@ -4,6 +4,8 @@ in vec2 v_textureCoordinates;
|
|
|
4
4
|
|
|
5
5
|
#ifdef AUTO_EXPOSURE
|
|
6
6
|
uniform sampler2D autoExposure;
|
|
7
|
+
#else
|
|
8
|
+
uniform float exposure;
|
|
7
9
|
#endif
|
|
8
10
|
|
|
9
11
|
// See equation 3:
|
|
@@ -16,6 +18,8 @@ void main()
|
|
|
16
18
|
#ifdef AUTO_EXPOSURE
|
|
17
19
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
18
20
|
color /= exposure;
|
|
21
|
+
#else
|
|
22
|
+
color *= vec3(exposure);
|
|
19
23
|
#endif
|
|
20
24
|
color = color / (1.0 + color);
|
|
21
25
|
color = czm_inverseGamma(color);
|
|
@@ -5,6 +5,8 @@ in vec2 v_textureCoordinates;\n\
|
|
|
5
5
|
\n\
|
|
6
6
|
#ifdef AUTO_EXPOSURE\n\
|
|
7
7
|
uniform sampler2D autoExposure;\n\
|
|
8
|
+
#else\n\
|
|
9
|
+
uniform float exposure;\n\
|
|
8
10
|
#endif\n\
|
|
9
11
|
\n\
|
|
10
12
|
// See equation 3:\n\
|
|
@@ -17,6 +19,8 @@ void main()\n\
|
|
|
17
19
|
#ifdef AUTO_EXPOSURE\n\
|
|
18
20
|
float exposure = texture(autoExposure, vec2(0.5)).r;\n\
|
|
19
21
|
color /= exposure;\n\
|
|
22
|
+
#else\n\
|
|
23
|
+
color *= vec3(exposure);\n\
|
|
20
24
|
#endif\n\
|
|
21
25
|
color = color / (1.0 + color);\n\
|
|
22
26
|
color = czm_inverseGamma(color);\n\
|
|
@@ -38,7 +38,7 @@ void main (void)
|
|
|
38
38
|
vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
|
|
39
39
|
|
|
40
40
|
#ifndef HDR
|
|
41
|
-
color.rgb =
|
|
41
|
+
color.rgb = czm_pbrNeutralTonemapping(color.rgb);
|
|
42
42
|
color.rgb = czm_inverseGamma(color.rgb);
|
|
43
43
|
#endif
|
|
44
44
|
|
|
@@ -39,7 +39,7 @@ void main (void)\n\
|
|
|
39
39
|
vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\n\
|
|
40
40
|
\n\
|
|
41
41
|
#ifndef HDR\n\
|
|
42
|
-
color.rgb =
|
|
42
|
+
color.rgb = czm_pbrNeutralTonemapping(color.rgb);\n\
|
|
43
43
|
color.rgb = czm_inverseGamma(color.rgb);\n\
|
|
44
44
|
#endif\n\
|
|
45
45
|
\n\
|
|
@@ -143,7 +143,7 @@ function configureCameraFrustum(widget) {
|
|
|
143
143
|
* @param {boolean} [options.blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.
|
|
144
144
|
* @param {boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
145
145
|
* @param {number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
146
|
-
* @param {number} [options.msaaSamples=
|
|
146
|
+
* @param {number} [options.msaaSamples=4] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets. Set to 1 to disable MSAA.
|
|
147
147
|
*
|
|
148
148
|
* @exception {DeveloperError} Element with id "container" does not exist in the document.
|
|
149
149
|
*
|