OpenGL disable anti-aliasing

The question is simple:
Is there any way to disable anti-aliasing in OPENGL?
I couldn’t find a way to do this, so any suggestion is much appreciated :slight_smile:

You can use noSmooth() function on the setup().
Here is the reference : https://processing.org/reference/noSmooth_.html

noSmooth() doesn’t seem to work with OpenGL or P3D.
I want to use textures and noSmooth() doesn’t affect images.

it’s because aliasing only affect drawing not texture. If you want tu change the aliasing of a image/texture you need to change te texture sampling. You can also desactivate the mipmaps using the hint(DISABLE_TEXTURE_MIPMAPS).

By default, processing use the highest filtering mode GL_LINEAR_MIPMAP_LINEAR for minimfication, GL_LINEAR for magnification and anisotropic filtering. You can change the texture filtering method by using the function textureSampling(int f) where f can be 2 (NEAREST), 3, (LINEAR), 4 (BILINEAR) and 5 (TRILINEAR)

In your case I believe you can use the nearest neighbors filtering mode in order to have an non-aliased texture :

hint(DISABLE_TEXTURE_MIPMAPS);
((PGraphicsOpenGL)g).textureSampling(2);

You can leanr more about texture filtering in processing on the wiki page dedicated to advanced OpenGL : https://github.com/processing/processing/wiki/Advanced-OpenGL also here is a great information about texture filtering in OpenGL https://learnopengl.com/Getting-started/Textures and http://what-when-how.com/opengl-programming-guide/filtering-texture-mapping-opengl-programming/

2 Likes

That’s what I wanted, thanks :blush: