@cesium/engine 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/Build/Workers/{AxisAlignedBoundingBox-a4321399.js → AxisAlignedBoundingBox-47525601.js} +1 -1
  2. package/Build/Workers/{BoundingRectangle-80d8801f.js → BoundingRectangle-93b263ac.js} +1 -1
  3. package/Build/Workers/{BoxGeometry-33c10a4f.js → BoxGeometry-8c4b4125.js} +1 -1
  4. package/Build/Workers/{Color-1bf9a6e0.js → Color-52c60ed7.js} +1 -1
  5. package/Build/Workers/{CoplanarPolygonGeometryLibrary-5c5b981b.js → CoplanarPolygonGeometryLibrary-33c4c1f8.js} +1 -1
  6. package/Build/Workers/{CorridorGeometryLibrary-7cbae7a0.js → CorridorGeometryLibrary-5039cd8e.js} +1 -1
  7. package/Build/Workers/{CylinderGeometry-42740df0.js → CylinderGeometry-3ac44974.js} +1 -1
  8. package/Build/Workers/{EllipseGeometry-49a3ac21.js → EllipseGeometry-a9c9b3be.js} +1 -1
  9. package/Build/Workers/{EllipseGeometryLibrary-b891b2f8.js → EllipseGeometryLibrary-855d4681.js} +1 -1
  10. package/Build/Workers/{EllipseOutlineGeometry-fbd72e07.js → EllipseOutlineGeometry-017a5929.js} +1 -1
  11. package/Build/Workers/{EllipsoidGeometry-a351dba8.js → EllipsoidGeometry-826e7bce.js} +1 -1
  12. package/Build/Workers/{EllipsoidOutlineGeometry-3e8779bf.js → EllipsoidOutlineGeometry-784dcdb5.js} +1 -1
  13. package/Build/Workers/{EllipsoidTangentPlane-cfb50678.js → EllipsoidTangentPlane-ed9443a1.js} +1 -1
  14. package/Build/Workers/{FrustumGeometry-c5754412.js → FrustumGeometry-9f1ee4d8.js} +1 -1
  15. package/Build/Workers/{GeometryAttribute-0bfd05e8.js → GeometryAttribute-334718f8.js} +1 -1
  16. package/Build/Workers/{GeometryPipeline-0166905d.js → GeometryPipeline-8fb0db69.js} +1 -1
  17. package/Build/Workers/{IntersectionTests-a93d3de9.js → IntersectionTests-27d49265.js} +1 -1
  18. package/Build/Workers/{OrientedBoundingBox-b450cb61.js → OrientedBoundingBox-79ee7cbb.js} +1 -1
  19. package/Build/Workers/{PolygonGeometryLibrary-f918ac26.js → PolygonGeometryLibrary-6b5a29e9.js} +1 -1
  20. package/Build/Workers/{PolygonPipeline-f59a8f0a.js → PolygonPipeline-21668b3f.js} +1 -1
  21. package/Build/Workers/{PolylinePipeline-d8e6bd9b.js → PolylinePipeline-5e2e1b21.js} +1 -1
  22. package/Build/Workers/{PolylineVolumeGeometryLibrary-125d2edf.js → PolylineVolumeGeometryLibrary-97f0b94e.js} +1 -1
  23. package/Build/Workers/{PrimitivePipeline-0d7b5ed4.js → PrimitivePipeline-5640850a.js} +1 -1
  24. package/Build/Workers/{RectangleGeometryLibrary-0768db63.js → RectangleGeometryLibrary-d5457f7b.js} +1 -1
  25. package/Build/Workers/{TerrainEncoding-06470d7f.js → TerrainEncoding-bfdf2021.js} +1 -1
  26. package/Build/Workers/{Transforms-26539bce.js → Transforms-a05e5e6e.js} +17 -0
  27. package/Build/Workers/{WallGeometryLibrary-6167b0fc.js → WallGeometryLibrary-6db0ebb6.js} +1 -1
  28. package/Build/Workers/cesiumWorkerBootstrapper.js +68 -2
  29. package/Build/Workers/combineGeometry.js +1 -1
  30. package/Build/Workers/createBoxGeometry.js +1 -1
  31. package/Build/Workers/createBoxOutlineGeometry.js +1 -1
  32. package/Build/Workers/createCircleGeometry.js +1 -1
  33. package/Build/Workers/createCircleOutlineGeometry.js +1 -1
  34. package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
  35. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
  36. package/Build/Workers/createCorridorGeometry.js +1 -1
  37. package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
  38. package/Build/Workers/createCylinderGeometry.js +1 -1
  39. package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
  40. package/Build/Workers/createEllipseGeometry.js +1 -1
  41. package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
  42. package/Build/Workers/createEllipsoidGeometry.js +1 -1
  43. package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
  44. package/Build/Workers/createFrustumGeometry.js +1 -1
  45. package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
  46. package/Build/Workers/createGeometry.js +1 -1
  47. package/Build/Workers/createGroundPolylineGeometry.js +1 -1
  48. package/Build/Workers/createPlaneGeometry.js +1 -1
  49. package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
  50. package/Build/Workers/createPolygonGeometry.js +1 -1
  51. package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
  52. package/Build/Workers/createPolylineGeometry.js +1 -1
  53. package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
  54. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
  55. package/Build/Workers/createRectangleGeometry.js +1 -1
  56. package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
  57. package/Build/Workers/createSimplePolylineGeometry.js +1 -1
  58. package/Build/Workers/createSphereGeometry.js +1 -1
  59. package/Build/Workers/createSphereOutlineGeometry.js +1 -1
  60. package/Build/Workers/createVectorTileGeometries.js +1 -1
  61. package/Build/Workers/createVectorTilePolygons.js +1 -1
  62. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
  63. package/Build/Workers/createVerticesFromHeightmap.js +1 -1
  64. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
  65. package/Build/Workers/createWallGeometry.js +1 -1
  66. package/Build/Workers/createWallOutlineGeometry.js +1 -1
  67. package/Build/Workers/decodeDraco.js +9 -1
  68. package/Build/Workers/package.js +1 -1
  69. package/Build/Workers/transcodeKTX2.js +22 -2
  70. package/Build/Workers/transferTypedArrayTest.js +1 -1
  71. package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
  72. package/README.md +14 -16
  73. package/Source/Core/FeatureDetection.js +18 -0
  74. package/Source/Core/Ion.js +1 -2
  75. package/Source/Core/PixelFormat.js +22 -2
  76. package/Source/Core/sampleTerrain.js +5 -0
  77. package/Source/Renderer/AutomaticUniforms.js +3 -3
  78. package/Source/Renderer/Context.js +4 -14
  79. package/Source/Renderer/ShaderBuilder.js +13 -12
  80. package/Source/Renderer/ShaderSource.js +31 -26
  81. package/Source/Renderer/demodernizeShader.js +76 -0
  82. package/Source/Scene/AutoExposure.js +5 -5
  83. package/Source/Scene/BatchTable.js +5 -5
  84. package/Source/Scene/BillboardCollection.js +2 -2
  85. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  86. package/Source/Scene/Cesium3DTile.js +8 -2
  87. package/Source/Scene/Cesium3DTileBatchTable.js +28 -28
  88. package/Source/Scene/Cesium3DTilesVoxelProvider.js +12 -0
  89. package/Source/Scene/Cesium3DTileset.js +6 -1
  90. package/Source/Scene/ClassificationPrimitive.js +3 -8
  91. package/Source/Scene/DebugAppearance.js +7 -9
  92. package/Source/Scene/DebugInspector.js +5 -5
  93. package/Source/Scene/DepthPlane.js +0 -6
  94. package/Source/Scene/DerivedCommand.js +8 -22
  95. package/Source/Scene/EllipsoidPrimitive.js +0 -7
  96. package/Source/Scene/GlobeTranslucencyState.js +6 -6
  97. package/Source/Scene/GroundPolylinePrimitive.js +2 -4
  98. package/Source/Scene/InvertClassification.js +9 -10
  99. package/Source/Scene/Material.js +6 -6
  100. package/Source/Scene/Megatexture.js +2 -2
  101. package/Source/Scene/MetadataSemantic.js +8 -0
  102. package/Source/Scene/Model/CustomShader.js +1 -1
  103. package/Source/Scene/Model/FeatureIdPipelineStage.js +4 -4
  104. package/Source/Scene/Model/LightingModel.js +1 -1
  105. package/Source/Scene/Model/MetadataPipelineStage.js +1 -1
  106. package/Source/Scene/Model/PickingPipelineStage.js +1 -1
  107. package/Source/Scene/OIT.js +211 -119
  108. package/Source/Scene/PickDepth.js +2 -2
  109. package/Source/Scene/PointCloud.js +11 -11
  110. package/Source/Scene/PointCloudEyeDomeLighting.js +9 -4
  111. package/Source/Scene/PolylineCollection.js +2 -7
  112. package/Source/Scene/PolylineMaterialAppearance.js +2 -3
  113. package/Source/Scene/PostProcessStage.js +13 -13
  114. package/Source/Scene/PostProcessStageLibrary.js +3 -3
  115. package/Source/Scene/Primitive.js +22 -31
  116. package/Source/Scene/ShadowMap.js +7 -7
  117. package/Source/Scene/ShadowMapShader.js +9 -9
  118. package/Source/Scene/ShadowVolumeAppearance.js +1 -1
  119. package/Source/Scene/TextureAtlas.js +5 -3
  120. package/Source/Scene/Vector3DTilePolylines.js +1 -1
  121. package/Source/Scene/Vector3DTilePrimitive.js +2 -2
  122. package/Source/Scene/VoxelEllipsoidShape.js +15 -7
  123. package/Source/Scene/VoxelPrimitive.js +4 -4
  124. package/Source/Scene/computeFlyToLocationForRectangle.js +10 -1
  125. package/Source/Scene/createElevationBandMaterial.js +10 -15
  126. package/Source/Scene/getClipAndStyleCode.js +1 -1
  127. package/Source/Scene/getClippingFunction.js +3 -3
  128. package/Source/Scene/processVoxelProperties.js +1 -1
  129. package/Source/Shaders/AdjustTranslucentFS.glsl +9 -6
  130. package/Source/Shaders/AdjustTranslucentFS.js +9 -6
  131. package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +7 -7
  132. package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +7 -7
  133. package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +12 -12
  134. package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +12 -12
  135. package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +4 -4
  136. package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +4 -4
  137. package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +6 -6
  138. package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +6 -6
  139. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +5 -5
  140. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +5 -5
  141. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +7 -7
  142. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +7 -7
  143. package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +4 -4
  144. package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +4 -4
  145. package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +8 -8
  146. package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +8 -8
  147. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +2 -2
  148. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +2 -2
  149. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +5 -5
  150. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +5 -5
  151. package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +10 -10
  152. package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +10 -10
  153. package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +12 -12
  154. package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +12 -12
  155. package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +5 -5
  156. package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +5 -5
  157. package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +8 -8
  158. package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +8 -8
  159. package/Source/Shaders/BillboardCollectionFS.glsl +15 -15
  160. package/Source/Shaders/BillboardCollectionFS.js +15 -15
  161. package/Source/Shaders/BillboardCollectionVS.glsl +23 -23
  162. package/Source/Shaders/BillboardCollectionVS.js +23 -23
  163. package/Source/Shaders/BrdfLutGeneratorFS.glsl +2 -2
  164. package/Source/Shaders/BrdfLutGeneratorFS.js +2 -2
  165. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  166. package/Source/Shaders/Builtin/Functions/depthClamp.glsl +3 -3
  167. package/Source/Shaders/Builtin/Functions/depthClamp.js +3 -3
  168. package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +4 -4
  169. package/Source/Shaders/Builtin/Functions/getWaterNoise.js +4 -4
  170. package/Source/Shaders/Builtin/Functions/phong.glsl +1 -1
  171. package/Source/Shaders/Builtin/Functions/phong.js +1 -1
  172. package/Source/Shaders/Builtin/Functions/readDepth.glsl +1 -1
  173. package/Source/Shaders/Builtin/Functions/readDepth.js +1 -1
  174. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +5 -5
  175. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +5 -5
  176. package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +3 -3
  177. package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +3 -3
  178. package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +1 -1
  179. package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +1 -1
  180. package/Source/Shaders/Builtin/Functions/textureCube.glsl +17 -0
  181. package/Source/Shaders/Builtin/Functions/textureCube.js +18 -0
  182. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +2 -2
  183. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +2 -2
  184. package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +2 -2
  185. package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +2 -2
  186. package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +5 -8
  187. package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +5 -8
  188. package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +6 -6
  189. package/Source/Shaders/Builtin/Functions/writeLogDepth.js +6 -6
  190. package/Source/Shaders/CloudCollectionFS.glsl +18 -18
  191. package/Source/Shaders/CloudCollectionFS.js +18 -18
  192. package/Source/Shaders/CloudCollectionVS.glsl +11 -11
  193. package/Source/Shaders/CloudCollectionVS.js +11 -11
  194. package/Source/Shaders/CloudNoiseFS.glsl +5 -5
  195. package/Source/Shaders/CloudNoiseFS.js +5 -5
  196. package/Source/Shaders/CloudNoiseVS.glsl +2 -2
  197. package/Source/Shaders/CloudNoiseVS.js +2 -2
  198. package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +4 -4
  199. package/Source/Shaders/CompareAndPackTranslucentDepth.js +4 -4
  200. package/Source/Shaders/CompositeOITFS.glsl +6 -6
  201. package/Source/Shaders/CompositeOITFS.js +6 -6
  202. package/Source/Shaders/DepthPlaneFS.glsl +2 -2
  203. package/Source/Shaders/DepthPlaneFS.js +2 -2
  204. package/Source/Shaders/DepthPlaneVS.glsl +2 -2
  205. package/Source/Shaders/DepthPlaneVS.js +2 -2
  206. package/Source/Shaders/EllipsoidFS.glsl +5 -13
  207. package/Source/Shaders/EllipsoidFS.js +6 -14
  208. package/Source/Shaders/EllipsoidVS.glsl +2 -2
  209. package/Source/Shaders/EllipsoidVS.js +2 -2
  210. package/Source/Shaders/FXAA3_11.glsl +4 -4
  211. package/Source/Shaders/FXAA3_11.js +4 -4
  212. package/Source/Shaders/GlobeFS.glsl +15 -15
  213. package/Source/Shaders/GlobeFS.js +15 -15
  214. package/Source/Shaders/GlobeVS.glsl +17 -17
  215. package/Source/Shaders/GlobeVS.js +17 -17
  216. package/Source/Shaders/Materials/AspectRampMaterial.glsl +1 -1
  217. package/Source/Shaders/Materials/AspectRampMaterial.js +1 -1
  218. package/Source/Shaders/Materials/BumpMapMaterial.glsl +3 -3
  219. package/Source/Shaders/Materials/BumpMapMaterial.js +3 -3
  220. package/Source/Shaders/Materials/ElevationBandMaterial.glsl +3 -3
  221. package/Source/Shaders/Materials/ElevationBandMaterial.js +3 -3
  222. package/Source/Shaders/Materials/ElevationContourMaterial.glsl +2 -1
  223. package/Source/Shaders/Materials/ElevationContourMaterial.js +2 -1
  224. package/Source/Shaders/Materials/ElevationRampMaterial.glsl +1 -1
  225. package/Source/Shaders/Materials/ElevationRampMaterial.js +1 -1
  226. package/Source/Shaders/Materials/GridMaterial.glsl +3 -2
  227. package/Source/Shaders/Materials/GridMaterial.js +3 -2
  228. package/Source/Shaders/Materials/NormalMapMaterial.glsl +1 -1
  229. package/Source/Shaders/Materials/NormalMapMaterial.js +1 -1
  230. package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +3 -2
  231. package/Source/Shaders/Materials/PolylineArrowMaterial.js +3 -2
  232. package/Source/Shaders/Materials/PolylineDashMaterial.glsl +1 -1
  233. package/Source/Shaders/Materials/PolylineDashMaterial.js +1 -1
  234. package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +1 -1
  235. package/Source/Shaders/Materials/PolylineOutlineMaterial.js +1 -1
  236. package/Source/Shaders/Materials/SlopeRampMaterial.glsl +1 -1
  237. package/Source/Shaders/Materials/SlopeRampMaterial.js +1 -1
  238. package/Source/Shaders/Materials/Water.glsl +1 -1
  239. package/Source/Shaders/Materials/Water.js +1 -1
  240. package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +3 -3
  241. package/Source/Shaders/Model/ImageBasedLightingStageFS.js +3 -3
  242. package/Source/Shaders/Model/MaterialStageFS.glsl +10 -10
  243. package/Source/Shaders/Model/MaterialStageFS.js +10 -10
  244. package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +3 -3
  245. package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +3 -3
  246. package/Source/Shaders/Model/ModelFS.glsl +1 -1
  247. package/Source/Shaders/Model/ModelFS.js +1 -1
  248. package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +3 -3
  249. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +3 -3
  250. package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +1 -1
  251. package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +1 -1
  252. package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +8 -8
  253. package/Source/Shaders/OctahedralProjectionAtlasFS.js +8 -8
  254. package/Source/Shaders/OctahedralProjectionFS.glsl +4 -4
  255. package/Source/Shaders/OctahedralProjectionFS.js +4 -4
  256. package/Source/Shaders/OctahedralProjectionVS.glsl +3 -3
  257. package/Source/Shaders/OctahedralProjectionVS.js +3 -3
  258. package/Source/Shaders/PointPrimitiveCollectionFS.glsl +6 -6
  259. package/Source/Shaders/PointPrimitiveCollectionFS.js +6 -6
  260. package/Source/Shaders/PointPrimitiveCollectionVS.glsl +12 -12
  261. package/Source/Shaders/PointPrimitiveCollectionVS.js +12 -12
  262. package/Source/Shaders/PolylineFS.glsl +3 -3
  263. package/Source/Shaders/PolylineFS.js +3 -3
  264. package/Source/Shaders/PolylineShadowVolumeFS.glsl +12 -16
  265. package/Source/Shaders/PolylineShadowVolumeFS.js +12 -16
  266. package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +8 -8
  267. package/Source/Shaders/PolylineShadowVolumeMorphFS.js +8 -8
  268. package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +20 -20
  269. package/Source/Shaders/PolylineShadowVolumeMorphVS.js +20 -20
  270. package/Source/Shaders/PolylineShadowVolumeVS.glsl +20 -20
  271. package/Source/Shaders/PolylineShadowVolumeVS.js +20 -20
  272. package/Source/Shaders/PolylineVS.glsl +17 -17
  273. package/Source/Shaders/PolylineVS.js +17 -17
  274. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +4 -4
  275. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +4 -4
  276. package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +4 -4
  277. package/Source/Shaders/PostProcessStages/AdditiveBlend.js +4 -4
  278. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +4 -4
  279. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +4 -4
  280. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +4 -4
  281. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +4 -4
  282. package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +4 -4
  283. package/Source/Shaders/PostProcessStages/BlackAndWhite.js +4 -4
  284. package/Source/Shaders/PostProcessStages/BloomComposite.glsl +5 -5
  285. package/Source/Shaders/PostProcessStages/BloomComposite.js +5 -5
  286. package/Source/Shaders/PostProcessStages/BrightPass.glsl +3 -3
  287. package/Source/Shaders/PostProcessStages/BrightPass.js +3 -3
  288. package/Source/Shaders/PostProcessStages/Brightness.glsl +3 -3
  289. package/Source/Shaders/PostProcessStages/Brightness.js +3 -3
  290. package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +5 -5
  291. package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +5 -5
  292. package/Source/Shaders/PostProcessStages/ContrastBias.glsl +3 -3
  293. package/Source/Shaders/PostProcessStages/ContrastBias.js +3 -3
  294. package/Source/Shaders/PostProcessStages/DepthOfField.glsl +2 -2
  295. package/Source/Shaders/PostProcessStages/DepthOfField.js +2 -2
  296. package/Source/Shaders/PostProcessStages/DepthView.glsl +2 -2
  297. package/Source/Shaders/PostProcessStages/DepthView.js +2 -2
  298. package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +3 -3
  299. package/Source/Shaders/PostProcessStages/DepthViewPacked.js +3 -3
  300. package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +7 -7
  301. package/Source/Shaders/PostProcessStages/EdgeDetection.js +7 -7
  302. package/Source/Shaders/PostProcessStages/FXAA.glsl +3 -3
  303. package/Source/Shaders/PostProcessStages/FXAA.js +3 -3
  304. package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +4 -4
  305. package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +4 -4
  306. package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +5 -5
  307. package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +5 -5
  308. package/Source/Shaders/PostProcessStages/LensFlare.glsl +13 -13
  309. package/Source/Shaders/PostProcessStages/LensFlare.js +13 -13
  310. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +4 -4
  311. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +4 -4
  312. package/Source/Shaders/PostProcessStages/NightVision.glsl +3 -3
  313. package/Source/Shaders/PostProcessStages/NightVision.js +3 -3
  314. package/Source/Shaders/PostProcessStages/PassThrough.glsl +2 -2
  315. package/Source/Shaders/PostProcessStages/PassThrough.js +2 -2
  316. package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +2 -2
  317. package/Source/Shaders/PostProcessStages/PassThroughDepth.js +2 -2
  318. package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +7 -9
  319. package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +8 -10
  320. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +4 -4
  321. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +4 -4
  322. package/Source/Shaders/PostProcessStages/Silhouette.glsl +4 -4
  323. package/Source/Shaders/PostProcessStages/Silhouette.js +4 -4
  324. package/Source/Shaders/ReprojectWebMercatorFS.glsl +2 -2
  325. package/Source/Shaders/ReprojectWebMercatorFS.js +2 -2
  326. package/Source/Shaders/ReprojectWebMercatorVS.glsl +3 -3
  327. package/Source/Shaders/ReprojectWebMercatorVS.js +3 -3
  328. package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +19 -23
  329. package/Source/Shaders/ShadowVolumeAppearanceFS.js +20 -24
  330. package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +12 -12
  331. package/Source/Shaders/ShadowVolumeAppearanceVS.js +12 -12
  332. package/Source/Shaders/ShadowVolumeFS.glsl +2 -6
  333. package/Source/Shaders/ShadowVolumeFS.js +3 -7
  334. package/Source/Shaders/SkyAtmosphereFS.glsl +6 -6
  335. package/Source/Shaders/SkyAtmosphereFS.js +6 -6
  336. package/Source/Shaders/SkyAtmosphereVS.glsl +6 -6
  337. package/Source/Shaders/SkyAtmosphereVS.js +6 -6
  338. package/Source/Shaders/SkyBoxFS.glsl +3 -3
  339. package/Source/Shaders/SkyBoxFS.js +3 -3
  340. package/Source/Shaders/SkyBoxVS.glsl +2 -2
  341. package/Source/Shaders/SkyBoxVS.js +2 -2
  342. package/Source/Shaders/SunFS.glsl +3 -3
  343. package/Source/Shaders/SunFS.js +3 -3
  344. package/Source/Shaders/SunTextureFS.glsl +2 -2
  345. package/Source/Shaders/SunTextureFS.js +2 -2
  346. package/Source/Shaders/SunVS.glsl +2 -2
  347. package/Source/Shaders/SunVS.js +2 -2
  348. package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +9 -13
  349. package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +9 -13
  350. package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +12 -12
  351. package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +12 -12
  352. package/Source/Shaders/Vector3DTilePolylinesVS.glsl +5 -5
  353. package/Source/Shaders/Vector3DTilePolylinesVS.js +5 -5
  354. package/Source/Shaders/VectorTileVS.glsl +2 -2
  355. package/Source/Shaders/VectorTileVS.js +2 -2
  356. package/Source/Shaders/ViewportQuadFS.glsl +2 -2
  357. package/Source/Shaders/ViewportQuadFS.js +2 -2
  358. package/Source/Shaders/ViewportQuadVS.glsl +3 -3
  359. package/Source/Shaders/ViewportQuadVS.js +3 -3
  360. package/Source/Shaders/Voxels/IntersectDepth.glsl +1 -1
  361. package/Source/Shaders/Voxels/IntersectDepth.js +1 -1
  362. package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +12 -2
  363. package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -2
  364. package/Source/Shaders/Voxels/Megatexture.glsl +1 -1
  365. package/Source/Shaders/Voxels/Megatexture.js +1 -1
  366. package/Source/Shaders/Voxels/Octree.glsl +4 -4
  367. package/Source/Shaders/Voxels/Octree.js +4 -4
  368. package/Source/Shaders/Voxels/VoxelFS.glsl +2 -2
  369. package/Source/Shaders/Voxels/VoxelFS.js +2 -2
  370. package/Source/Shaders/Voxels/VoxelVS.glsl +1 -1
  371. package/Source/Shaders/Voxels/VoxelVS.js +1 -1
  372. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +5 -9
  373. package/Source/Shaders/Voxels/convertUvToCylinder.js +5 -9
  374. package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +3 -6
  375. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +3 -6
  376. package/Source/WorkersES6/decodeDraco.js +9 -1
  377. package/index.d.ts +26 -12
  378. package/index.js +53 -52
  379. package/package.json +1 -1
  380. package/Source/Renderer/modernizeShader.js +0 -242
