My head hurts

I’ve been quite sick for most of the week, but am finally starting to feel well enough to write a little bit of code again.  Today, I’ve added a few improvements to the dynamic geometry generation code.

First, I’ve fixed up some problems regarding the generation of normals on the geometry (which makes the lighting work better on the generated geometry), and I’ve fixed things so that on towers, I can have horizontal hard edges, instead of only vertical hard edges.  (And vice versa, on walls which are extruded along the ground).

Here’s a pair of images showing what I mean (old is on the left, new is on the right):

OldNew

Sorry that the lighting isn’t the same in the two images;  I was a little careless while taking screenshots.  If you can ignore that difference, you should still see how the new behaviour correctly makes the “cap” on the top look properly flat, instead of smearing the lighting from the sides across the top of the object, and the tops of the gear pieces are now far more “crisp” than they were originally, because they have hard creases at the edges, which weren’t possible using my old system of generating this geometry.

For anybody with a technical bent, It’s worth mentioning that I made these improvements to the “vsMeshMaker” class inside the public VectorStorm engine;  with these changes, a “vsMeshMaker” can now calculate normals for your models automatically inside the VectorStorm engine code, instead of requiring your game code to manually provide normals, and it automatically finds places where you should have creases in the geometry, and handles duplicating and merging vertices as required in order to set up those normals for you.  Once I migrate those changes back into the VectorStorm trunk, the code which resulted in the difference between these two screenshots will be visible to anybody who’s interested to see how it’s done.

If I’m still feeling halfway decent tomorrow, I might actually make a start on getting simulated subscribers into the codebase.  But it’s a big task, and I’m really going to need my wits about me when I start on it!  :)