From 823253c7431be2a1c8d2199b1a2c70a319a0ff24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBrandon?= Date: Tue, 13 Aug 2019 11:31:06 -0400 Subject: [PATCH] Fixed selection filtering for bloom --- CHANGES.md | 3 +++ CONTRIBUTORS.md | 2 +- Source/Shaders/PostProcessStages/BloomComposite.glsl | 12 ++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6919179dfd9d..91b9fdb9245a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,9 @@ Change Log ##### Additions :tada: * Added optional `index` parameter to `PrimitiveCollection.add`. [#8041](https://github.com/AnalyticalGraphicsInc/cesium/pull/8041) +##### Fixes :wrench: +* Fixed post-processing selection filtering to work for bloom. [#7984](https://github.com/AnalyticalGraphicsInc/cesium/issues/7984) + ### 1.60 - 2019-08-01 ##### Additions :tada: diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index de9e62377279..69accb76a3d0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -132,7 +132,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Hannah Pinkos](https://github.com/hpinkos) * [Kangning Li](https://github.com/likangning93) * [Sean Lilley](https://github.com/lilleyse) - + * [Brandon Barker](https://github.com/ProjectBarks) ## [Individual CLA](Documentation/Contributors/CLAs/individual-contributor-license-agreement-v1.0.pdf) * [Victor Berchet](https://github.com/vicb) diff --git a/Source/Shaders/PostProcessStages/BloomComposite.glsl b/Source/Shaders/PostProcessStages/BloomComposite.glsl index 543ca65ef3a2..de4904ac0bd9 100644 --- a/Source/Shaders/PostProcessStages/BloomComposite.glsl +++ b/Source/Shaders/PostProcessStages/BloomComposite.glsl @@ -1,12 +1,20 @@ uniform sampler2D colorTexture; uniform sampler2D bloomTexture; -uniform bool glowOnly; +uniform bool glowOnly; varying vec2 v_textureCoordinates; void main(void) { - vec4 bloom = texture2D(bloomTexture, v_textureCoordinates); vec4 color = texture2D(colorTexture, v_textureCoordinates); + +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + gl_FragColor = color; + return; + } +#endif + + vec4 bloom = texture2D(bloomTexture, v_textureCoordinates); gl_FragColor = glowOnly ? bloom : bloom + color; }