Hi.
I got this zombie. His texture is taken from minecraft so its about 10x20 pixels in size
Problem is, he gets really blurry.
Can I shut off the method that combines nearby pixels and make it take clearer?
As I see it, a pixel on the zombie is decided not from one pixel on the image, but taken
as a combination of nearby pixels using some formula.
I could improve preformance and get better result if I managed to shut it off.
But problem is: I have no idea what or where that rendering is taking place
Is increasing the resolution/quality (size) of the texture an option? Also, you could try scaling it to repeat to provide more detail, assuming itās a āmaterialā like texture that can be repeated. Iād think these options would be a lot easier.
If thereās blending going on and you shut that off (if you even can), itāll just end up pixelated (not any better).
You can use Texture.setMin/MagFilter( Nearest)
Im trying to do:
Material m = MaterialManager.Texture(āZombie.pngā);
Texture a = ImageLoader.Load(āZombie.pngā);
m.setTextureParam(āMagFilterā, Texture.MagFilter.Nearest, a );
Im not too familiar to the setParam system so Im not really sure how to set itā¦
Use the appropriate method on texture (in this case āaā)
AHHH!!
Awsome! It works like a charm
Heres how to do it if someone wants to know.
Gives a transparent accepting material if you just replace textureName with your image name:
[java]
Material mat = new Material(MainClass.getAsset(),"Common/MatDefs/Light/Lighting.j3md");
mat.setTransparent(true);
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
Texture img = MainClass.getAsset().loadTexture(new TextureKey(textureName, false));
img.setMagFilter(Texture.MagFilter.Nearest);
img.setMinFilter(Texture.MinFilter.NearestNearestMipMap);
img.setWrap(WrapMode.Repeat);
mat.setTexture("DiffuseMap", img);
mat.setBoolean("m_UseMaterialColors", true);
mat.setColor("m_Ambient", ColorRGBA.White);
mat.setColor("m_Diffuse", ColorRGBA.White);
mat.setColor("m_Specular", ColorRGBA.White);
mat.setFloat("m_Shininess", 1);
[/java]