@cesium/engine 11.1.0 → 12.0.1

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.
Files changed (159) hide show
  1. package/Build/Workers/{chunk-U72QNFOJ.js → chunk-22FZ334F.js} +10 -10
  2. package/Build/Workers/{chunk-GNBFYG7F.js → chunk-2F42VIW6.js} +13 -13
  3. package/Build/Workers/{chunk-K4GQUNB5.js → chunk-2IJZVFHY.js} +5 -5
  4. package/Build/Workers/{chunk-7KTQP4VB.js → chunk-2XOUWNPN.js} +5 -5
  5. package/Build/Workers/{chunk-IBLIYJZR.js → chunk-3Y4UGAYI.js} +6 -6
  6. package/Build/Workers/{chunk-VJZB3WAV.js → chunk-54NYY4U4.js} +7 -7
  7. package/Build/Workers/{chunk-DHYHSFFJ.js → chunk-647NL6VU.js} +2 -2
  8. package/Build/Workers/{chunk-CKY7HOHV.js → chunk-76KRKKEF.js} +9 -9
  9. package/Build/Workers/{chunk-BHQJ2NT7.js → chunk-7CKQ7PVJ.js} +6 -6
  10. package/Build/Workers/{chunk-5PTXS2GO.js → chunk-7D6T2WYT.js} +7 -7
  11. package/Build/Workers/{chunk-PRGYLLJT.js → chunk-7EBHNJTG.js} +1 -1
  12. package/Build/Workers/{chunk-YFXQECWV.js → chunk-AER5CLXD.js} +5 -5
  13. package/Build/Workers/{chunk-N5KJGGCM.js → chunk-AGYO4ZSF.js} +17 -17
  14. package/Build/Workers/{chunk-VU2MNO7L.js → chunk-BH5M522L.js} +7 -7
  15. package/Build/Workers/{chunk-MXIZJAPH.js → chunk-COHL4R3G.js} +1 -1
  16. package/Build/Workers/{chunk-FIGIZHAQ.js → chunk-DJ7K7EYK.js} +11 -11
  17. package/Build/Workers/{chunk-3Q2L65QU.js → chunk-DR56WFYZ.js} +7 -7
  18. package/Build/Workers/{chunk-AD63PIY6.js → chunk-EMCXAVSG.js} +2 -2
  19. package/Build/Workers/{chunk-YSGTGQQO.js → chunk-ENARO52I.js} +14 -14
  20. package/Build/Workers/{chunk-5OOFQLKF.js → chunk-ETXXXGMP.js} +7 -7
  21. package/Build/Workers/{chunk-E27BLMDD.js → chunk-GBPW65E3.js} +6 -6
  22. package/Build/Workers/{chunk-NGPPMXRM.js → chunk-GRQQHWMD.js} +7 -7
  23. package/Build/Workers/{chunk-SMDOP47J.js → chunk-GSJ6LWIS.js} +10 -10
  24. package/Build/Workers/{chunk-26GA3JAM.js → chunk-H3RMGG7L.js} +5 -5
  25. package/Build/Workers/{chunk-PGRPDNHG.js → chunk-IAX6MIST.js} +17 -17
  26. package/Build/Workers/{chunk-5ODQSF26.js → chunk-IJWXYSFC.js} +2 -2
  27. package/Build/Workers/{chunk-C6YYBQXW.js → chunk-IVCFTVYW.js} +4 -4
  28. package/Build/Workers/{chunk-JW4FOI6M.js → chunk-JAKTB6CE.js} +11 -11
  29. package/Build/Workers/{chunk-TKVT5GQM.js → chunk-JPNFQRN7.js} +13 -13
  30. package/Build/Workers/{chunk-E63IIM5T.js → chunk-K7QC3WDT.js} +1 -1
  31. package/Build/Workers/{chunk-TGONEMZO.js → chunk-KJ65M35B.js} +11 -11
  32. package/Build/Workers/{chunk-2ZGOQXYU.js → chunk-KKMH4BKN.js} +6 -6
  33. package/Build/Workers/{chunk-76BYBWHP.js → chunk-LBNGHEJY.js} +4 -4
  34. package/Build/Workers/{chunk-XY4BATBS.js → chunk-LVHHB5T6.js} +4 -4
  35. package/Build/Workers/{chunk-S6MRMMQU.js → chunk-MV7YO647.js} +6 -6
  36. package/Build/Workers/{chunk-6CHGCNMW.js → chunk-NELAPOO6.js} +2 -2
  37. package/Build/Workers/{chunk-GESF4OXQ.js → chunk-NL73INJS.js} +2 -2
  38. package/Build/Workers/{chunk-GGZJN2TI.js → chunk-PH3T7LNP.js} +15 -15
  39. package/Build/Workers/{chunk-YZ733KKS.js → chunk-PISTPJXS.js} +12 -12
  40. package/Build/Workers/{chunk-GWCFU2SA.js → chunk-PJHRB4YJ.js} +7 -7
  41. package/Build/Workers/{chunk-I2ITFFPX.js → chunk-PNA47CR7.js} +1 -1
  42. package/Build/Workers/{chunk-7JO7GPJN.js → chunk-Q7IIOKAT.js} +1 -1
  43. package/Build/Workers/{chunk-27HUZ7SA.js → chunk-U7SH6OK7.js} +4 -4
  44. package/Build/Workers/{chunk-M3GMB5OP.js → chunk-VHGI7D3P.js} +10 -10
  45. package/Build/Workers/{chunk-FDOV2LBJ.js → chunk-VO4SXJXT.js} +7 -7
  46. package/Build/Workers/{chunk-7BMOHCPM.js → chunk-VXVQITFC.js} +13 -13
  47. package/Build/Workers/{chunk-DI5NGJUP.js → chunk-WMHJAREU.js} +2 -2
  48. package/Build/Workers/{chunk-EJZTDTUH.js → chunk-X6YBZOOA.js} +4 -4
  49. package/Build/Workers/{chunk-472HQ3EH.js → chunk-XDJ7V4NZ.js} +5 -5
  50. package/Build/Workers/{chunk-E6V6SQZW.js → chunk-YT5PQMSP.js} +6 -6
  51. package/Build/Workers/{chunk-O3E4OAOE.js → chunk-ZCCI55EY.js} +13 -13
  52. package/Build/Workers/{chunk-7O373FFS.js → chunk-ZPTNVB3S.js} +8 -8
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +24 -24
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +27 -27
  61. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +30 -30
  75. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  76. package/Build/Workers/createPolylineGeometry.js +23 -23
  77. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  79. package/Build/Workers/createRectangleGeometry.js +25 -25
  80. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  81. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +20 -20
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +22 -22
  94. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  95. package/Build/Workers/decodeDraco.js +11 -11
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +7 -7
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Core/BoundingSphere.js +1 -1
  102. package/Source/Core/Color.js +1 -1
  103. package/Source/Core/CorridorGeometryLibrary.js +4 -4
  104. package/Source/Core/EllipseGeometry.js +1 -1
  105. package/Source/Core/EllipsoidGeodesic.js +1 -1
  106. package/Source/Core/FrustumGeometry.js +1 -1
  107. package/Source/Core/Ion.js +1 -1
  108. package/Source/Core/Math.js +2 -0
  109. package/Source/Core/PolylineVolumeGeometryLibrary.js +2 -2
  110. package/Source/Core/decodeGoogleEarthEnterpriseData.js +1 -1
  111. package/Source/DataSources/DataSourceDisplay.js +1 -1
  112. package/Source/DataSources/ModelGraphics.js +1 -0
  113. package/Source/Renderer/AutomaticUniforms.js +13 -0
  114. package/Source/Renderer/CubeMap.js +89 -12
  115. package/Source/Renderer/CubeMapFace.js +90 -13
  116. package/Source/Renderer/UniformState.js +13 -0
  117. package/Source/Scene/ArcGisMapService.js +1 -1
  118. package/Source/Scene/Atmosphere.js +22 -0
  119. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  120. package/Source/Scene/Cesium3DTileset.js +39 -0
  121. package/Source/Scene/DynamicEnvironmentMapManager.js +894 -0
  122. package/Source/Scene/Fog.js +75 -82
  123. package/Source/Scene/FrameState.js +5 -3
  124. package/Source/Scene/ImageBasedLighting.js +7 -64
  125. package/Source/Scene/Model/AtmospherePipelineStage.js +10 -5
  126. package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +43 -21
  127. package/Source/Scene/Model/Model.js +98 -25
  128. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  129. package/Source/Scene/Model/ModelSceneGraph.js +1 -0
  130. package/Source/Scene/ScreenSpaceCameraController.js +20 -1
  131. package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
  132. package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +44 -0
  133. package/Source/Shaders/Builtin/Functions/computeScattering.glsl +0 -1
  134. package/Source/Shaders/Builtin/Functions/computeScattering.js +0 -1
  135. package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +3 -1
  136. package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +3 -1
  137. package/Source/Shaders/ComputeIrradianceFS.glsl +103 -0
  138. package/Source/Shaders/ComputeIrradianceFS.js +105 -0
  139. package/Source/Shaders/ComputeRadianceMapFS.glsl +107 -0
  140. package/Source/Shaders/ComputeRadianceMapFS.js +109 -0
  141. package/Source/Shaders/ConvolveSpecularMapFS.glsl +70 -0
  142. package/Source/Shaders/ConvolveSpecularMapFS.js +72 -0
  143. package/Source/Shaders/ConvolveSpecularMapVS.glsl +24 -0
  144. package/Source/Shaders/ConvolveSpecularMapVS.js +26 -0
  145. package/Source/Shaders/GlobeFS.glsl +1 -2
  146. package/Source/Shaders/GlobeFS.js +1 -2
  147. package/Source/Shaders/Model/AtmosphereStageFS.glsl +1 -4
  148. package/Source/Shaders/Model/AtmosphereStageFS.js +1 -4
  149. package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +2 -155
  150. package/Source/Shaders/Model/ImageBasedLightingStageFS.js +3 -156
  151. package/Source/Shaders/Model/LightingStageFS.glsl +3 -22
  152. package/Source/Shaders/Model/LightingStageFS.js +3 -22
  153. package/Source/Shaders/SkyBoxVS.glsl +0 -1
  154. package/Source/Shaders/SkyBoxVS.js +0 -1
  155. package/Source/Widget/CesiumWidget.js +776 -1
  156. package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +1 -1
  157. package/index.d.ts +281 -12
  158. package/index.js +62 -57
  159. package/package.json +2 -2