@@ -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 = texture2D(image, fract(repeat * materialInput.st));
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 = texture2D(image, fract(repeat * materialInput.st));\n\
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
- #ifdef GL_OES_standard_derivatives
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
- float base = 0.975; // 2.5% of the line will be the arrow head
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
- #ifdef GL_OES_standard_derivatives\n\
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
- float base = 0.975; // 2.5% of the line will be the arrow head\n\
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\
@@ -2,7 +2,7 @@ uniform vec4 color;
2
2
  uniform vec4 gapColor;
3
3
  uniform float dashLength;
4
4
  uniform float dashPattern;
5
- varying float v_polylineAngle;
5
+ in float v_polylineAngle;
6
6
 
7
7
  const float maskLength = 16.0;
8
8
 
@@ -3,7 +3,7 @@ export default "uniform vec4 color;\n\
3
3
  uniform vec4 gapColor;\n\
4
4
  uniform float dashLength;\n\
5
5
  uniform float dashPattern;\n\
6
- varying float v_polylineAngle;\n\
6
+ in float v_polylineAngle;\n\
7
7
  \n\
8
8
  const float maskLength = 16.0;\n\
9
9
  \n\
@@ -2,7 +2,7 @@ uniform vec4 color;
2
2
  uniform vec4 outlineColor;
