MoteMancer took a very long windy road to end up in the aesthetic pipeline of today. I initially planned on the game being completely 2D, because it seemed logical for the camera perspective I was aiming for. There was a lot of promise in that direction, especially since I thought I could balance performance and aesthetics cleanly. But the best laid plans of mice and men gang aft agley.
Tilemaps and Terrain
I think I could have genuinely gotten away with using Tilemaps to solve the terrain in the game, but only if it was one plane, not 6. Keeping track of every single tile instance in the game using Unity's Tilemap system proved to be Very performance intensive, and ultimately not sustainable. I even had some really awesome early tests where I could prove non-repeating tessellation using tiles like this:

Ok, it's ugly, but I'm still proud of it mathematically
Alas the sheer quantity of tiles needed was not tenable, but it opened up a new avenue - 3D meshes for ground and all the interesting shader options that become available with that as a foundation.
3D Meshes with Sprites?
Mesh based terrain had a lot of upsides, it scaled nicely, it forced me to make chunks of terrain which was going to be needed anyway, it taught me that pointy-top hexes make flat-top chunks, which was just a fun "didn't see that coming" thing, that becomes obvious after you stare at it.

It does come with a major downside though - Meshes don't sort the way sprites do. Up until that point i had relied on the simplicity of vertical and horizontal sprite sorting, and Meshes introduced this new paradigm that had to be dealt with. It was easy enough at first, but I quickly realized that I needed to blend the two together in order to get clean coastlines. so now my sprites and meshes both needed rendering orders, but spatial depth orders as well.
It's pretty complicated, since sprites form the chasm walls and chasm tops to cover up the seams, you still need to build the tilemaps as if that's what you are using, but then throw them away once you've generated the baked sets. Plus you have to have different sets of rules for what types of shapes or intersections are allowed, much more nuanced than just the usual 64 options as discussed in the first Working with Bestagons. The benefit of this is we get to use multiple variants per shape, so we can mostly give the chasms the randomness we want, but the combinatorics of tops and walls help a lot to break it up.

What About Lighting?
Lighting is really rough at the moment, in order to achieve this pipeline we need both 2D and 3D renderers active, and both of those pipelines obey their own lighting paradigms. This is why if you walk up to the coastline, you might notice that the chasm edges get much brighter than they should compared to the terrain (one is 2D and one is 3D).
Delightfully, Unity 6.3 just announced their release with two super relevant updates - you can render 3D objects as 2D, and the lighting pipeline is completely exposed to manipulate inside shaders. Usually changing software versions on a live project is scary, but between a smattering of performance improvements and the two features above, it's going to be hard to ignore.
MoteMancer already does some really significant shader manipulation through stenciling and mask passes, I'm looking forward to seeing how the new upgrade will harmonize the rendering pipeline, which in turn should improve performance and aesthetics across the board.
Back to the lab! 🌿
~CyanAvatar
