🏠

Fonts. Baking. Hats.

2024-08-18 / Mark Sowden


← 2024-08-042024-09-01 →

It's been a little quieter these past two weeks as I've been a little burnt out with things. My brain has also gone into it's "overdrive" mode where I have a billion things going through my head and end up doing nothing.

Font Tool Refinements

Fairly boring, but the tool I wrote a while back to generate new fonts for the engine was updated to use the FOX Toolkit rather than GTK for the interface.

The default filenames used on output are a little cleaner now too, with it including the specific properties you set for the font.

Screenshot showing the fonts generated by the tool.

It's just essentially something I'm getting for free as I needed to generate a string based on the selection to describe what font I want to Pango anyway, which in combination with Cairo handles all the initial font rendering for generating the files.

I did stumble upon some issues when experimenting with much larger fonts, so I'll need to look into that at some stage. Character packing needs some considerable improvement too.

Baked Vertex Lighting

As mentioned in the previous post, I'm aiming for something akin to the original Spyro trilogy visually—and that being a game on the PSX, it obviously depended on vertex shading to convey lighting.

AniCator notified me that it's possible to bake lighting produced via the Cycles renderer in Blender into a vertex channel, which would save me the time to write my own tool to do this.

After a little bit of work, I updated the cook tool, world serialisation, deserialisation and shaders to support vertex colours for the world geometry. You can see the initial results of that below.

Screenshot showing baked lighting per-vertex. Screenshot showing baked lighting per-vertex.

It's a little rough in a few spots, but that's mostly just because of my terrible modelling skills than anything, and this is just a test environment anyway. Mind that the textures in the above shots were borrowed from Spyro for testing too.

An observation was that it didn't appear that the normals were being respected when baking the lighting. Turns out I needed to apply my edge split modifier for that to work right.

Screenshot showing Blender perspective after baking the light w/ modifier applied.

Below is another in-engine screenshot after some further experimenting and baking with the edge split modifier applied.

Screenshot showing baked lighting per-vertex.

Of course, applying the modifier is a destructive process, but I don't think it bothers me too much—I'll just have to be sure to save a new copy of the geometry before applying lighting. Unless someone smarter and more familiar with Blender knows a better way to handle this.

That said, I'm not quite sure yet how I'm going to handle object lighting with this setup right now. The geometry is all exported to Wavefront OBJ (turned out vertex colours are non-standard per OBJ, so that's great), so we're not retaining any scene information such as lights.

I don't want to write my own plugin for Blender, as mentioned before, either.

There are a few solutions such as glTF. But I like to keep things simple and, probably a hot take, but I don't like that glTF depends on Json. What I'm currently looking at is ufbx, but I'm probably not going to explore this for a little while yet.

Helmet Design

I started experimenting with a different helmet design (refer to this if you want to see the old design). Mind it's obviously unfinished, and I'm still unsure.

New design from the side. New design from another angle.

If you were a species with big long ears, how would you design your hats and helmets?

I'd considered they would probably just leave them sticking out, maybe with a slot for them to poke through to aid in supporting the helmet or hat. But they're a bit of a target still, aren't they?

I'm not too keen on folding or hiding the ears however, because I feel keeping the ears visible helps with their identity. Perhaps they just don't care. There are some possible lore explanations for this I could already use...

But yeah, I'm not too sure on this right now.

Tick Tock

Previously, the tick rate for the simulation was fixed at 16ms.

I've now added a tickFrequency console variable that allows you to control the tick rate, so it's now possible to slow things down or speed them up if desired. This will make testing some things a little easier.

I also introduced a renderTimeLock (couldn't come up with a better name) variable which caps the rendering to the tick rate. This is now enabled by default.

The reason for the latter is that there is currently no interpolation whatsoever by the renderer, so it's just wasting time rendering as fast as it can. Eventually, it's something I would like to do, but until then it's just wasting cycles and is nothing more than a useful tool for profiling, for now.

Closing Thoughts

As mentioned, it's been quieter these last two weeks. I'm stuck in one of my weird mindsets. I'm thinking about the TalonBrave.info site and how I don't feel like it's getting enough attention from me. And then I'm thinking about many other projects that need my attention.

It ends up with a lot of frustrations and nothing happening. And it feels like it's got worse with age, probably because of how limited my time is now.

That said writing this blog is helping me put things a little more in perspective so it doesn't feel that hopeless.

And on a happier note, I think I've settled on a more formal name for the project, rather than 'Project SS1', which is what I had been calling it internally. Not quite ready yet to reveal until things are a bit further along. But hey, that's out the way. Names are hard...

Anyway, if you've made it this far, thanks so much! Keep happy and healthy!

← 2024-08-042024-09-01 →