3
3
  uniform float outlineWidth;
4
4
 
5
- varying float v_width;
5
+ in float v_width;
6
6
 
7
7
  czm_material czm_getMaterial(czm_materialInput materialInput)
8
8
  {
@@ -3,7 +3,7 @@ export default "uniform vec4 color;\n\
3
3
  uniform vec4 outlineColor;\n\
4
4
  uniform float outlineWidth;\n\
5
5
  \n\
6
- varying float v_width;\n\
6
+ in float v_width;\n\
7
7
  \n\
8
8
  czm_material czm_getMaterial(czm_materialInput materialInput)\n\
9
9
  {\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 = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
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 = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\n\
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 = texture2D(specularMap, materialInput.st).r;
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 = texture2D(specularMap, materialInput.st).r;\n\
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 = textureCube(czm_environmentMap, r).rgb * inverseRoughness;
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 = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
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 = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
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 = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n\
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 = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
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 = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n\
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 = texture2D(u_normalTexture, normalTexCoords).rgb;
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
- // Compute tangents
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 = texture2D(u_normalTexture, normalTexCoords).rgb;
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(texture2D(u_baseColorTexture, baseColorTexCoords));
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 = texture2D(u_occlusionTexture, occlusionTexCoords).r;
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(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);
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(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));
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(texture2D(u_diffuseTexture, diffuseTexCoords));
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 = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
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 = texture2D(u_normalTexture, normalTexCoords).rgb;\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
- // Compute tangents\n\
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 = texture2D(u_normalTexture, normalTexCoords).rgb;\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(texture2D(u_baseColorTexture, baseColorTexCoords));\n\
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 = texture2D(u_occlusionTexture, occlusionTexCoords).r;\n\
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(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);\n\
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(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));\n\
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(texture2D(u_diffuseTexture, diffuseTexCoords));\n\
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 = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n\
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 = texture2D(packedClippingPlanes, vec2(u, v));
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 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;
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(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));
34
+ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
35
35
  return czm_transformPlane(plane, transform);
