Saturday, 28 August 2010

Blender-PureLight-Jefferson Starship-ShapeEditor-Prefabs-LOD

Yep, I think that sums up this posting quite accurately ... and if it doesn't, well hell, I ran out of space in the title anyhow.

Blender ... scourge of Damocles, liberator of ... er ... I don't know ... stuff ...
Also Jefferson Starship.

As free goes, Blender's awesome, but rather lacking of a working DAE importer (no, I haven't tried 2.5 yet). But it's free - so workarounds should be expected. It's not like you've forked out a shovel full of cash for PS and then have to patch the PNG exporter, can't say freebie Gimp ever suffered from not being able to export a standard format ...

I'd been thinking of ways to (re)build a town (again ... and again - BSP lol!) since making various test versions, and had come up the idea of using a few stock buldings, repeated through-out the landscape. Basically a detached house, a semi-detached (dual building), a cottage, a large manor house, a church and chapel, a multipurpose large public building with changeable props, and a couple of other things.

And whilst knocking up a detached house in Blender (with 140 collision meshes) I cam across a formula. Exterior Mesh - heavily LODed, Interior Mesh - (just the rooms no details) lods out completely at distance and the exterior takes over, and Props - furniture, stairs and details which lod out once the player is a bit outside. Props is the biggy 5500tris of beds, wardrobes, sofas, toilets, stairs, window ledges - uses 3 textures. Interior is a simple 700 tris, but uses 6/7 textures, and the Exterior has a fair few textures, but quickly LODs down to a simplified single texture (by amalgamating all the materials into a single low-res texture) and Interior also does this, so all good for performance there.

Of course there's one problem ... and that's that the unlit interior looks kinda flat, and in Lowest Lighting is just bloody awful.

PureLight Huzzar. So I decided to tonemap the Interior and Props meshes, giving a little depth and interest to the ambient. Nothing fancy, just a light ambient through the windows, something that doesn't look too out of place if you have in-game sunlight coming in as well.

Also Jefferson Starship.

Now in Max or something, you'd reimport your tonemapped meshes and stitch the whole thing into a file ... but Blender ain't gonna do that, so I cranked out the Shape Editor for a test run. I found that it was easy enough to add a new mesh LOD to my Interior (2 meshes remember, same tris but one has only 1 material) and then a dummy LOD of a single triangle to force the mesh to LODout completely. I soon found that sharing a dummy LOD object with another mesh causes issues so each new LOD/Dummy requires it's own individual dummy LOD object (might've helped if I'd renamed them but nah ...).

Anyhow the upshot was :
Exterior - fully Loded, no tonemaps
Interior - Loded with ShapeEditor, tonemaps
Props - single Lod, Lodsout fast, tonemaps

Also placed correctly, the only thing remaining is to zip them up into a prefab, and drop them into a level as I please. RESULT!

And then I found that somethings can affect lightmapping. SubSurface scattering seems to help lightmaps fight off the power of the ambient and preserve their vibrance.

And as you can see from the above pic, various settings alter the way ambient and tonemaps interact ... and boy, does BasicLighting look nice now! Not that I'm ever going to be using it personally ... but someone ... somewhere will.

Also Jefferson Starship.

Did I mention Jefferson Starship? (caution:Flash)Clovis Music Festival. Tip the parking attendants, if they speak with a funny accent that includes words like "ee bye gum" they might be my folks - don't ask my dad to explain cricket ... Last year featured my mum holding back a horde of hysterical middle aged women as they tried to rush the stage and tear the clothes of a teenage Richie Vallens impersonator ... the lucky young bastard!

Of course some of us poor buggers aren't retired so it'll be business as usual on the one man -who's not entirely sure what he's doing- game development.

Talking of which, I had a quick test of close range combat against a melee based foe.

Which was geniunely quite panicky - so I was pretty chuffed with myself.

Now ... do I really need to make roads with sidewalks/pavements as models ... if I don't have curbs then I could just use decal roads ... but curbs do give a rather urban feel ...

... decisions, decisions the pressures of command ...

No comments: