Anti Aliasing creates diagonals/triangles

Started by
4 comments, last by jmX 10 years, 5 months ago

Hello,

I made a Java 2D Game, written with the Slick2D + LWJGL Library.

On my Laptop, its perfectly working with Anti Aliasing on an Intel I7 and a HD 4000 Graphic Card

But, when i transfered it one to one to my PC, the Anti Aliasing creates Triangles/Diagonals.

If I turn it off, it works without Problems. (But I need AA)

PC Specs:

Graphics Gard: GTX 680 EVGA

CPU: FX 8350

Picture with AA:
OyPRYum.png

Without:

3VKt6fi.png

Any Help would be appreciated ;)

Regards,

Johnny

Advertisement

How exactly are you drawing those triangles?

I dont draw these Triangles on purpose, they are Rectangles.

I use "org.newdawn.slick.geom.Rectangle" for it.

If I would draw a Circle, you would see Triangles in the Circle.(Basically ever geom is made out of Triangles, and if i turn AA on, you can see them)

Can you see this issue on other apps/games when rendering with the GTX 680?

If not, I would guess that this is a bug in the Slick library.

Niko Suni

No, all other Applications are running without Problems (Battlefield 4, LoL etc.)

Mh, okay...

This is not a bug in the Slick library, this is how line/triangle anti-aliasing works in OpenGL. A rectangle is made of two triangles that share an edge, and along that shared edge each triangle will be writing some of the pixels at partially alpha'd out values. Where these two triangles overlap will cause issues.

In general if you want antialiasing, you'll want to use MSAA, SSAA, or some sort of post processing trick like FXAA. For line art, sometimes the hardware edge AA can be used, but you need to understand where and why it wouldn't be acceptable. Even then, I'm not sure all game grade GPU hardware even supports edge AA (I know NVIDIA gpus do, but not sure about AMD).

Short answer: you're using the wrong type of AA.

This topic is closed to new replies.

Advertisement