Page 1 of 1

Rough Lines vs. Smooth Lines

Posted: Mon Aug 27, 2012 5:06 pm
by racarate
I just finished a LD with a few other people, one of which was using LOVE2D. His game :

http://www.ludumdare.com/compo/ludum-da ... &uid=12413

Was mostly line-based, and in the final few hours I watched him tweak his graphical settings.
There was one point though, were he was switching the line style from 'rough' to 'smooth' and it was really hard to tell the difference.

I was really curious about what was going on under the covers -- I assumed there was some old OpenGL state for line drawing that this was encapsulating -- and I was surprised to find that it is in fact a custom implementation of anti-aliasing!

My question is -- what is the advantage of using a custom line AA function instead of using GL_LINE_SMOOTH or GL_POLYGON_SMOOTH?

Also, what are some common use cases for this graphics knob? Is it just to get an AA look without the overhead of a full-screen pixel effect?


-Nick

Re: Rough Lines vs. Smooth Lines

Posted: Tue Sep 04, 2012 3:06 pm
by Boolsheet
It used OpenGL lines before LÖVE 0.8.0. It was changed to a custom polygon line to get the same scaling behaviour for everything. It's not possible to do it with the OpenGL-line width and the implementations have different limits anyway. That also meant GL_LINE_SMOOTH is gone so vrld wrote the overdraw anti-aliasing function.
Also, what are some common use cases for this graphics knob? Is it just to get an AA look without the overhead of a full-screen pixel effect?
Pretty much. It needed to run on OpenGL 1.1 and look somewhat similar to the effect of GL_LINE_SMOOTH.

Other polygons than lines are not anti-aliased like this. GL_POLYGON_SMOOTH is horribly slow in some implementations.

Re: Rough Lines vs. Smooth Lines

Posted: Tue Sep 04, 2012 9:24 pm
by racarate
Awesome, thanks for the background. Reading LOVE source always teaches me something new.