36
36
  }
37
37
  #endif
@@ -11,7 +11,7 @@ vec4 getClippingPlane(\n\
11
11
  float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n\
12
12
  float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n\
13
13
  float v = (float(pixY) + 0.5) * pixelHeight;\n\
14
- vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n\
14
+ vec4 plane = texture(packedClippingPlanes, vec2(u, v));\n\
15
15
  return czm_transformPlane(plane, transform);\n\
16
16
  }\n\
17
17
  #else\n\
@@ -28,11 +28,11 @@ vec4 getClippingPlane(\n\
28
28
  float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n\
29
29
  float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n\
30
30
  float v = (float(pixY) + 0.5) * pixelHeight;\n\
31
- vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n\
31
+ vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;\n\
32
32
  vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n\
33
33
  vec4 plane;\n\
34
34
  plane.xyz = czm_octDecode(oct, 65535.0);\n\
35
- plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));\n\
35
+ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));\n\
36
36
  return czm_transformPlane(plane, transform);\n\
37
37
  }\n\
38
38
  #endif\n\
@@ -85,5 +85,5 @@ void main()
85
85
  silhouetteStage(color);
86
86
  #endif
87
87
 
88
- gl_FragColor = color;
88
+ out_FragColor = color;
89
89
  }
@@ -86,6 +86,6 @@ void main()\n\
86
86
  silhouetteStage(color);\n\
