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?
Can we do anti-aliasing with no FSAA?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Can we do anti-aliasing with no FSAA?
Space is Fun!
Re: Can we do anti-aliasing with no FSAA?
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.
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.
Re: Can we do anti-aliasing with no FSAA?
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!
Re: Can we do anti-aliasing with no FSAA?
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.
Who is online
Users browsing this forum: No registered users and 1 guest