I recently ran into the problem with blender with Low-res textures being blurred when you don’t want them to. There are good solutions to avoid this when using Cycles and Blender Render, but in the game engine, the only good solution seems to be turning off mip-mapping in User Preferences. So if I distribute this blend, everyone who downloads it will have the same problem with blurry textures. Is there a way I can disable mipmapping in python, or Is there a better way of getting crisp pixels in blender without messing with mipmapping?
from bge import render render.setMipmapping(0)
Run that script on any object; an Always Sensor (positive pulse OFF) will do the job. Disabling mipmapping will introduce a small loss of performance, but the fact that you usually couple this with simple low-res textures should be enough to offset this. I’ve used this for several projects, and never had any trouble with it.
Thanks for the response. I have 2 more questions:
First, is there a better way of making pixels sharp without turning off mipmapping? I get those weird lines when looking at a texture from a distance, so is there a ‘best of both worlds’ option with both sharp pixels and mipmapping?
Second, does not mipmapping hurt performance? According to Wikipedia’s page on mipmapping “(Mip Maps) also improve the scene’s realism, at the cost of 1/3 more memory per texture.” According to this article, mipmaps increase texture memory? Thanks for any help.
Keep mip-mapping but avoid automatic mip-map texture generation by providing your own mip-map textures as .dds files. You can create them with Gimp and the DDS plugin.
Yes, mip-mapping increases memory -due to the additional (but much smaller textures).
Unless you fill up your GPU memory with really large textures which forces constant reload/replace it is even faster than without mip-mapping.
Maybe you could figure out Minecraft’s system? It uses Mipmapping, but closest pixels are very, very sharp.
The moire pattern is particly fixed with anisotropic filtering, AFAIK.