From dc4dee3f82890df06231e61b2bbe5293e55016b6 Mon Sep 17 00:00:00 2001 From: stfx Date: Sat, 19 Aug 2017 16:57:49 +0200 Subject: [PATCH 1/2] Fix Bloom in rare cases BloomColor was not initialized with a value and therefore could incorrectly bloom non-bright pixels. Maybe... since the issue randomly started to happen on my system (i5-4570, GTX 760) without any hardware or software changes I know of. Even older versions of my program then suddenly had this problem and this was the only working fix which was mentioned in the comments section on the tutorial: https://learnopengl.com/#!Advanced-Lighting/Bloom#comment-2693931521) --- src/5.advanced_lighting/7.bloom/7.bloom.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/5.advanced_lighting/7.bloom/7.bloom.fs b/src/5.advanced_lighting/7.bloom/7.bloom.fs index dcb9eb4..a6c4376 100644 --- a/src/5.advanced_lighting/7.bloom/7.bloom.fs +++ b/src/5.advanced_lighting/7.bloom/7.bloom.fs @@ -43,7 +43,7 @@ void main() float brightness = dot(result, vec3(0.2126, 0.7152, 0.0722)); if(brightness > 1.0) BrightColor = vec4(result, 1.0); - // else - // BloomColor = vec4(0.0, 0.0, 0.0, 1.0); + else + BloomColor = vec4(0.0, 0.0, 0.0, 1.0); FragColor = vec4(result, 1.0); -} \ No newline at end of file +} From 33ee64327f087eb0a5cbf8786f1c2799fb377231 Mon Sep 17 00:00:00 2001 From: stfx Date: Sat, 19 Aug 2017 16:59:35 +0200 Subject: [PATCH 2/2] Fix typo --- src/5.advanced_lighting/7.bloom/7.bloom.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/5.advanced_lighting/7.bloom/7.bloom.fs b/src/5.advanced_lighting/7.bloom/7.bloom.fs index a6c4376..a687beb 100644 --- a/src/5.advanced_lighting/7.bloom/7.bloom.fs +++ b/src/5.advanced_lighting/7.bloom/7.bloom.fs @@ -44,6 +44,6 @@ void main() if(brightness > 1.0) BrightColor = vec4(result, 1.0); else - BloomColor = vec4(0.0, 0.0, 0.0, 1.0); + BrightColor = vec4(0.0, 0.0, 0.0, 1.0); FragColor = vec4(result, 1.0); }