From b44f187328fe26fba24fd38ea542201a543e6c38 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 31 Jul 2021 14:58:40 +0100 Subject: [PATCH] Canvas: instead of setting anisotropy directly, set it by the same mechanism as mipmapping --- simgear/canvas/Canvas.cxx | 9 ++++++++- simgear/canvas/Canvas.hxx | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/simgear/canvas/Canvas.cxx b/simgear/canvas/Canvas.cxx index ca604077..c2ef349f 100644 --- a/simgear/canvas/Canvas.cxx +++ b/simgear/canvas/Canvas.cxx @@ -405,6 +405,13 @@ namespace canvas _sampling_dirty = false; _render_dirty = true; } + + if( _anisotropy_dirty ) + { + _texture.setMaxAnisotropy( _node->getFloatValue("anisotropy") ); + _anisotropy_dirty = false; + _render_dirty = true; + } while( !_dirty_placements.empty() ) { @@ -698,7 +705,7 @@ namespace canvas } else if( name == "anisotropy" ) { - _texture.setMaxAnisotropy( node->getFloatValue() ); + _anisotropy_dirty = true; } else if( name == "additive-blend" ) { diff --git a/simgear/canvas/Canvas.hxx b/simgear/canvas/Canvas.hxx index 10b7403c..469d77e8 100644 --- a/simgear/canvas/Canvas.hxx +++ b/simgear/canvas/Canvas.hxx @@ -238,6 +238,7 @@ namespace canvas PropertyObject _status_msg; bool _sampling_dirty {false}, + _anisotropy_dirty {false}, _render_dirty {true}, _visible {true};