Can you improve or change the rendering of textures?

Hi.

I got this zombie. His texture is taken from minecraft so its about 10x20 pixels in size :stuck_out_tongue:

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 :confused:

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 :smiley:



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]