diff --git a/CHANGES.md b/CHANGES.md index 60a35a7f0cf..3e86de18282 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ - Fixed type of `ImageryLayer.fromProviderAsync`, to correctly show that the param `options` is optional. [#12400](https://github.com/CesiumGS/cesium/pull/12400) - Fixed Draco decoding for vertex colors that are normalized `UNSIGNED_BYTE` or `UNSIGNED_SHORT`. [#12417](https://github.com/CesiumGS/cesium/pull/12417) - Fixed type error when setting `Viewer.selectedEntity` [#12303](https://github.com/CesiumGS/cesium/issues/12303) +- Fixed error in polyline when sinAngle is < 1. the value of expandWidth was too much. [#12434](https://github.com/CesiumGS/cesium/pull/12434) ## 1.125 - 2025-01-02 diff --git a/packages/engine/Source/Shaders/PolylineCommon.glsl b/packages/engine/Source/Shaders/PolylineCommon.glsl index 0a971250502..1484f71f1e1 100644 --- a/packages/engine/Source/Shaders/PolylineCommon.glsl +++ b/packages/engine/Source/Shaders/PolylineCommon.glsl @@ -160,7 +160,7 @@ vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, f vec2 u = -thisSegmentForwardWC; vec2 v = leftWC; float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 0.5); } vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;