Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (855)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Anti-aliasing in JOGL  (Read 8937 times)
0 Members and 1 Guest are viewing this topic.
Offline rkwright

Senior Newbie





« Posted 2008-09-13 23:20:02 »

I was looking closely at some of my rendering and even though I think I have enabled all the right things, I am not seeing any anti-aliasing of my filled polygons.  I have

      gl.glEnable(GL.GL_LINE_SMOOTH);      
      gl.glEnable(GL.GL_POLYGON_SMOOTH);
      gl.glHint(GL.GL_POLYGON_SMOOTH_HINT, GL.GL_NICEST);

But this does nothing.  Does one have to descend down in multi-sample pixel twiddling and using all those proprietary extensions?  I am spelunking around and doing more reading, but thought I would post this question as well.

TIA
Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #1 - Posted 2008-09-14 00:08:19 »

Those commands enable edge anti-aliasing, which IIRC requires you to set up blending to work. You also need something like:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

And since you're using blending you need to sort your geometry for proper results.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Chris61182

Junior Devvie





« Reply #2 - Posted 2008-09-14 00:59:37 »

There might be some helpful hints here...

http://www.java-gaming.org/topics/antialiasing-question/18119/msg/142271/view.html
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ultraq

Junior Devvie




That's what she said


« Reply #3 - Posted 2008-09-14 01:43:54 »

I think you also have to enable multisampling if it's supported:

if (gl.isExtensionAvailable("GL_ARB_multisample")) {
   gl.glEnable(GL_MULTISAMPLE);
}

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline rkwright

Senior Newbie





« Reply #4 - Posted 2008-09-14 14:21:11 »

Ah, so simple.  I hadn't enabled the sampleBuffers in glCapabilities.  RTFM!   Wink

Now it works fine. Seems like anti-aliasing should be on by default, but perhaps there is a good reason not to enable by default.
Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #5 - Posted 2008-09-14 14:26:40 »

That's full-screen antialiasing, which is entirely different from the edge anti-aliasing commands you posted originally. You almost certainly don't want both enabled at the same time, pick one and go with that.

Full screen anti-aliasing is more robust (and doesn't require sorting) and usually gives higher quality, but it'll be slower and available on less hardware.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Abuse

JGO Ninja


Medals: 70


falling into the abyss of reality


« Reply #6 - Posted 2008-09-14 14:38:46 »

That's full-scene antialiasing, which is entirely different from the edge anti-aliasing commands you posted originally. You almost certainly don't want both enabled at the same time, pick one and go with that.

Full scene anti-aliasing is more robust (and doesn't require sorting) and usually gives higher quality, but it'll be slower and available on less hardware.

 Grin
Offline rkwright

Senior Newbie





« Reply #7 - Posted 2008-09-15 17:48:37 »

Understood.  This has been quite interesting.  Turns out as well that the driver for my card was old.  The card is nothing special, an ATI X1900.  But the driver is what came with the machine rather than an update from ATI.  I installed the update from ATI and it came with a lot of fine-grained choices.  Among them was whether or not to allow applications to control anti-aliasing. As expected, with per-app AA disabled, it doesn't matter what the glCapabilities is set to.   With it per-app AA enabled, it does.

in either case, performance was the same no matter what settings I used, which probably only indicates that 3D rendering is not gating it.  Profiling indicates that the GLU Tessellator is the gating factor, which makes sense to me given the complex 3D "stroking" that I am doing.  It would be nice if the GL library offloaded tessellation to the GPU.  Does anybody know if this can be done, perhaps some extension that I don't know about?

Thanks to everybody for the useful info.
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1572 views)
2018-06-10 19:43:48

EgonOlsen (1632 views)
2018-06-10 19:43:44

EgonOlsen (1144 views)
2018-06-10 19:43:20

DesertCoockie (1572 views)
2018-05-13 18:23:11

nelsongames (1173 views)
2018-04-24 18:15:36

nelsongames (1639 views)
2018-04-24 18:14:32

ivj94 (2395 views)
2018-03-24 14:47:39

ivj94 (1605 views)
2018-03-24 14:46:31

ivj94 (2691 views)
2018-03-24 14:43:53

Solater (883 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!