diff --git a/code/nel/include/nel/gui/view_renderer.h b/code/nel/include/nel/gui/view_renderer.h index c737037a1..64cbfc888 100644 --- a/code/nel/include/nel/gui/view_renderer.h +++ b/code/nel/include/nel/gui/view_renderer.h @@ -181,6 +181,7 @@ namespace NLGUI */ void setInterfaceScale(float scale, sint32 width = 0, sint32 height = 0); float getInterfaceScale() const { return _InterfaceScale; } + void setBilinearFiltering(bool b) { _Bilinear = b; } /* * is the Screen minimized? @@ -537,6 +538,7 @@ namespace NLGUI float _InterfaceUserScale; sint32 _InterfaceBaseW, _InterfaceBaseH; sint32 _EffectiveScreenW, _EffectiveScreenH; + bool _Bilinear; void updateInterfaceScale(); diff --git a/code/nel/src/gui/view_renderer.cpp b/code/nel/src/gui/view_renderer.cpp index f8a8152b9..fe86dce1f 100644 --- a/code/nel/src/gui/view_renderer.cpp +++ b/code/nel/src/gui/view_renderer.cpp @@ -199,6 +199,7 @@ namespace NLGUI _EmptyLayer[i]= true; } _BlankGlobalTexture = NULL; + _Bilinear = false; updateInterfaceScale(); } @@ -1279,7 +1280,7 @@ namespace NLGUI _Material.setTexture(0, ite->Texture); // Special Case if _WorldSpaceTransformation and _WorldSpaceScale, enable bilinear - if(_WorldSpaceTransformation && _WorldSpaceScale) + if(_Bilinear || (_WorldSpaceTransformation && _WorldSpaceScale)) ite->Texture->setFilterMode(UTexture::Linear, UTexture::LinearMipMapOff); // draw quads and empty list @@ -1296,7 +1297,7 @@ namespace NLGUI } // Special Case if _WorldSpaceTransformation and _WorldSpaceScale, reset - if(_WorldSpaceTransformation && _WorldSpaceScale) + if(_Bilinear || (_WorldSpaceTransformation && _WorldSpaceScale)) ite->Texture->setFilterMode(UTexture::Nearest, UTexture::NearestMipMapOff); } if (!layer.FilteredAlphaBlendedQuads.empty() || diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index e321fdd6a..237892dbf 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -301,6 +301,7 @@ CClientConfig::CClientConfig() Gamma = 0.f; // Default Monitor Gamma. InterfaceScale = 1.0f; // Resize UI + BilinearUI = false; VREnable = false; VRDisplayDevice = "Auto"; @@ -839,6 +840,7 @@ void CClientConfig::setValues() READ_FLOAT_FV(InterfaceScale); // 50% smaller / 2x bigger clamp(ClientCfg.InterfaceScale, 0.5f, 2.0f); + READ_BOOL_FV(BilinearUI); // 3D Driver varPtr = ClientCfg.ConfigFile.getVarPtr ("Driver3D"); if (varPtr) diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 157503957..2fc561c4d 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -148,6 +148,7 @@ struct CClientConfig // UI scaling float InterfaceScale; + bool BilinearUI; // VR bool VREnable; diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 8105d9351..d0f38f7b6 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1317,6 +1317,7 @@ void prelogInit() CInterfaceManager::getInstance(); CViewRenderer::getInstance()->setInterfaceScale(1.0f, 1024, 768); + CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI); // Yoyo: initialize NOW the InputHandler for Event filtering. CInputHandlerManager *InputHandlerManager = CInputHandlerManager::getInstance(); diff --git a/code/ryzom/client/src/main_loop_utilities.cpp b/code/ryzom/client/src/main_loop_utilities.cpp index e62c033e4..37bfc3247 100644 --- a/code/ryzom/client/src/main_loop_utilities.cpp +++ b/code/ryzom/client/src/main_loop_utilities.cpp @@ -104,6 +104,9 @@ void updateFromClientCfg() if (ClientCfg.InterfaceScale != LastClientCfg.InterfaceScale) CInterfaceManager::getInstance()->setInterfaceScale(ClientCfg.InterfaceScale); + if (ClientCfg.BilinearUI != LastClientCfg.BilinearUI) + CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI); + //--------------------------------------------------- if (ClientCfg.WaitVBL != LastClientCfg.WaitVBL) {