[HTML5] Anisotropic filtering doesn't work


#1

Hello :slight_smile:
I want to use anisotropic filtering of textures in my game, so i try to use it… and it doesn’t work (in Mozilla and Chrome, at least). In Away3D filtering example HERE it is also nothing happens when switch between anisotropic modes.
So, at first, I thought that filtering is not available due to browser limitations… and decided that I need to come to terms with this :disappointed_relieved:

But hour ago I saw an example of filtering on a pure WebGL, and it works perfectly!:open_mouth:

I start to dig, and find something interesting in Context3D.hx:

Reflect.hasField(extension, “MAX_TEXTURE_MAX_ANISOTROPY_EXT”)

always returns false! Trace example:

trace (extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT); //34047
trace (Reflect.hasField(extension, “MAX_TEXTURE_MAX_ANISOTROPY_EXT”)); //false

So, i change code to:

#if (js && html5)
if (extension == null || extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT == null)
extension = gl.getExtension (“MOZ_EXT_texture_filter_anisotropic”);
if (extension == null || extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT == null)
extension = gl.getExtension (“WEBKIT_EXT_texture_filter_anisotropic”);
#end

And now I have a wonderful anisotropic filtering :heart_eyes::stuck_out_tongue_winking_eye:

I would like to know why the Reflect in this case behaves so strange…