Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
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  
  line antialiasing question  (Read 2178 times)
0 Members and 1 Guest are viewing this topic.
Offline skytomorrownow

Junior Devvie





« Posted 2006-09-14 00:10:38 »

the program that created the attached image utilizes OpenGL's built in antialiasing via:

1  
2  
gl.glEnable( GL.GL_LINE_SMOOTH );
gl.glHint( GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST );


however, it doesn't seem to recognize calls to gl.glLineWidth( float lineWidth ) -- all lines are the same size.

in the red book it mentions that this is just a simple calculation of coverage. am i required to implement my own antialiasing routine in order to get better results?
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2006-09-14 04:27:05 »

I'm not sure how many consumer cards implement antialiased lines, at least with varying width. I think this is one of the differences between consumer-grade and professional-grade cards.

You might want to consider using full-scene antialiasing instead, which is much more widely supported. Take a look at the source code for demos.multisample.Multisample in the jogl-demos workspace.
Offline skytomorrownow

Junior Devvie





« Reply #2 - Posted 2006-09-14 04:43:16 »

awesome thanks
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline skytomorrownow

Junior Devvie





« Reply #3 - Posted 2006-09-14 21:14:35 »

first, ken thank you for pointing me in the right direction.

after experimenting with the settings and performance of the built-in opengl anti aliasing, it's pretty darn good. however, my application will be working with cubic bezier curves mostly imported from adobe illustrator. i would like to achieve the anti aliasing quality of adobe illustrator, even at the expense of some performance. i have searched in vain for any under-the-hood discussions of the techniques used by illustrator ( obviously 2D ).

please see attachment.

what makes illustrator's aa so very good? it doesn't appear to be stochastic. opengl's is nice, but even with sixteen samples there are a lot of problems where the lines converge. am i destined to implement my own scheme to achieve similar results?

i have read through the aa sections in Advanced Graphics Programming in OpenGL, Realtime Rendering, and others and they all seem to cover the same territory and techniques. anyone know what makes illustrator's aa so nice? even the name of suggested technique would be a big help.

cheers
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #4 - Posted 2006-09-14 21:49:23 »

I'm not an expert in antialiasing techniques but this article may give you some ideas. I found this with a Google search for "antialiased lines opengl shaders". You might find more help on the forums on opengl.org.
Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #5 - Posted 2006-09-14 22:18:33 »

I'm using line antialiasing and variable widths without a problem here, and I'm running a regular GF 6600 via LWJGL. I find that line-aa tends to give better results for thin geometry over full screen aa, even at high sampling (like the 16 you posted). What kind of hardware were you trying it on? I'd guess that you have a bug in your rendering somewhere - perhaps blending got accidentally switched off?

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

Junior Devvie





« Reply #6 - Posted 2006-09-14 22:59:44 »

i checked my code and the aa seems to be set up correctly:
1  
2  
3  
4  
5  
gl.glEnable( GL.GL_LINE_SMOOTH );
gl.glEnable( GL.GL_BLEND );
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA );
gl.glLineWidth( 1.0f );
gl.glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );


from the console:

1  
2  
GL.GL_LINE_WIDTH_GRANULARITY value is 0.125
GL.GL_LINE_WIDTH_RANGE values are 0.5, 10.0


it definitely works. my card is geforce 6600. i was able to get the code to recognize the line width value finally. i think i didn't set up the blend correctly earlier. it's fixed now.

i think it's more of an aesthetic issue. i'm going to see what's out there in terms of high-end, low-performance aa opengl schemes and share what i find.

thanks ken and orangy
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (148 views)
2017-09-30 02:57:34

theagentd (213 views)
2017-09-26 18:23:31

cybrmynd (296 views)
2017-08-02 12:28:51

cybrmynd (285 views)
2017-08-02 12:19:43

cybrmynd (295 views)
2017-08-02 12:18:09

Sralse (288 views)
2017-07-25 17:13:48

Archive (967 views)
2017-04-27 17:45:51

buddyBro (1093 views)
2017-04-05 03:38:00

CopyableCougar4 (1665 views)
2017-03-24 15:39:42

theagentd (1426 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!