From 54a569714b315876b3dc3d678dffbc57723ffd41 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Sat, 8 Jun 2019 10:50:53 -0400 Subject: [PATCH 1/2] Gamma correct fix for polylines --- .../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl | 2 +- Source/Shaders/PolylineShadowVolumeFS.glsl | 2 +- Source/Shaders/PolylineShadowVolumeMorphFS.glsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl b/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl index 3649a0883f2..0af342a73e2 100644 --- a/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +++ b/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl @@ -2,5 +2,5 @@ varying vec4 v_color; void main() { - gl_FragColor = v_color; + gl_FragColor = czm_gammaCorrect(v_color); } diff --git a/Source/Shaders/PolylineShadowVolumeFS.glsl b/Source/Shaders/PolylineShadowVolumeFS.glsl index 9bd21c42fa5..d8b65a80fd0 100644 --- a/Source/Shaders/PolylineShadowVolumeFS.glsl +++ b/Source/Shaders/PolylineShadowVolumeFS.glsl @@ -65,7 +65,7 @@ void main(void) distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); #ifdef PER_INSTANCE_COLOR - gl_FragColor = v_color; + gl_FragColor = czm_gammaCorrect(v_color); #else // PER_INSTANCE_COLOR // Clamp - distance to aligned planes may be negative due to mitering, // so fragment texture coordinate might be out-of-bounds. diff --git a/Source/Shaders/PolylineShadowVolumeMorphFS.glsl b/Source/Shaders/PolylineShadowVolumeMorphFS.glsl index a5995bea035..ec3568f9893 100644 --- a/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +++ b/Source/Shaders/PolylineShadowVolumeMorphFS.glsl @@ -20,7 +20,7 @@ void main(void) eyeCoordinate /= eyeCoordinate.w; #ifdef PER_INSTANCE_COLOR - gl_FragColor = v_color; + gl_FragColor = czm_gammaCorrect(v_color); #else // PER_INSTANCE_COLOR // Use distances for planes aligned with segment to prevent skew in dashing float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); From 59a87dd15d9c3b7e112d0b19d5be9f1a2cd806d1 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Sat, 8 Jun 2019 10:53:53 -0400 Subject: [PATCH 2/2] CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6bc56c31174..cb6ff8bc44d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Change Log ##### Fixes :wrench: * Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/AnalyticalGraphicsInc/cesium//pull/7885) * Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/AnalyticalGraphicsInc/cesium/pull/7908) +* Fixed polyline colors when `scene.highDynamicRange` is enabled. [#7924](https://github.com/AnalyticalGraphicsInc/cesium/pull/7924) ### 1.58.1 - 2018-06-03 _This is an npm-only release to fix a publishing issue_