87
87
  #endif\n\
88
88
  \n\
89
- gl_FragColor = color;\n\
89
+ out_FragColor = color;\n\
90
90
  }\n\
91
91
  ";
@@ -4,11 +4,11 @@ void primitiveOutlineStage(inout czm_modelMaterial material) {
4
4
  }
5
5
 
6
6
  float outlineX =
7
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
7
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
8
8
  float outlineY =
9
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
9
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
10
10
  float outlineZ =
11
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
11
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
12
12
  float outlineness = max(outlineX, max(outlineY, outlineZ));
13
13
 
14
14
  material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
@@ -5,11 +5,11 @@ export default "void primitiveOutlineStage(inout czm_modelMaterial material) {\n
5
5
  }\n\
6
6
  \n\
7
7
  float outlineX = \n\
8
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\n\
8
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\n\
9
9
  float outlineY = \n\
10
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\n\
10
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\n\
11
11
  float outlineZ = \n\
12
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\n\
12
+ texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\n\
13
13
  float outlineness = max(outlineX, max(outlineY, outlineZ));\n\
14
14
  \n\
15
15
  material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\n\
@@ -27,7 +27,7 @@ void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
27
27
 
28
28
  feature.id = featureId;
29
29
  feature.st = featureSt;
30
- feature.color = texture2D(model_batchTexture, featureSt);
30
+ feature.color = texture(model_batchTexture, featureSt);
31
31
  }
