← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/beautiful_correct_lines into lp:widelands

 

The proposal to merge lp:~widelands-dev/widelands/beautiful_correct_lines into lp:widelands has been updated.

Commit Message changed to:

Fixes line drawing by replacing the broken use of GL_LINES with a tessellation algorithm for drawing lines. This makes lines beautiful and correct on any GPU, but it also makes line drawing costly - this is visible in the statistics menu for the most part. 

We are drawing a line segment as two triangles. The width of the lines is found by calculating the normal of a line and pushing the vertices of the triangles along this normal. At line segment joints, we draw a circle with the radius of the line width to join the lines. Lines can optionally be antialiased in which case we just draw a 2-pixels wider line with a lower alpha value before drawing the line.

I also experimented with miter joints which works very nicely for large intersection angles, but pushes the line beyond its boundaries for smaller ones. I found that for Widelands, the lines + circles work better.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/beautiful_correct_lines/+merge/284517
-- 
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/beautiful_correct_lines.


References