Gah, no wonder the output looked wrong for the triangles, they only covered half the pixel. So separate triangles into two cases.