diff --git a/CHANGES.md b/CHANGES.md index 73d5c50ada68..7c240ae8a1d3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ - Fixed `translucencyByDistance` for label outline color [#9003](https://github.com/CesiumGS/cesium/pull/9003) - Fixed return value for `SampledPositionProperty.removeSample` [#9017](https://github.com/CesiumGS/cesium/pull/9017) - Fixed issue where wall doesn't have correct texture coordinates when there are duplicate positions input [#9042](https://github.com/CesiumGS/cesium/issues/9042) +- Fixed an issue where clipping planes would not clip at the correct distances on some Android devices, most commonly reproducible on devices with `Mali` GPUs that do not support float textures via WebGL [#9023](https://github.com/CesiumGS/cesium/issues/9023) ### 1.71 - 2020-07-01 diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index b89fd91a944a..796351610425 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -4797,7 +4797,7 @@ function modifyShaderForClippingPlanes( shader = ShaderSource.replaceMain(shader, "gltf_clip_main"); shader += Model._getClippingFunction(clippingPlaneCollection, context) + "\n"; shader += - "uniform sampler2D gltf_clippingPlanes; \n" + + "uniform highp sampler2D gltf_clippingPlanes; \n" + "uniform mat4 gltf_clippingPlanesMatrix; \n" + "uniform vec4 gltf_clippingPlanesEdgeStyle; \n" + "void main() \n" + diff --git a/Source/Scene/PointCloud.js b/Source/Scene/PointCloud.js index cf49e1a873d0..7a992a0b0658 100644 --- a/Source/Scene/PointCloud.js +++ b/Source/Scene/PointCloud.js @@ -1356,7 +1356,7 @@ function createShaders(pointCloud, frameState, style) { if (hasClippedContent) { fs += - "uniform sampler2D u_clippingPlanes; \n" + + "uniform highp sampler2D u_clippingPlanes; \n" + "uniform mat4 u_clippingPlanesMatrix; \n" + "uniform vec4 u_clippingPlanesEdgeStyle; \n"; fs += "\n"; diff --git a/Source/Scene/getClippingFunction.js b/Source/Scene/getClippingFunction.js index 8f4123a95af5..ba1ff80a0c60 100644 --- a/Source/Scene/getClippingFunction.js +++ b/Source/Scene/getClippingFunction.js @@ -114,7 +114,7 @@ function getClippingPlaneFloat(width, height) { } var functionString = - "vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" + + "vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" + "{\n" + " int pixY = clippingPlaneNumber / " + width + @@ -148,7 +148,7 @@ function getClippingPlaneUint8(width, height) { } var functionString = - "vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" + + "vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" + "{\n" + " int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n" + // clipping planes are two pixels each " int pixY = clippingPlaneStartIndex / " + diff --git a/Source/Shaders/GlobeFS.glsl b/Source/Shaders/GlobeFS.glsl index 10a5c29fc3f4..f20c12f350d5 100644 --- a/Source/Shaders/GlobeFS.glsl +++ b/Source/Shaders/GlobeFS.glsl @@ -72,7 +72,7 @@ uniform vec2 u_nightFadeDistance; #endif #ifdef ENABLE_CLIPPING_PLANES -uniform sampler2D u_clippingPlanes; +uniform highp sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; #endif