May 9, 2011
Line Rendering Artifacts

I’m investigating ways of removing nasty little rendering bugs which occur when Maperitive draws something that should be a continuous polyline, but has to be rendered in several separate segments because these segments belong to different layers of painter’s algorithm.

Here’s the bug under the microscope:

I’ve turned the transparency to visualize the actual endings of several line segments. The bug is in the missing pieces of line/curve at the bottom right.

There are some workarounds for it, but of them are perfect. The first one is setting the line-start-cap : round property:

This removes the artifacts between segments, but you end up with an ugly rounded end of lines.

The next one is setting the line-start-cap property to square value:

Now you’ll have nice square end of lines, but you’ll also have new artifacts between line segment joins.

Other possible solutions:

  • Extending each line segment a pixel or two in both directions.
  • Drawing additional joins between unconnected segments once all layers have been drawn. Could be problematic.
  • Some modification of the painter’s algorithm that would allow rendering of polylines as single continuous segments. Now we’re in the SciFi region.

  1. grindsports reblogged this from braincrunch
  2. gorczycajexp593398 reblogged this from braincrunch
  3. braincrunch posted this