Rough Lines vs. Smooth Lines

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
User avatar
racarate
Prole
Posts: 34
Joined: Wed May 02, 2012 12:37 pm

Rough Lines vs. Smooth Lines

Post 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
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Rough Lines vs. Smooth Lines

Post 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.
Shallow indentations.
User avatar
racarate
Prole
Posts: 34
Joined: Wed May 02, 2012 12:37 pm

Re: Rough Lines vs. Smooth Lines

Post by racarate »

Awesome, thanks for the background. Reading LOVE source always teaches me something new.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 83 guests