Opengl Antialiasing
in
Share your Work
•
3 years ago
I came across this technique in the old forums and thought I would re-post it here for anyone desiring OPENGL smoothing.
- GL gl;
PGraphicsOpenGL pgl;
boolean click = false;
import processing.opengl.*;
import javax.media.opengl.*;
public String rmode = "OPENGL";
void setup(){
if(rmode=="OPENGL")size(255,255,OPENGL);
if(rmode=="P3D")size(255,255,P3D);
frameRate(3000);
lights();
// hint (DISABLE_DEPTH_TEST);
hint(DISABLE_OPENGL_2X_SMOOTH);
hint(ENABLE_OPENGL_4X_SMOOTH);
if (rmode == "OPENGL"){
pgl = (PGraphicsOpenGL) g;
gl = pgl.gl;
gl.glHint (gl.GL_LINE_SMOOTH_HINT, gl.GL_NICEST);
gl.glEnable (gl.GL_LINE_SMOOTH);
}
if (rmode == "P3D"){
smooth();
}
}
void draw(){
background(0);
//Insert code here
}
2