[SOLVED] Disabling the Anti-Aliasing in LWJGL/Slick2d Textures

I’ve discovered that LWJGL automatically has anti-aliasing active for 2d textures imported through Slick2d. I’ve been digging around and found that supposedly GL_TEXTURE_MAG_FILTER controls it, but I’m not sure how to disable it, and GL11.glDisable(GL_TEXTURE_MAG_FILTER); didn’t work.

If anyone’s tried disabling the anti-aliasing before and knows how, your help is greatly appreciated!

That is not anti-aliasing but the GL_LINEAR filter which is set by default in OpenGL. There are other types of filters such as GL_NEAREST (the pixelated look).

You can specify which filter to use in Slick2D when loading an image. See the last parameter on the “new Image()” method in the JavaDoc here.

Slick2D has two filter options available Image.FILTER_LINEAR (the default) and Image.FILTER_NEAREST which you can set when loading the Image.

e.g.

Image myImage = new Image("myimage.png", false, Image.FILTER_NEAREST);

Thanks for clearing that up, its all working fine now!

Thank you, I thought I just made my multi-sprite splitter wrong. Works great over here as well! :slight_smile: