Canvas: instead of setting anisotropy directly, set it by the same mechanism as mipmapping

This commit is contained in:
legoboyvdlp R 2021-07-31 14:58:40 +01:00
parent 3ba8c383b4
commit b44f187328
2 changed files with 9 additions and 1 deletions

View File

@ -406,6 +406,13 @@ namespace canvas
_render_dirty = true; _render_dirty = true;
} }
if( _anisotropy_dirty )
{
_texture.setMaxAnisotropy( _node->getFloatValue("anisotropy") );
_anisotropy_dirty = false;
_render_dirty = true;
}
while( !_dirty_placements.empty() ) while( !_dirty_placements.empty() )
{ {
SGPropertyNode *node = _dirty_placements.back(); SGPropertyNode *node = _dirty_placements.back();
@ -698,7 +705,7 @@ namespace canvas
} }
else if( name == "anisotropy" ) else if( name == "anisotropy" )
{ {
_texture.setMaxAnisotropy( node->getFloatValue() ); _anisotropy_dirty = true;
} }
else if( name == "additive-blend" ) else if( name == "additive-blend" )
{ {

View File

@ -238,6 +238,7 @@ namespace canvas
PropertyObject<std::string> _status_msg; PropertyObject<std::string> _status_msg;
bool _sampling_dirty {false}, bool _sampling_dirty {false},
_anisotropy_dirty {false},
_render_dirty {true}, _render_dirty {true},
_visible {true}; _visible {true};