Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange patterns on texture #1921

Closed
ddanny opened this issue May 15, 2012 · 3 comments
Closed

Strange patterns on texture #1921

ddanny opened this issue May 15, 2012 · 3 comments
Labels

Comments

@ddanny
Copy link

ddanny commented May 15, 2012

I am using a textured PlaneGeometry for displaying some 2D images on some planes. It seems to work fine excepting the fact that I get some strange patterns when zoomed out.
They look something like this: http://www.achartengine.org/img/img1.png
However, the original image looks like this when zoomed in: http://www.achartengine.org/img/img2.png

Please let me know if there is anything I do wrong or there is anything I can do to fix this. The code below explains better what I do:

var texture = new THREE.ImageUtils.loadTexture(image);
texture.minFilter = THREE.LinearFilter;
texture.magFilter = THREE.LinearFilter;
material = new THREE.MeshBasicMaterial({ map : texture });
var geometry = new THREE.PlaneGeometry(width, height);
mesh = new THREE.Mesh(geometry, material);
mesh.doubleSided = true;
parent.add(mesh);

In the code above, the plane geometry width is about 20000 and height about 4000, the texture image is 2000*2000.

Thanks a lot,

Dan

@mrdoob
Copy link
Owner

mrdoob commented May 15, 2012

Also called Moiré pattern :)

Try making the texture 2048x2048 (power-of-2) and using this flag:

texture.minFilter = THREE.LinearMipMapLinearFilter;

@ddanny
Copy link
Author

ddanny commented May 15, 2012

Excellent, thanks!
Do you have any suggestion on the magFilter? I think the requirement for us is that when zooming in, every pixel matters, so maybe no filter at all would be better?

@mrdoob
Copy link
Owner

mrdoob commented May 15, 2012

texture.magFilter = THREE.NearestFilter;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants