Can we do anti-aliasing with no FSAA?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
10098
Prole
Posts: 3
Joined: Fri Apr 13, 2012 11:51 pm

Can we do anti-aliasing with no FSAA?

Post by 10098 » Sat Apr 14, 2012 12:05 am

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?
Space is Fun!

pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

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

Post by pekka » Sat Apr 14, 2012 9:01 am

Well, pixel shaders would be one thing to try. I'll also outline other ideas below.

You can use, for example, love.graphics.setLineStyle 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.

https://love2d.org/wiki/love.graphics.setLineStyle

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.

10098
Prole
Posts: 3
Joined: Fri Apr 13, 2012 11:51 pm

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

Post by 10098 » Sat Apr 14, 2012 7:47 pm

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.
Space is Fun!

User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

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

Post by Boolsheet » Sun Apr 15, 2012 2:09 am

The FSAA setting is currently coupled to the love.graphics.setMode 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.
Shallow indentations.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests