Textures degrading when zoomed out - question

Just starting to play with textures. Changed the source of HelloStates and HelloKeyInput to use a grass texture I have. When zooming right out the texture seems to become ‘sparkly’ when moving the camera.

Here is the 256x256 .tga I was trying:


I also tried resizing this to 128x128 and it helps a bit but also becomes sparkly when zooming right out.


These are both 24bit. Are there any options I can set in the states to prevent this odd effect from taking place? I need to keep the textures quite small, 128x128 if possible seeing as I will be using hundreds of them and they will be mapped onto ‘tiles’ and the game view will be quite zoomed out.

I also tried to make the object much bigger but this made no difference.



Sounds like mipmapping is not turned on and you want the "blurring" effect at a distance that it provides.

Make sure you have mipmapping set when creating your texture. (You can post your texture creation line if you need help).

My texture line started out as:

Texture t=TextureManager.loadTexture(monkeyLoc, Texture.MM_LINEAR, Texture.FM_LINEAR,true);

I tried MM_NEAREST, MM_NEAREST_LINEAR and MM_NEAREST_NEAREST but those also give the sparkle effect.

MM_LINEAR_NEAREST was a lot better but not quite there.

I found MM_LINEAR_LINEAR to give the best result and works well with a 128x128 texture as well. One thing I would like to do is reduce the blurring a little as the texture can get quite fuzzy so I will play around with the other settings like filter, apply and correction.

Thanks for the help Mojo.

I also noticed AM_DECAL in the docs - does this have anything to do with decals? I need to blend other textures into the grass (like a road) and it was mentioned in another post that decals were good for this but not in jme yet. Is there an alternative if decals arent in?


monkeyLoc is a URL right? try using:

Texture t=TextureManager.loadTexture(monkeyLoc, Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 1.0f, true);

Thanks renanse, yes it is a URL. I tried your line but that prototype and the GUESS_FORMAT_NO_S3TC constant only seem to be in the cvs version of jme and I am using the latest release version.

In any event what I have so far will do nicely until I get the cvs version of jme compiled - I have kept your line in a comment in my code so I can play with it then.

Cool, yeah I kinda wondered about that since your method signature was dropped in cvs. Good luck!