From 6f6d705f2276a55bb7301e9a675c32ff6b05bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Mon, 23 Nov 2020 16:33:09 +0100 Subject: [PATCH] Add support for anisotropic filtering in Canvas --- simgear/canvas/Canvas.cxx | 4 ++++ simgear/canvas/ODGauge.cxx | 6 ++++++ simgear/canvas/ODGauge.hxx | 2 ++ 3 files changed, 12 insertions(+) diff --git a/simgear/canvas/Canvas.cxx b/simgear/canvas/Canvas.cxx index 4650e099..16504823 100644 --- a/simgear/canvas/Canvas.cxx +++ b/simgear/canvas/Canvas.cxx @@ -691,6 +691,10 @@ namespace canvas { _sampling_dirty = true; } + else if( name == "anisotropy" ) + { + _texture.setMaxAnisotropy( node->getFloatValue() ); + } else if( name == "additive-blend" ) { _texture.useAdditiveBlend( node->getBoolValue() ); diff --git a/simgear/canvas/ODGauge.cxx b/simgear/canvas/ODGauge.cxx index 12bb52d2..4b5ec62c 100644 --- a/simgear/canvas/ODGauge.cxx +++ b/simgear/canvas/ODGauge.cxx @@ -202,6 +202,12 @@ namespace canvas updateSampling(); } + //---------------------------------------------------------------------------- + void ODGauge::setMaxAnisotropy(float anis) + { + texture->setMaxAnisotropy(anis); + } + //---------------------------------------------------------------------------- void ODGauge::setRender(bool render) { diff --git a/simgear/canvas/ODGauge.hxx b/simgear/canvas/ODGauge.hxx index e303c4e3..d673d69a 100644 --- a/simgear/canvas/ODGauge.hxx +++ b/simgear/canvas/ODGauge.hxx @@ -109,6 +109,8 @@ namespace canvas int coverage_samples = 0, int color_samples = 0 ); + void setMaxAnisotropy(float anis); + /** * Enable/Disable updating the texture (If disabled the contents of the * texture remains with the outcome of the last rendering pass)