[126] Latent Performance
- Conlan Walker
- Apr 26, 2024
- 2 min read
I did two things this week (though most of the work on one of them is from last week) that I can definitively name.
The first thing I did was start working on a software renderer that doesn't use floats, while fixing the very last bug of my triangle rasterizer that also doesn't use floats.
I've already shown the rasterizer doing an overdraw test, so I won't bother showing that again.
though I did overhaul the rasterizer's API.

However, I will show the format I made, as well as its converter.

It's an incredibly simple format (or at least it's simple to parse), any yet it's capable of storing vertex data, and triangles with vertice indexes, surface normals, midpoints, and a color associated with each triangle.
I use an older version of Model explorer, so I'm not sure if they added this feature yet, but there is no support for fixed point numbers, so I'm using signed shorts here, while truncating the higher two bytes.
The model shown in that hex editor view is the data for this model, which is an incredibly simple convex ship. I made it convex so that I wouldn't need to z-sort the mesh's triangles when rendering it on-screen.

While I did make most of the renderer, the vertex transformation functions seem to not work, so they'll need to be fixed.

Here is the code for the converter (note how I'm able to reuse my old .obj parser for this :D)

The main thing I did though, Is work on tilesets, while implementing tile rendering and layers.
I've only made sprites/spritesheets once before, and the last time was 5 years ago, sometime in mid-2019. With that in mind, I don't think the sprites I made this week are all that bad, in that you can at least tell what they're supposed to be, which makes them feasible to use.
At first, I knew I had to actually make some stuff for the spritesheet to use, but I couldn't think of anything, so I came up with the idea to work backwards to find that idea. In other words, I'd draw something random, and think of something that resembles/reminds me of another thing, kinda like watching clouds and making out a picture from their shape.
The first couple of iterations started reminding me of ice, so that's what I ended up doing.

I also made a few more sprites for this spritesheet here:

Here's a demo that showcases not only tileset rendering and layering, but also positional audio, using a short 8-bar melody I made for Protracker, which is limited to 4 channels:
(I also used only a single sine wavetable as an instrument, which was even more limiting.)
I'll only show the source files I added/changed, since "player.cpp" and "player.hpp" were untouched, if I recall correctly:
Comments