Lines in screen space

I ran into a creative roadblock today, and so eventually gave up and worked on a technical problem, instead: making the engine’s 3D line rendering work using screen-space line widths. That is, if I ask for lines 5 pixels wide, I should get lines 5 pixels wide, no matter how close or far they are from the camera.

This is actually a somewhat tricky procedure; I’m building 3D rectangles which, when viewed from the current camera, appear to be of a single, set width across their whole length. And the way that I’m doing it won’t necessarily work properly in all cases, particularly when a line extends from in front of the camera to behind the camera.

But for the moment, it seems to be working out okay.

What follows is the set of screenshots I took over the course of the day, as I tried to make cursor outlines exactly five pixels wide, regardless of how close or far away the cursor was from the camera. As you can see, there were a lot of failures along the way! (If there’s interest, I’ll post a technical breakdown of how I’m doing this)

Virtually no progress on the MS5 build today, which means that it might be pushed out one extra day, to Sunday. But hopefully no later than that!