Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Three.js not to use interpolation when zooming an object's texture?

It is a plane with a sprite art as texture so I'd like it zoomed using no interpolation method.

like image 879
MaiaVictor Avatar asked Dec 26 '22 03:12

MaiaVictor


1 Answers

You can get no interpolation like this:

texture.magFilter = THREE.NearestFilter;
texture.minFilter = THREE.NearestFilter;

However, if you're after a minecraft look where there is interpolation in the far areas (less noisy), you'll need this combo:

texture.magFilter = THREE.NearestFilter;
texture.minFilter = THREE.LinearMipMapLinearFilter;
like image 191
mrdoob Avatar answered Jan 13 '23 16:01

mrdoob