We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Turn of antialiasing for textures
Page Index Toggle Pages: 1
Turn of antialiasing for textures? (Read 735 times)
Turn of antialiasing for textures?
Dec 16th, 2005, 1:02pm
 
Hello!

I'm using opengl to draw scaled images. My problem is that opengl anti aliases those images by default, but i'd like to draw aliased.  

Is there a way to disable anti aliasing?


I tried:
GL gl = ((PGraphicsGL)g).gl;
 
gl.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR_MIPMAP_NEAREST );
gl.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_NEAREST );

which results in GL_ERROR at top endFrame(): 0500  GL_INVALID_ENUM


Thanks in advance, hansi.
Re: Turn of antialiasing for textures?
Reply #1 - Dec 16th, 2005, 4:38pm
 
Okay, i found the (rather complicated) solution:

first you have to bind the texture using
gl.glBindTexture( ... )
then set the parameters for magnifying
gl.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST );  
and then use
gl.glTexImage2D( ... )
to overwrite the image data.

Then the texture is displayed aliased.
Page Index Toggle Pages: 1