Procedural geometry

ProceduralGeometry2I know I said I wasn’t going to write any code today, but..  what can I say, I’m weak.  :)

Today I started putting in the bare bones of procedural geometry generation.  In the bottom right of this screenshot, we’re looking at a starting area.  The game has requested a simple block of a rough shape and size, and the procedural geometry systems have filled in that space with actual renderable geometry.  It’s extremely simple in this case, but I didn’t have a lot of coding time today.  I’m just pleased that it’s coming together so easily!

There are a couple bugs to sort out;  in particular, there’s a bug with the generation of surface normals, which can lead to some really weird lighting, where you get hard creases in the surface where they should be smooth.  (This is visible where the cursor is pointing;  that edge should be soft, but instead there’s a hard border between light and shadow on the roof of the structure).  I’m not feeling up to figuring that bug out tonight;  I’ll leave it for tomorrow or the next day.

Also, right now, every starting area is generated at exactly this size and looking exactly like this.  I’ll need to add some variability into the system to keep things fresh, while still keeping enough constant elements so that the buildings remain recognisable to a casual glance.