diff --git a/data/shaders/tonemap.frag b/data/shaders/tonemap.frag index f7b2d54b7..1ebd6c119 100644 --- a/data/shaders/tonemap.frag +++ b/data/shaders/tonemap.frag @@ -4,7 +4,7 @@ uniform sampler2D tex; uniform sampler2D logluminancetex; uniform float exposure = .09; uniform float Lwhite = 1.; -uniform float vignette_weight = 0.; +uniform float vignette_weight; out vec4 FragColor; diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index dc662d4e3..86a626103 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -535,11 +535,11 @@ static void renderGodRay(GLuint tex, const core::vector2df &sunpos) glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } -static void toneMap(FrameBuffer &fbo, GLuint rtt) +static void toneMap(FrameBuffer &fbo, GLuint rtt, float vignette_weight) { fbo.Bind(); FullScreenShader::ToneMapShader::getInstance()->SetTextureUnits(rtt); - DrawFullScreenEffect(); + DrawFullScreenEffect(vignette_weight); } static void renderDoF(FrameBuffer &fbo, GLuint rtt) @@ -737,7 +737,15 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode, boo { PROFILER_PUSH_CPU_MARKER("- Tonemap", 0xFF, 0x00, 0x00); ScopedGPUTimer Timer(irr_driver->getGPUTimer(Q_TONEMAP)); - toneMap(*out_fbo, in_fbo->getRTT()[0]); + // only enable vignette during race + if(isRace) + { + toneMap(*out_fbo, in_fbo->getRTT()[0], 1.0); + } + else + { + toneMap(*out_fbo, in_fbo->getRTT()[0], 0.0); + } std::swap(in_fbo, out_fbo); PROFILER_POP_CPU_MARKER(); } diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 337daed5d..459f276d1 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1569,7 +1569,7 @@ namespace FullScreenShader GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getRGBfromCIEXxy.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getCIEXYZ.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/tonemap.frag").c_str()); - AssignUniforms(); + AssignUniforms("vignette_weight"); AssignSamplerNames(Program, 0, "text"); } diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index c429fc48a..55b773d51 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -377,9 +377,10 @@ public: BloomBlendShader(); }; -class ToneMapShader : public ShaderHelperSingleton, public TextureRead +class ToneMapShader : public ShaderHelperSingleton, public TextureRead { public: + ToneMapShader(); };