diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp index 1f7b0550e..75231dca8 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp @@ -580,7 +580,7 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig) irr::video::useCoreContext = false; // fall back to legacy context os::Printer::log("Creating legacy OpenGL 2.1 context...", ELL_INFORMATION); - Context = glXCreateContextAttribsARB(display, glxFBConfig, 0, True, legacyctx); + Context = glXCreateNewContext(display, glxFBConfig, GLX_RGBA_TYPE, NULL, True); return Context; } diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 1aad3c6cd..12dabcf32 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -544,32 +544,6 @@ void PostProcessing::renderSSAO() DrawFullScreenEffect(irr_driver->getSSAORadius(), irr_driver->getSSAOK(), irr_driver->getSSAOSigma()); } - -void PostProcessing::renderFog() -{ - const Track * const track = World::getWorld()->getTrack(); - - // This function is only called once per frame - thus no need for setters. - const float start = track->getFogStart(); - const SColor tmpcol = track->getFogColor(); - - core::vector3df col( tmpcol.getRed() / 255.0f, - tmpcol.getGreen() / 255.0f, - tmpcol.getBlue() / 255.0f ); - - glDisable(GL_DEPTH_TEST); - glEnable(GL_BLEND); - glBlendEquation(GL_FUNC_ADD); - glBlendFunc(GL_ONE, GL_ONE); - - - FullScreenShader::FogShader::getInstance()->SetTextureUnits(irr_driver->getDepthStencilTexture()); - DrawFullScreenEffect(1.f / (40.f * start), col); - - glEnable(GL_DEPTH_TEST); - glDisable(GL_BLEND); -} - void PostProcessing::renderMotionBlur(unsigned cam, FrameBuffer &in_fbo, FrameBuffer &out_fbo) { MotionBlurProvider * const cb = (MotionBlurProvider *)irr_driver-> diff --git a/src/graphics/post_processing.hpp b/src/graphics/post_processing.hpp index 1fea5e9c6..a33f3c19c 100644 --- a/src/graphics/post_processing.hpp +++ b/src/graphics/post_processing.hpp @@ -77,7 +77,6 @@ public: void renderSunlight(const core::vector3df &direction, const video::SColorf &col); void renderShadowedSunlight(const core::vector3df &direction, const video::SColorf &col, const std::vector &sun_ortho_matrix, unsigned depthtex); - void renderFog(); void renderSSAO(); void renderEnvMap(const float *bSHCoeff, const float *gSHCoeff, const float *rSHCoeff, unsigned skycubemap); void renderRHDebug(unsigned SHR, unsigned SHG, unsigned SHB, const core::matrix4 &rh_matrix, const core::vector3df &rh_extend); diff --git a/src/graphics/render_lighting.cpp b/src/graphics/render_lighting.cpp index 0aafd69ad..e841f7fc6 100644 --- a/src/graphics/render_lighting.cpp +++ b/src/graphics/render_lighting.cpp @@ -190,35 +190,42 @@ void IrrDriver::renderLightsScatter(unsigned pointlightcount) getFBO(FBO_HALF1).Bind(); glClearColor(0., 0., 0., 0.); glClear(GL_COLOR_BUFFER_BIT); - m_post_processing->renderFog(); - - glEnable(GL_BLEND); - glBlendEquation(GL_FUNC_ADD); - glBlendFunc(GL_ONE, GL_ONE); - glEnable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); const Track * const track = World::getWorld()->getTrack(); - const float start = track->getFogStart(); - core::vector3df col(1., 1., 1.); + // This function is only called once per frame - thus no need for setters. + float start = track->getFogStart() + .001; + const video::SColor tmpcol = track->getFogColor(); + + core::vector3df col(tmpcol.getRed() / 255.0f, + tmpcol.getGreen() / 255.0f, + tmpcol.getBlue() / 255.0f); + + glDisable(GL_DEPTH_TEST); + glDepthMask(GL_FALSE); + glEnable(GL_BLEND); + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_ONE, GL_ONE); + + FullScreenShader::FogShader::getInstance()->SetTextureUnits(irr_driver->getDepthStencilTexture()); + DrawFullScreenEffect(1.f / (40.f * start), col); + + glEnable(GL_DEPTH_TEST); + core::vector3df col2(1., 1., 1.); glUseProgram(LightShader::PointLightScatterShader::getInstance()->Program); glBindVertexArray(LightShader::PointLightScatterShader::getInstance()->vao); LightShader::PointLightScatterShader::getInstance()->SetTextureUnits(irr_driver->getDepthStencilTexture()); - LightShader::PointLightScatterShader::getInstance()->setUniforms(1.f / (40.f * start), col); + LightShader::PointLightScatterShader::getInstance()->setUniforms(1.f / (40.f * start), col2); glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, MIN2(pointlightcount, MAXLIGHT)); -// *** -// That might be a performance issue but if disabled the quality is severly affected (the picture looks jagged) -// It should be an option if there is a gain in FPS glDisable(GL_BLEND); m_post_processing->renderGaussian6Blur(getFBO(FBO_HALF1), getFBO(FBO_HALF2), 5., 5.); glEnable(GL_BLEND); -// *** + glDisable(GL_DEPTH_TEST); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); getFBO(FBO_COLORS).Bind(); m_post_processing->renderPassThrough(getRenderTargetTexture(RTT_HALF1)); diff --git a/src/graphics/render_skybox.cpp b/src/graphics/render_skybox.cpp index a83c09182..66bb07d05 100644 --- a/src/graphics/render_skybox.cpp +++ b/src/graphics/render_skybox.cpp @@ -380,6 +380,7 @@ void IrrDriver::renderSkybox(const scene::ICameraSceneNode *camera) if (SkyboxTextures.empty()) return; glBindVertexArray(MeshShader::SkyboxShader::getInstance()->cubevao); + glEnable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); assert(SkyboxTextures.size() == 6); diff --git a/src/guiengine/widgets/icon_button_widget.cpp b/src/guiengine/widgets/icon_button_widget.cpp index 0535b37db..f550bcd79 100644 --- a/src/guiengine/widgets/icon_button_widget.cpp +++ b/src/guiengine/widgets/icon_button_widget.cpp @@ -300,6 +300,7 @@ const video::ITexture* IconButtonWidget::getTexture() // ----------------------------------------------------------------------------- video::ITexture* IconButtonWidget::getDeactivatedTexture(video::ITexture* texture) { +#ifdef DO_NOT_USE_IT_CAUSES_BUG_1780_FONT_CORRUPTION video::ITexture* t; std::string name = texture->getName().getPath().c_str(); @@ -332,6 +333,8 @@ video::ITexture* IconButtonWidget::getDeactivatedTexture(video::ITexture* textur } return t; +#endif + return texture; } // -----------------------------------------------------------------------------