32
32
  // Floating point comparisons can be unreliable in GLSL, so we
33
33
  // increment the feature ID to make sure it's always greater
@@ -28,7 +28,7 @@ void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\
28
28
  \n\
29
29
  feature.id = featureId;\n\
30
30
  feature.st = featureSt;\n\
31
- feature.color = texture2D(model_batchTexture, featureSt);\n\
31
+ feature.color = texture(model_batchTexture, featureSt);\n\
32
32
  }\n\
33
33
  // Floating point comparisons can be unreliable in GLSL, so we\n\
34
34
  // increment the feature ID to make sure it's always greater\n\
@@ -1,4 +1,4 @@
1
- varying vec2 v_textureCoordinates;
1
+ in vec2 v_textureCoordinates;
2
2
 
3
3
  uniform float originalSize;
4
4
  uniform sampler2D texture0;
@@ -60,30 +60,30 @@ void main()
60
60
 
61
61
  if(mipLevel == 0.0)
62
62
  {
63
- gl_FragColor = texture2D(texture0, uv);
63
+ out_FragColor = texture(texture0, uv);
64
64
  }
65
65
  else if(mipLevel == 1.0)
66
66
  {
67
- gl_FragColor = texture2D(texture1, uv);
67
+ out_FragColor = texture(texture1, uv);
68
68
  }
