Page 1 of 1

Can we do anti-aliasing with no FSAA?

Posted: Sat Apr 14, 2012 12:05 am
by 10098
Hi folks,

I have a linux pc with an onboard graphics chip which is probably dated, and I want the shapes and lines to appear as smooth as they appear on my new mac. Now obviously the old graphics card doesn't support FSAA. Does Love provide any other method to do anti-aliasing?

Re: Can we do anti-aliasing with no FSAA?

Posted: Sat Apr 14, 2012 9:01 am
by pekka
Well, pixel shaders would be one thing to try. I'll also outline other ideas below.

You can use, for example, to set a 'smooth' linestyle. It doesn't necessarily work, though, because it depends on your OpenGL implementation's support for smoothing. I've had the experience of seeing this thing do nothing at all on some computers.

There's also a similar function for point style.

Another option is to draw the shape a few times using partial transparency. This is more expensive that drawing it once, but you should try it and see if it works fast enough in practice.

One possible way to use it is to draw the same shape in slightly different sizes using a low value for alpha. It ends up appearing most solid where all the parts overlap and on the edges you have this slight gradation from the more solid color to almost transparent where fewer shapes contribute to the color. If you fiddle with the values and placements, you should get something that looks better than completely unaliased drawings.

And finally, you could just use pre-made images that have been smoothed in your favorite graphics program. You can use the PNG image format's support for an alpha channel to make all kinds of nice transparency effects.

Re: Can we do anti-aliasing with no FSAA?

Posted: Sat Apr 14, 2012 7:47 pm
by 10098
Thanks for the reply! One more question, though. Is it possible to somehow determine (from within the lua code) whether FSAA is supported so that I can fall back to those workaround only in that case? I know we can use setMode, but even if setMode returns false, it does not necessarily mean that FSAA is unsupported.

Re: Can we do anti-aliasing with no FSAA?

Posted: Sun Apr 15, 2012 2:09 am
by Boolsheet
The FSAA setting is currently coupled to the function. The nature of OpenGL's mutlisampling would allow this to be separate, but it may have been a design decision to keep this restricted to the window initialization.