@@ -1,158 +1,5 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "/**\n\
3
- * Compute some metrics for a procedural sky lighting model\n\
4
- *\n\
5
- * @param {vec3} positionWC The position of the fragment in world coordinates.\n\
6
- * @param {vec3} reflectionWC A unit vector in the direction of the reflection, in world coordinates.\n\
7
- * @return {vec3} The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n\
8
- */\n\
9
- vec3 getProceduralSkyMetrics(vec3 positionWC, vec3 reflectionWC)\n\
10
- {\n\
11
- // Figure out if the reflection vector hits the ellipsoid\n\
12
- float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / length(positionWC));\n\
13
- float reflectionDotNadir = dot(reflectionWC, normalize(positionWC));\n\
14
- float atmosphereHeight = 0.05;\n\
15
- float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n\
16
- return vec3(horizonDotNadir, reflectionDotNadir, smoothstepHeight);\n\
17
- }\n\
18
- \n\
19
- /**\n\
20
- * Compute the diffuse irradiance for a procedural sky lighting model.\n\
21
- *\n\
22
- * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n\
23
- * @return {vec3} The computed diffuse irradiance.\n\
24
- */\n\
25
- vec3 getProceduralDiffuseIrradiance(vec3 skyMetrics)\n\
26
- {\n\
27
- vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); \n\
28
- float diffuseIrradianceFromEarth = (1.0 - skyMetrics.x) * (skyMetrics.y * 0.25 + 0.75) * skyMetrics.z; \n\
29
- float diffuseIrradianceFromSky = (1.0 - skyMetrics.z) * (1.0 - (skyMetrics.y * 0.25 + 0.25));\n\
30
- return blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n\
31
- }\n\
32
- \n\
33
- /**\n\
34
- * Compute the specular irradiance for a procedural sky lighting model.\n\
35
- *\n\
36
- * @param {vec3} reflectionWC The reflection vector in world coordinates.\n\
37
- * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n\
38
- * @param {float} roughness The roughness of the material.\n\
39
- * @return {vec3} The computed specular irradiance.\n\
40
- */\n\
41
- vec3 getProceduralSpecularIrradiance(vec3 reflectionWC, vec3 skyMetrics, float roughness)\n\
42
- {\n\
43
- // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.\n\
44
- reflectionWC.x = -reflectionWC.x;\n\
45
- reflectionWC = -normalize(czm_temeToPseudoFixed * reflectionWC);\n\
46
- reflectionWC.x = -reflectionWC.x;\n\
47
- \n\
48
- float inverseRoughness = 1.0 - roughness;\n\
49
- inverseRoughness *= inverseRoughness;\n\
50
- vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, reflectionWC).rgb * inverseRoughness;\n\
51
- \n\
52
- // Compute colors at different angles relative to the horizon\n\
53
- vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), skyMetrics.z);\n\
54
- vec3 nadirColor = belowHorizonColor * 0.5;\n\
55
- vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n\
56
- vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, skyMetrics.y * inverseRoughness * 0.5 + 0.75);\n\
57
- vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, skyMetrics.z);\n\
58
- \n\
59
- // Compute blend zones\n\
60
- float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - skyMetrics.x);\n\
61
- float blendRegionOffset = roughness * -1.0;\n\
62
- float farAboveHorizon = clamp(skyMetrics.x - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n\
63
- float aroundHorizon = clamp(skyMetrics.x + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n\
64
- float farBelowHorizon = clamp(skyMetrics.x + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n\
65
- \n\
66
- // Blend colors\n\
67
- float notDistantRough = (1.0 - skyMetrics.x * roughness * 0.8);\n\
68
- vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, skyMetrics.y) * notDistantRough);\n\
69
- specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, skyMetrics.y) * inverseRoughness);\n\
70
- specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, skyMetrics.y) * inverseRoughness);\n\
71
- \n\
72
- return specularIrradiance;\n\
73
- }\n\
74
- \n\
75
- #ifdef USE_SUN_LUMINANCE\n\
76
- float clampedDot(vec3 x, vec3 y)\n\
77
- {\n\
78
- return clamp(dot(x, y), 0.001, 1.0);\n\
79
- }\n\
80
- /**\n\
81
- * Sun luminance following the \"CIE Clear Sky Model\"\n\
82
- * See page 40 of https://3dvar.com/Green2003Spherical.pdf\n\
83
- *\n\
84
- * @param {vec3} positionWC The position of the fragment in world coordinates.\n\
85
- * @param {vec3} normalEC The surface normal in eye coordinates.\n\
86
- * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n\
87
- * @return {float} The computed sun luminance.\n\
88
- */\n\
89
- float getSunLuminance(vec3 positionWC, vec3 normalEC, vec3 lightDirectionEC)\n\
90
- {\n\
91
- vec3 normalWC = normalize(czm_inverseViewRotation * normalEC);\n\
92
- vec3 lightDirectionWC = normalize(czm_inverseViewRotation * lightDirectionEC);\n\
93
- vec3 vWC = -normalize(positionWC);\n\
94
- \n\
95
- // Angle between sun and zenith.\n\
96
- float LdotZenith = clampedDot(lightDirectionWC, vWC);\n\
97
- float S = acos(LdotZenith);\n\
98
- // Angle between zenith and current pixel\n\
99
- float NdotZenith = clampedDot(normalWC, vWC);\n\
100
- // Angle between sun and current pixel\n\
101
- float NdotL = clampedDot(normalEC, lightDirectionEC);\n\
102
- float gamma = acos(NdotL);\n\
103
- \n\
104
- float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * NdotL * NdotL) * (1.0 - exp(-0.32 / NdotZenith)));\n\
105
- float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * LdotZenith * LdotZenith) * (1.0 - exp(-0.32));\n\
106
- return model_luminanceAtZenith * (numerator / denominator);\n\
107
- }\n\
108
- #endif\n\
109
- \n\
110
- /**\n\
111
- * Compute the light contribution from a procedural sky model\n\
112
- *\n\
113
- * @param {vec3} positionEC The position of the fragment in eye coordinates.\n\
114
- * @param {vec3} normalEC The surface normal in eye coordinates.\n\
115
- * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n\
116
- * @param {czm_modelMaterial} The material properties.\n\
117
- * @return {vec3} The computed HDR color\n\
118
- */\n\
119
- vec3 proceduralIBL(\n\
120
- vec3 positionEC,\n\
121
- vec3 normalEC,\n\
122
- vec3 lightDirectionEC,\n\
123
- czm_modelMaterial material\n\
124
- ) {\n\
125
- vec3 viewDirectionEC = -normalize(positionEC);\n\
126
- vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\n\
127
- vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirectionEC, normalEC));\n\
128
- vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);\n\
129
- \n\
130
- float roughness = material.roughness;\n\
131
- vec3 f0 = material.specular;\n\
132
- \n\
133
- vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);\n\
134
- float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001;\n\
135
- vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
136
- vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);\n\
137
- vec3 specularContribution = specularIrradiance * specularColor * model_iblFactor.y;\n\
138
- #ifdef USE_SPECULAR\n\
139
- specularContribution *= material.specularWeight;\n\
140
- #endif\n\
141
- \n\
142
- vec3 diffuseIrradiance = getProceduralDiffuseIrradiance(skyMetrics);\n\
143
- vec3 diffuseColor = material.diffuse;\n\
144
- vec3 diffuseContribution = diffuseIrradiance * diffuseColor * model_iblFactor.x;\n\
145
- \n\
146
- vec3 iblColor = specularContribution + diffuseContribution;\n\
147
- \n\
148
- #ifdef USE_SUN_LUMINANCE\n\
149
- iblColor *= getSunLuminance(positionWC, normalEC, lightDirectionEC);\n\
150
- #endif\n\
151
- \n\
152
- return iblColor;\n\
153
- }\n\
154
- \n\
155
- #ifdef DIFFUSE_IBL\n\
2
+ export default "#ifdef DIFFUSE_IBL\n\
156
3
  vec3 sampleDiffuseEnvironment(vec3 cubeDir)\n\
