Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
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  
  [LWJGL] Anti-Aliasing? How does it work  (Read 1238 times)
0 Members and 1 Guest are viewing this topic.
Offline orange451

JGO Coder


Medals: 11
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Posted 2013-11-22 01:08:47 »

I wanted to try to add some sort of Anti-Aliasing to my current Java project, but I haven't a clue where to start. My question is, in LWJGL is AA a shader? Or is it a toggle-able option?

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
Offline wessles

JGO Wizard


Medals: 67
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #1 - Posted 2013-11-22 01:20:38 »

LMGTFY  Wink

Offline orange451

JGO Coder


Medals: 11
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Reply #2 - Posted 2013-11-22 01:43:14 »

Not only does that not answer the question I asked in my topic, but I find that the use of "let me google that for you" is quite condescending. Obviously I googled the topic before posting; if I found google helpful I wouldn't have created a post in the first place.

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline wessles

JGO Wizard


Medals: 67
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #3 - Posted 2013-11-22 01:56:21 »

Sorry, I apoligize for that.

But shouldn't you be able to find that out through google anyway?
I mean, I just googled 'is anti aliasing a shader,' and it came up with 'FXAA - shader based anti-aliasing.' So from that, you can tell that AA shaders exist.

But, yet another result 'Antialiasing' shows that it could also be a list of settings enabled in OGL.

So from this googling, we can gather that AA is a look that you want to achieve. It can be through Shaders, or plain OGL.

Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #4 - Posted 2013-11-22 01:57:24 »

NEHE Anti-aliasing Apparently its been around for a while! You can perform AA with both pipelines, but I quite honestly wouldn't know where to point you to start! I guess you could use NEHE, but I wouldn't recommend it.

Offline theagentd
« Reply #5 - Posted 2013-11-22 02:02:52 »

It depends on what you want to apply it on.

 - For geometry primitive edges, multisampling is the standard. Useless for most 2D.
 - For textures, it's linear filtering and mipmaps.
 - For 2D lines and points without depth testing, you can use the GL_LINE_SMOOTH and GL_POINT_SMOOTH enables.

FXAA is simply a hack for making the image suffer less from jagged edges by blurring them in a somewhat smart way. It doesn't help with pixel-sized problems since there's not enough sub-pixel information. Multisampling helps with this by storing multiple values per pixel and then averaging these together at the end for the final pixel color. However, it only applies this to triangle/line/point edges, so if you have a shader or an unfiltered texture applied to your geometry it won't help at all. For textures, proper filtering is required, especially when downsampling textures, which is what mipmapping solves.

Myomyomyo.
Offline davedes
« Reply #6 - Posted 2013-11-22 14:48:56 »

If you are looking for anti aliased lines, see here:
http://www.java-gaming.org/topics/lwjgl-antialiased-lines/30894/msg/285889/view.html#msg285889

For general primitives, theagentd pretty much summed it up.

An easy alternative for static geometry is to use Java2D as your polygon rasterizer -- draw to buffered image and copy to GL texture. Obviously only possible on desktop.

Offline Mike

JGO Wizard


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #7 - Posted 2013-11-22 19:03:56 »

Something like this?
1  
2  
3  
4  
5  
if (settings.useAA()) {
    Display.create(new PixelFormat(32, 0, 24, 0, 4));
} else {
    Display.create(new PixelFormat(32, 0, 24, 0, 0));
}


That's how it looks like in my game Smiley

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #8 - Posted 2013-11-22 19:09:55 »

Something like this?
1  
2  
3  
4  
5  
if (settings.useAA()) {
    Display.create(new PixelFormat(32, 0, 24, 0, 4));
} else {
    Display.create(new PixelFormat(32, 0, 24, 0, 0));
}


That's how it looks like in my game Smiley

Mike

On some (weird) graphic setups this can throw a exception.
When it does, make sure you call display without aa.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

theagentd (18 views)
2014-10-25 15:46:29

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (45 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!