diff --git a/data/shaders/bloom.frag b/data/shaders/bloom.frag index 4169ef49c..e7c50efb6 100644 --- a/data/shaders/bloom.frag +++ b/data/shaders/bloom.frag @@ -16,7 +16,7 @@ void main() vec3 col = texture(tex, uv).xyz; float luma = getCIEYxy(col).x; - col *= smoothstep(1., 100., luma); + col *= smoothstep(1., 10., luma); FragColor = vec4(col, 1.0); } diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp index 9578de242..9717c1dbd 100644 --- a/src/graphics/glwrap.cpp +++ b/src/graphics/glwrap.cpp @@ -67,6 +67,7 @@ PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample; PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer; PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex; PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding; +PFNGLBLENDCOLORPROC glBlendColor; #endif static bool is_gl_init = false; @@ -213,6 +214,7 @@ void initGL() glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)IRR_OGL_LOAD_EXTENSION("glBlitFramebuffer"); glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)IRR_OGL_LOAD_EXTENSION("glGetUniformBlockIndex"); glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)IRR_OGL_LOAD_EXTENSION("glUniformBlockBinding"); + glBlendColor = (PFNGLBLENDCOLORPROC)IRR_OGL_LOAD_EXTENSION("glBlendColor"); #ifdef DEBUG glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)IRR_OGL_LOAD_EXTENSION("glDebugMessageCallbackARB"); #endif diff --git a/src/graphics/glwrap.hpp b/src/graphics/glwrap.hpp index f60f7f836..e00369c1e 100644 --- a/src/graphics/glwrap.hpp +++ b/src/graphics/glwrap.hpp @@ -84,6 +84,7 @@ extern PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample; extern PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer; extern PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex; extern PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding; +extern PFNGLBLENDCOLORPROC glBlendColor; #ifdef DEBUG extern PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB; #endif diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 51cd4337d..b37e2ceb2 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -658,10 +658,13 @@ void PostProcessing::render() // Additively blend on top of tmp1 glBindFramebuffer(GL_FRAMEBUFFER, out_fbo); glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE); + glBlendFunc(GL_CONSTANT_COLOR, GL_ONE); glBlendEquation(GL_FUNC_ADD); + glBlendColor(.125, .125, .125, .125); renderPassThrough(irr_driver->getRenderTargetTexture(RTT_BLOOM_128)); + glBlendColor(.25, .25, .25, .25); renderPassThrough(irr_driver->getRenderTargetTexture(RTT_BLOOM_256)); + glBlendColor(.5, .5, .5, .5); renderPassThrough(irr_driver->getRenderTargetTexture(RTT_BLOOM_512)); glDisable(GL_BLEND); } // end if bloom