157
4
  {\n\
158
5
  #ifdef CUSTOM_SPHERICAL_HARMONICS\n\
@@ -224,7 +71,7 @@ vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material)
224
71
  float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);\n\
225
72
  vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);\n\
226
73
  vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;\n\
227
- vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering);\n\
74
+ vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;\n\
228
75
  #else\n\
229
76
  vec3 diffuseContribution = vec3(0.0);\n\
230
77
  #endif\n\
@@ -245,7 +92,7 @@ vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material)
245
92
  #ifdef SPECULAR_IBL\n\
246
93
  vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);\n\
247
94
  vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);\n\
248
- vec3 specularContribution = radiance * FssEss;\n\
95
+ vec3 specularContribution = radiance * FssEss * model_iblFactor.y;\n\
249
96
  #else\n\
250
97
  vec3 specularContribution = vec3(0.0);\n\
251
98
  #endif\n\
@@ -5,14 +5,10 @@ vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColor
5
5
  // Environment maps were provided, use them for IBL
6
6
  vec3 viewDirection = -normalize(position);
7
7
  vec3 iblColor = textureIBL(viewDirection, normal, material);
8
- #else
9
- // Use procedural IBL if there are no environment maps
10
- vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);
11
- float maximumComponent = czm_maximumComponent(lightColorHdr);
12
- vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);
13
- vec3 iblColor = clampedLightColor * imageBasedLighting;
8
+ return iblColor;
14
9
  #endif
