Closed Adolio closed 2 years ago
I can totally see that this might be useful – thanks for the pull request, Aurélien!
I'd rather name this new property defaultTextureSmoothing
, though. That way, it's more apparent that this is just a default that can be overridden anytime. I admit it's a long word to type, but I still think it's worth it. :wink:
What do you say?
I don't have any concern about renaming this variable, I'm usually the one which is complaining about variable & class names 😅
In this particular case I just wanted to mimic what was done for the antiAliasing
but I understand that maybe it's slightly different since it's the "value" used as default.
So all good for me 👍
I will do the changes ASAP.
Hm, that similarity with antiAliasing
is a good point. Give me a minute, I'll have another look!
Okay, the difference is that Starling.antiAliasing
really only influences the back buffer, which is handled by the Starling class. What you set here is actually used by Starling.
However, the textureSmoothing
property is used by other classes and can be overridden at multiple places. So in that light, I think it makes sense to add that default
prefix.
Thanks for mentioning it, though! I hate it when the API is inconsistent. 😉
Perfect, this makes sense too me as well - by the way, I initially wanted to name it exactly that way 😉
Perfect, this makes sense too me as well - by the way, I initially wanted to name it exactly that way
Haha, brilliant! Then go for it! 😄
Here we go 🙂!
Sorry I forgot to stage two files - the last commit is fine now.
Perfect – thanks again! It's now part of the master branch. 😄
Hey Daniel,
I have added a global parameter in the
Starling
class to override the default texture smoothing value which is used inMeshStyle
,FragmentFilter
&FilterEffect
.This allows for example to setup "trilinear" texture filtering everywhere by doing:
☝️ Note: this doesn't update any pre-existing meshes & filters.
Best, Aurélien