Skip to content

Commit

Permalink
Merge pull request #7425 from AnalyticalGraphicsInc/fix-contrast
Browse files Browse the repository at this point in the history
Fix imagery contrast.
  • Loading branch information
lilleyse authored Dec 18, 2018
2 parents 483539e + 24ac4c3 commit ec5b99d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log

##### Fixes :wrench:
* Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/AnalyticalGraphicsInc/cesium/pull/7289)
* Fixed contrast on imagery layers. [#7382](https://github.com/AnalyticalGraphicsInc/cesium/issues/7382)

### 1.52 - 2018-12-03

Expand Down
10 changes: 5 additions & 5 deletions Source/Shaders/GlobeFS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ vec4 sampleAndBlend(
vec3 color = value.rgb;
float alpha = value.a;

#ifdef APPLY_GAMMA
#if !defined(APPLY_GAMMA)
vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
color = tempColor.rgb;
alpha = tempColor.a;
#else
color = pow(color, vec3(textureOneOverGamma));
#endif

Expand Down Expand Up @@ -164,10 +168,6 @@ vec4 sampleAndBlend(
color = czm_saturation(color, textureSaturation);
#endif

vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
color = tempColor.rgb;
alpha = tempColor.a;

float sourceAlpha = alpha * textureAlpha;
float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
Expand Down

0 comments on commit ec5b99d

Please sign in to comment.