minFilter and magFilter does not work

Dear all :

I have set Mag and Min filter in my code according to internet friend’s suggestions (range from test start to test end ). However it seems not work at all. Could any friend tell me how to fix it or how to test whether min and mag filter is working ? thank you. Because Image looks so blur.

  1. You seem to be using it correctly.
  1. You can test it by setting both min/mag filtering to THREE.NearestFilter - then zooming close to the texture. Pixels should be very visible and should have sharp edges like here (not blurred like here.)
  2. In your setup - pixels will be sharpened only when the texture is far away from the camera (ie. minFilter), and blurred when they are close to the camera (ie. magFilter.)
  3. You can also try adding console.log(object.material, object.material.map); in the line above 43 - and just see if any materials and maps are actually affected.

It’s normal to set these properties on the loader and not the textures themselves? Mtl has the info on texture filtering?

Hm, not really - but as long as it’s this MTLLoader, lines 32-33 should have no effect at all (unless OBJLoader2 exported a separate MTLLoader at some point?)

And since the materials and textures seem to load - I believe lines 43-44 should work just fine for filtering :thinking:

Dear mjurczyk
I really appreciate you for your very kind help.
It really shows all info about my pictures after putting console.log in that.

I think the problem is in my texture jpeg itself… not code… thank you

That’s also possible. Setting both minFilter and magFilter to NearestFilter should sharpen the texture - but if the source image is too small, it may probably still look a bit off :sweat_smile: