Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transparent background colors with HDR. #7431

Merged
merged 1 commit into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,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)
* Fixed rendering transparent background color when `highDynamicRange` is enabled. [#7427](https://github.com/AnalyticalGraphicsInc/cesium/issues/7427)

### 1.52 - 2018-12-03

Expand Down
5 changes: 3 additions & 2 deletions Source/Shaders/PostProcessStages/AcesTonemapping.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ uniform sampler2D autoExposure;

void main()
{
vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;
vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
color /= texture2D(autoExposure, vec2(0.5)).r;
Expand All @@ -27,5 +28,5 @@ void main()

color = clamp(color, 0.0, 1.0);
color = czm_inverseGamma(color);
gl_FragColor = vec4(color, 1.0);
gl_FragColor = vec4(color, fragmentColor.a);
}
5 changes: 3 additions & 2 deletions Source/Shaders/PostProcessStages/FilmicTonemapping.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ uniform sampler2D autoExposure;

void main()
{
vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;
vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
float exposure = texture2D(autoExposure, vec2(0.5)).r;
Expand All @@ -31,5 +32,5 @@ void main()
float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;

c = czm_inverseGamma(c / w);
gl_FragColor = vec4(c, 1.0);
gl_FragColor = vec4(c, fragmentColor.a);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ uniform sampler2D autoExposure;

void main()
{
vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;
vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture2D(autoExposure, vec2(0.5)).r;
color /= exposure;
#endif
color = (color * (1.0 + color / white)) / (1.0 + color);
color = czm_inverseGamma(color);
gl_FragColor = vec4(color, 1.0);
gl_FragColor = vec4(color, fragmentColor.a);
}
5 changes: 3 additions & 2 deletions Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ uniform sampler2D autoExposure;

void main()
{
vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;
vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture2D(autoExposure, vec2(0.5)).r;
color /= exposure;
#endif
color = color / (1.0 + color);
color = czm_inverseGamma(color);
gl_FragColor = vec4(color, 1.0);
gl_FragColor = vec4(color, fragmentColor.a);
}