britown

Creative-Type Impersonator

🌸请别在工作死🌸


I sometimes like working on never-to-be-finished video game projects


Right now I'm making a game called Chronicles.


Wanna make a game? Here is a list of great C++ libraries to use.


I maintain a Letterboxd in much the way that I assume people maintain bonsai trees.


This is Owen:
Owen
And this is Molly:
Molly
Furthermore, this is Max:
Molly

tomforsyth
@tomforsyth

Beyond textbook Bresenham

Introduction

Every now and then (don't ask) I have to yet again write a subpixel-accurate but NOT antialiased line drawer. In many ways AA lines are much simpler - because every pixel is a different shade, you can't really do anything much cleverer than simple Bresenham and use the distance as an AA coverage/shade index (which is then called Wu's Algorithm: https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm). But today let's talk about non-AA lines - ones where the pixel is either set to the colour, or not.

The other thing I need to do is subpixel-correct lines, because they're so much more nicer in motion than non-subpixel-correct lines. Don't confuse this with AA lines - you can have chunky non-AA single-colour pixel lines that are ALSO subpixel-correct.

Why this is important is hard to convery in a static picture, but in motion the quality difference is very obvious. And it turns out the speed difference is not actually significant, so why not go for the extra quality?


britown
@britown

This is amazing and I'm stealing this for Chronicles


You must log in to comment.

in reply to @tomforsyth's post:

Thanks for the writeup! I didn't go through it too closely just now but I'm bookmarking this, maybe it will finally be the thing I need to finish my little 4kb arm raster grid walking thing that I half built ages ago.