15
- return iblColor * material.occlusion;
10
+
11
+ return vec3(0.0);
16
12
  }
17
13
  #endif
18
14
 
@@ -44,21 +40,6 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
44
40
  vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
45
41
  vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
46
42
  color += iblColor * material.occlusion;
47
- #elif defined(USE_IBL_LIGHTING)
48
- vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));
49
- vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirection, normal));
50
- vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);
51
-
52
- vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);
53
- vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
54
- vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);
55
- vec3 iblColor = specularIrradiance * specularColor * model_iblFactor.y;
56
- #ifdef USE_SUN_LUMINANCE
57
- iblColor *= getSunLuminance(positionWC, normal, lightDirection);
58
- #endif
59
- float maximumComponent = czm_maximumComponent(lightColorHdr);
60
- vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);
61
- color += clampedLightColor * iblColor * material.occlusion;
62
43
  #endif
63
44
 
64
45
  float clearcoatFactor = material.clearcoatFactor;
@@ -6,14 +6,10 @@ vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColor
6
6
  // Environment maps were provided, use them for IBL\n\
7
7
  vec3 viewDirection = -normalize(position);\n\
8
8
  vec3 iblColor = textureIBL(viewDirection, normal, material);\n\
9
- #else\n\
10
- // Use procedural IBL if there are no environment maps\n\
11
- vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);\n\
12
- float maximumComponent = czm_maximumComponent(lightColorHdr);\n\
13
- vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);\n\
14
- vec3 iblColor = clampedLightColor * imageBasedLighting;\n\
9
+ return iblColor;\n\
15
10
  #endif\n\
