I deliberately go on an all-day caffeine-fueled programming binge and the result is to rewrite the HUD system which I already had working? Jeez.
Okay, so that isn’t remotely what I was planning to work on, but on the other hand, I’m pleased that I got it all functioning the way I wanted it for reals. Today’s work implements a “glass cockpit” system where, rather than just being immediately translated into 2D, points of interest out in the world are actually projected onto a sphere surrounding the player’s seat in the ship. So, if you tilt your head and look around, or move in your seat for whatever reason, the objects in the glass cockpit distort appropriately — note how the waypoint indicator in the bottom right is distorted, being in the corner of the player’s vision. It’s also worth pointing out that rather than being immediately drawn, all HUD artwork is cached and drawn in a single step after drawing the 3D world so it’s easy to sort and apply unique effects to.
The other HUD element, the chain of rectangles, is a “landing corridor” I implemented as a lark a few days ago. It’ll be used when the player is docking with larger ships or doing an atmospheric re-entry: each rectangle has a required speed and orientation, and the player needs to maintain the requested parameters to complete the docking or re-entry successfully. In the near future I’d like to repurpose the 2D text code from Neon Galaxy to draw text onto the HUD as well.
I should also mention that I went back and re-did the lighting so it’s now in model space. Bam, it all worked, just like that, and the math made a lot more sense as well as reducing shader cost.