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 › worse antialias on 1.0.6 than 0135, os x - SOLVED
Page Index Toggle Pages: 1
worse antialias on 1.0.6 than 0135, os x - SOLVED (Read 3929 times)
worse antialias on 1.0.6 than 0135, os x - SOLVED
Aug 21st, 2009, 9:05am
 
Hi,
I have to keep on using Processing 0135 beta, because versions > 1.0 are doing a very different (and much worse) opengl antialias to me.
Here's an example:
...

Here's a quite trivial example code for this issue:

Code:

import processing.opengl.*;

void setup() {
 size(320,240,OPENGL);
 hint(ENABLE_OPENGL_4X_SMOOTH);
}

void draw() {
 background(255);
 stroke(0);
 fill(0);
 ellipse(50,50,30,30);
 ellipse(220,160,10,10);
 line(50,50,220,160);
 ellipse(50,180,20,20);
 ellipse(220,60,14,14);
 line(50,180,220,60);
}


I have a MacBook Pro, latest generation, but this problem occurred even on an Intel Mac Mini Core 2 Duo.
Any hints or ideas?

Thank you
Fabio
Re: worse antialias on 1.0.6 than 0135, mac os x
Reply #1 - Aug 21st, 2009, 11:25am
 
I had a similar - but - opposite issue -- trying to disable the automatic 2X smoothing in 1.0.x.  I finally solved it with:

Quote:
  size(750,550,OPENGL);
  hint(DISABLE_OPENGL_2X_SMOOTH);
  noSmooth();
  resize(750,550);


(Resize forces p5 to reinitialize the renderer using the new hint() parameters.)  Of course in your case you'd keep ENABLE 2X or 4X, and smooth() rather than noSmooth()...

Shot in the dark, hope it helps. -- Ben

[edit: my problems are back for some users, so this might not help at all, actually.]
Re: worse antialias on 1.0.6 than 0135, mac os x
Reply #2 - Aug 24th, 2009, 4:15am
 
I found a way to solve it!!
Thanks to your code, I tried to tinker it up a bit and finally came to a solution.
Re: worse antialias on 1.0.6 than 0135, mac os x
Reply #3 - Aug 24th, 2009, 4:32am
 
Here's the solution:
It seems that Processing 1.0.x is in fact forcing an opengl 2x antialias, which sucks, even if you specify the 4x or the smooth().
So the way to go is first to disable this 2x antialias, and then go with enabling 4x antialias or smooth() which is working even better. It didn't matter to use resize().

Code:
  
void setup() {
 size(320,240,OPENGL);
 hint(DISABLE_OPENGL_2X_SMOOTH);
 //hint(ENABLE_OPENGL_4X_SMOOTH); //after disabling the 2x this works fine
 smooth(); // this works even better than the 4x! super-smooth! ;)
}


See it for yourself:

...
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #4 - Aug 24th, 2009, 5:36am
 
great, thx Fabio for letting us know.
the last one really looks much better.
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #5 - Nov 4th, 2009, 1:19pm
 
For those that are also concerned about performance, here are some tips I've learned.

Don't run these globally for your app by putting them in start();
Code:

smooth();  // I believe smooth() enables the two commands below
gl.glEnable (gl.GL_LINE_SMOOTH);
gl.glEnable( gl.GL_POLYGON_SMOOTH);

Instead put smooth() or the OpenGL equivalents around only the code that you want to be anti-aliased.  Along with their closing noSmooth(); or gl.glDisable(....);  

For example, I have 20,000 lines in my sketch, but I only need about 500 anti-aliased at any particular moment.  So by doing the above method, I'm able to increase performance by 50%.
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #6 - Nov 5th, 2009, 5:40am
 
fabio, have you put in a bug ticket for this?
http://dev.processing.org/bugs
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #7 - Dec 15th, 2009, 7:29pm
 
I placed a bug report.
http://dev.processing.org/bugs/show_bug.cgi?id=1413
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #8 - Jan 7th, 2010, 12:16pm
 
I've tried using the codes described above.

I'm having better luck changing the settings in Nvidia Control Panel (PC geForce GTX 260 card) and forcing the antialias to 4x or even 8x.

Smooth edges on polygons Smiley
Re: worse antialias on 1.0.6 than 0135, os x - SOLVED
Reply #9 - Jan 7th, 2010, 1:51pm
 
I'd like to see someone implement an example of the Fast Prefiltered Antialiasing Technique for Lines

Uses filters...

Posted in this thread
http://processing.org/discourse/yabb2/?num=1262710015
Page Index Toggle Pages: 1