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 & HelpSyntax Questions › How to you turn on OPengl smoothing
Page Index Toggle Pages: 1
How to you turn on OPengl smoothing ? (Read 1247 times)
How to you turn on OPengl smoothing ?
Apr 19th, 2010, 9:12am
 
I use the following

[code]
import processing.opengl.*;
void setup(){
size(200,200,OPENGL);
noSmooth();
HINT(DISABLE_OPENGL_2X_SMOOTH);
HINT(ENABLE_OPENGL_4X_SMOOTH);




}

[code]

.. to no affect. Smoothing works great with P3D

What am I doing wrong ?
Re: How to you turn on OPengl smoothing ?
Reply #1 - Apr 19th, 2010, 10:38am
 
smooth() should work fine in OpenGL, as should the generic hints for antialias
There are some special things if your using the Fullscreen library.

Some of the more advanced commands would look something like this...
gl.glHint (gl.GL_LINE_SMOOTH_HINT, gl.GL_NICEST);
gl.glHint (gl.GL_POINT_SMOOTH_HINT, gl.GL_NICEST);

gl.glEnable(gl.GL_POINT_SMOOTH);
gl.glDisable(gl.GL_POINT_SMOOTH);

gl.glEnable(gl.GL_LINE_SMOOTH);
gl.glDisable(gl.GL_LINE_SMOOTH);
Re: How to you turn on OPengl smoothing ?
Reply #2 - Apr 20th, 2010, 4:54am
 
Thanks jeffg.

Can you post some code that I can try this snippet and see how it works ?
Re: How to you turn on OPengl smoothing ?
Reply #3 - Apr 20th, 2010, 6:55am
 
This certainly get's into more direct OpenGL and the simplicity of direct Processing code, but here it is...
Code:
import processing.opengl.*;
import javax.media.opengl.GL;
GL gl;
PGraphicsOpenGL pgl;

void setup(){
 size(200,200,OPENGL);
 hint(DISABLE_OPENGL_2X_SMOOTH);
 pgl = (PGraphicsOpenGL) g;
 gl = pgl.gl;
 gl.glHint (gl.GL_LINE_SMOOTH_HINT, gl.GL_NICEST);
}

void draw() {
 pgl.beginGL();
 gl.glEnable (gl.GL_LINE_SMOOTH);
 gl.glLineWidth(4.0);
 gl.glBegin(gl.GL_LINES);
gl.glColor3f(0,0,0);
gl.glVertex2f(0,0);
gl.glColor3f(0,0,1);
gl.glVertex2f(width,height);
 gl.glEnd();
 gl.glDisable (gl.GL_LINE_SMOOTH);
 pgl.endGL();
}
Re: How to you turn on OPengl smoothing ?
Reply #4 - May 17th, 2010, 11:40am
 
Thanks jeffg.
Page Index Toggle Pages: 1