From 6206e384728d3625223dcf409bf9eae40bf99b08 Mon Sep 17 00:00:00 2001 From: Samuel Vargas Date: Wed, 15 Jan 2020 10:19:29 -0500 Subject: [PATCH 1/3] Clip point in PointPrimitiveCollection properly --- Source/Shaders/PointPrimitiveCollectionVS.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Shaders/PointPrimitiveCollectionVS.glsl b/Source/Shaders/PointPrimitiveCollectionVS.glsl index 727307b53779..9186c6d0b9c8 100644 --- a/Source/Shaders/PointPrimitiveCollectionVS.glsl +++ b/Source/Shaders/PointPrimitiveCollectionVS.glsl @@ -135,7 +135,7 @@ void main() float nearSq = distanceDisplayConditionAndDisableDepth.x; float farSq = distanceDisplayConditionAndDisableDepth.y; if (lengthSq < nearSq || lengthSq > farSq) { - positionEC.xyz = vec3(0.0); + positionEC.xyz = vec3(1.0); } #endif From e671ff1da526dea58425413ddbe2a04006365e46 Mon Sep 17 00:00:00 2001 From: Samuel Vargas Date: Wed, 15 Jan 2020 10:25:59 -0500 Subject: [PATCH 2/3] Update CHANGES.md [skip ci] --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 3c548aabda30..661f286dcc59 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ Change Log * Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js` [#8532](https://github.com/AnalyticalGraphicsInc/cesium/pull/8532) * Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https://github.com/AnalyticalGraphicsInc/cesium/pull/8534) * Fixed a bug where toggling point cloud classification visibility would result in a grey screen on Linux / Nvidia [#8538](https://github.com/AnalyticalGraphicsInc/cesium/pull/8538) +* Fixed a bug where a point in a PointPrimitiveCollection is rendered in the middle of the screen instead of being clipped [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542) ### 1.65.0 - 2020-01-06 From f358e8e18712b72a019636dfc00f203be38718db Mon Sep 17 00:00:00 2001 From: Samuel Vargas Date: Wed, 15 Jan 2020 22:12:20 -0500 Subject: [PATCH 3/3] Add comment, explicitly set 'z' component to 1 --- Source/Shaders/PointPrimitiveCollectionVS.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Shaders/PointPrimitiveCollectionVS.glsl b/Source/Shaders/PointPrimitiveCollectionVS.glsl index 9186c6d0b9c8..3b340a3ca1f5 100644 --- a/Source/Shaders/PointPrimitiveCollectionVS.glsl +++ b/Source/Shaders/PointPrimitiveCollectionVS.glsl @@ -135,7 +135,8 @@ void main() float nearSq = distanceDisplayConditionAndDisableDepth.x; float farSq = distanceDisplayConditionAndDisableDepth.y; if (lengthSq < nearSq || lengthSq > farSq) { - positionEC.xyz = vec3(1.0); + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); } #endif