16
- return iblColor * material.occlusion;\n\
11
+ \n\
12
+ return vec3(0.0);\n\
17
13
  }\n\
18
14
  #endif\n\
19
15
  \n\
@@ -45,21 +41,6 @@ vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirect
45
41
  vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));\n\
46
42
  vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);\n\
47
43
  color += iblColor * material.occlusion;\n\
48
- #elif defined(USE_IBL_LIGHTING)\n\
49
- vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));\n\
50
- vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirection, normal));\n\
51
- vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);\n\
52
- \n\
53
- vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);\n\
54
- vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
55
- vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);\n\
56
- vec3 iblColor = specularIrradiance * specularColor * model_iblFactor.y;\n\
57
- #ifdef USE_SUN_LUMINANCE\n\
58
- iblColor *= getSunLuminance(positionWC, normal, lightDirection);\n\
59
- #endif\n\
60
- float maximumComponent = czm_maximumComponent(lightColorHdr);\n\
61
- vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);\n\
62
- color += clampedLightColor * iblColor * material.occlusion;\n\
63
44
  #endif\n\
64
45
  \n\
65
46
  float clearcoatFactor = material.clearcoatFactor;\n\
@@ -1,5 +1,4 @@
1
1
  in vec3 position;
2
-
3
2
  out vec3 v_texCoord;
4
3
 
5
4
  void main()
@@ -1,6 +1,5 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
2
  export default "in vec3 position;\n\
3
- \n\
4
3
  out vec3 v_texCoord;\n\
5
4
  \n\
6
5
  void main()\n\