Trying to disable texture filtering in in OpenGL
in
Core Library Questions
•
2 years ago
Hey guys, I have a small image that I'm drawing on and then scaling up to the resolution of the screen.
I'm using the OpenGL renderer and would like to set the texture filtering to nearest-neighbor so my pixels don't get all blurry.
I tried the code found in this topic, adding the following code at the beginning of draw():
That forum thread is old enough that something in either Processing or the OpenGL library may have changed since then. Does the aforementioned code no longer work, or am I just doing something wrong?
I'm using scale(x,y) between pushMatrix() and popMatrix() calls, rather than PImage.resize(), if that's likely to make any difference.
I can post my actual code if anyone wants to look at it.
I'm using the OpenGL renderer and would like to set the texture filtering to nearest-neighbor so my pixels don't get all blurry.
I tried the code found in this topic, adding the following code at the beginning of draw():
- GL gl = ((PGraphicsOpenGL)g).gl;
- gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
That forum thread is old enough that something in either Processing or the OpenGL library may have changed since then. Does the aforementioned code no longer work, or am I just doing something wrong?
I'm using scale(x,y) between pushMatrix() and popMatrix() calls, rather than PImage.resize(), if that's likely to make any difference.
I can post my actual code if anyone wants to look at it.
1