From dc4dee3f82890df06231e61b2bbe5293e55016b6 Mon Sep 17 00:00:00 2001 From: stfx Date: Sat, 19 Aug 2017 16:57:49 +0200 Subject: [PATCH 1/3] 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/3] 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); } From 0cb58d04ba61e6ca54809b0881dde274ca5c33ff Mon Sep 17 00:00:00 2001 From: lost plesed Date: Tue, 29 Aug 2017 11:47:04 +0800 Subject: [PATCH 3/3] fix mac build failed #82 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b89b712..26c2da9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,9 @@ elseif(APPLE) FIND_LIBRARY(COCOA_LIBRARY Cocoa) FIND_LIBRARY(OpenGL_LIBRARY OpenGL) FIND_LIBRARY(IOKit_LIBRARY IOKit) + FIND_LIBRARY(CoreVideo_LIBRARY CoreVideo) MARK_AS_ADVANCED(COCOA_LIBRARY OpenGL_LIBRARY) - SET(APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY}) + SET(APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY} ${CoreVideo_LIBRARY}) SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY}) set(LIBS ${LIBS} ${APPLE_LIBS}) else()