69
69
  else if(mipLevel == 2.0)
70
70
  {
71
- gl_FragColor = texture2D(texture2, uv);
71
+ out_FragColor = texture(texture2, uv);
72
72
  }
73
73
  else if(mipLevel == 3.0)
74
74
  {
75
- gl_FragColor = texture2D(texture3, uv);
75
+ out_FragColor = texture(texture3, uv);
76
76
  }
77
77
  else if(mipLevel == 4.0)
78
78
  {
79
- gl_FragColor = texture2D(texture4, uv);
79
+ out_FragColor = texture(texture4, uv);
80
80
  }
81
81
  else if(mipLevel == 5.0)
82
82
  {
83
- gl_FragColor = texture2D(texture5, uv);
83
+ out_FragColor = texture(texture5, uv);
84
84
  }
85
85
  else
86
86
  {
87
- gl_FragColor = vec4(0.0);
87
+ out_FragColor = vec4(0.0);
88
88
  }
89
89
  }
@@ -1,5 +1,5 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "varying vec2 v_textureCoordinates;\n\
2
+ export default "in vec2 v_textureCoordinates;\n\
3
3
  \n\
4
4
  uniform float originalSize;\n\
5
5
  uniform sampler2D texture0;\n\
@@ -61,31 +61,31 @@ void main()\n\
61
61
  \n\
62
62
  if(mipLevel == 0.0)\n\
