Ack dots! [ANSWERED]

My code is simple

function ship()
    stroke(40, 0, 255, 255)
    -- smooth()
    --  lineCapMode(ROUND)
    --  scale(5)
    line(-10, -10, 0, 20)
    line(0, 20, 10, -10)
    line(10, -10, 0, -5)
    line(0, -5, -10, -10)
    line(50, 50, 100, 100)
    line(50, 100, 100, 50)

Dots! Dots at each vertex. But tellingly - no dot where they cross. That’s what I want - no dots. I tried all sorts of combinations of fill/no fill/smooth/no smooth/etc and still, dots! The bit invader example? Dots. (or weird artifacting)

How can I do clean lines that intersect at their ends without dots? (with the fonts, I go no smooth, and keep strokeWidth very low - but things end up kinda pastel, not as bright as I’d like. I can get bright, but then -dots!)

Bah. My code will never format correctly. What is the secret???

The secret is to use four spaces of indentation before each line you want rendered as code. I edited your post to correct this (You were using three spaces).

I’m guessing the dots are due to the way ROUND capped lines are rendered. Have you tried




They produce different artifacting- square makes a quad of tiny dots (looks like an XOR) at small scales, and project … Does what you’d expect, they project beyond the end.

I think scale() makes the artifacting worse, going up - I’m going to try drawing it Big, the using a fractional scale to make it smaller…

That works better. Drawing an order of magnitude larger, square end caps, strokeWidth(15) - then shrink it with scale(0.1) and it shrinks the artifacts so you can’t see them. W00t

I imagine that causes aliasing. I think Dylan mentioned he might have another look at the line shaders. It must be due to the overdraw on intersection.

It does - but I’m happier with aliasing than I am with blobby ships, at least for what I am working on right this moment.

I was just playing with your code, and thought these options looked good:


It’s aliased, but your ship and cross look well defined.


Looked anti-aliased and minimized the “blobbiness” – it just appears to be the antialiasing. I don’t think there’s much we can do about it.