63
63
  {\n\
64
- gl_FragColor = texture2D(texture0, uv);\n\
64
+ out_FragColor = texture(texture0, uv);\n\
65
65
  }\n\
66
66
  else if(mipLevel == 1.0)\n\
67
67
  {\n\
68
- gl_FragColor = texture2D(texture1, uv);\n\
68
+ out_FragColor = texture(texture1, uv);\n\
69
69
  }\n\
70
70
  else if(mipLevel == 2.0)\n\
71
71
  {\n\
72
- gl_FragColor = texture2D(texture2, uv);\n\
72
+ out_FragColor = texture(texture2, uv);\n\
73
73
  }\n\
74
74
  else if(mipLevel == 3.0)\n\
75
75
  {\n\
76
- gl_FragColor = texture2D(texture3, uv);\n\
76
+ out_FragColor = texture(texture3, uv);\n\
77
77
  }\n\
78
78
  else if(mipLevel == 4.0)\n\
79
79
  {\n\
80
- gl_FragColor = texture2D(texture4, uv);\n\
80
+ out_FragColor = texture(texture4, uv);\n\
81
81
  }\n\
82
82
  else if(mipLevel == 5.0)\n\
83
83
  {\n\
84
- gl_FragColor = texture2D(texture5, uv);\n\
84
+ out_FragColor = texture(texture5, uv);\n\
85
85
  }\n\
86
86
  else\n\
87
87
  {\n\
88
- gl_FragColor = vec4(0.0);\n\
88
+ out_FragColor = vec4(0.0);\n\
89
89
  }\n\
90
90
  }\n\
91
91
  ";
@@ -1,14 +1,14 @@
1
- varying vec3 v_cubeMapCoordinates;
1
+ in vec3 v_cubeMapCoordinates;
2
2
  uniform samplerCube cubeMap;
3
3
 
4
4
  void main()
5
5
  {
6
- vec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);
6
+ vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);
7
7
  #ifdef RGBA_NORMALIZED
8
- gl_FragColor = vec4(rgba.rgb, 1.0);
8
+ out_FragColor = vec4(rgba.rgb, 1.0);
9
9
  #else
10
10
  float m = rgba.a * 16.0;
11
11
  vec3 r = rgba.rgb * m;
12
- gl_FragColor = vec4(r * r, 1.0);
12
+ out_FragColor = vec4(r * r, 1.0);
13
13
  #endif
14
14
  }
@@ -1,16 +1,16 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "varying vec3 v_cubeMapCoordinates;\n\
2
+ export default "in vec3 v_cubeMapCoordinates;\n\
3
3
  uniform samplerCube cubeMap;\n\
4
4
  \n\
5
5
  void main()\n\
6
6
  {\n\
7
- vec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);\n\
7
+ vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);\n\
8
8
  #ifdef RGBA_NORMALIZED\n\
9
- gl_FragColor = vec4(rgba.rgb, 1.0);\n\
9
+ out_FragColor = vec4(rgba.rgb, 1.0);\n\
10
10
  #else\n\
11
11
  float m = rgba.a * 16.0;\n\
12
12
  vec3 r = rgba.rgb * m;\n\
13
- gl_FragColor = vec4(r * r, 1.0);\n\
13
+ out_FragColor = vec4(r * r, 1.0);\n\
14
14
  #endif\n\
15
15
  }\n\
16
16
  ";
@@ -1,7 +1,7 @@
1
- attribute vec4 position;
2
- attribute vec3 cubeMapCoordinates;
1
+ in vec4 position;
2
+ in vec3 cubeMapCoordinates;
3
3
 
4
- varying vec3 v_cubeMapCoordinates;
4
+ out vec3 v_cubeMapCoordinates;
5
5
 
6
6
  void main()
7
7
  {
@@ -1,8 +1,8 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "attribute vec4 position;\n\
3
- attribute vec3 cubeMapCoordinates;\n\
2
+ export default "in vec4 position;\n\
3
+ in vec3 cubeMapCoordinates;\n\
4
4
  \n\
5
- varying vec3 v_cubeMapCoordinates;\n\
5
+ out vec3 v_cubeMapCoordinates;\n\
6
6
  \n\
7
7
  void main()\n\
8
8
  {\n\
@@ -1,8 +1,8 @@
1
- varying vec4 v_color;
2
- varying vec4 v_outlineColor;
3
- varying float v_innerPercent;
4
- varying float v_pixelDistance;
5
- varying vec4 v_pickColor;
1
+ in vec4 v_color;
2
+ in vec4 v_outlineColor;
3
+ in float v_innerPercent;
4
+ in float v_pixelDistance;
5
+ in vec4 v_pickColor;
6
6
 
7
7
  void main()
8
8
  {
@@ -38,6 +38,6 @@ void main()
38
38
  #endif
39
39
  #endif
40
40
 
41
- gl_FragColor = czm_gammaCorrect(color);
41
+ out_FragColor = czm_gammaCorrect(color);
42
42
  czm_writeLogDepth();
43
43
  }