Showing posts with label normals. Show all posts
Showing posts with label normals. Show all posts

Sunday, 30 June 2019

Assimp Does Magic Stuff And I Get Distracted

This was a bit of a surprise.

 That says Blend file that does

Whilst playing around and looking for bugs in the latest beta of open sourced Torque3D game engine, I accidentally imported a BLEND file from free open source(ish) Blender3D modelling program. Obviously this by accident, because I would never have thought that it would work.

I had found some ripped game models and other sculpts (see Tifa above) and was looking at them in Blender3D for modelling reference. I had experimented with various export options and was loading them into the engine when I accidentally double clicked the Blend file rather than the exported DAE file. Et voila, it actually loaded with all materials correctly mapped.

This is due to the new Assimp importer which appears to be able to read pretty much anything and import it because magic.

Literally my understand of how Assimp works ...

Assimp also comes with a metric ton of options - none of which I really understand so I just kept using the defaults except for maybe rotating the up axis to Z when needed - and it kept importing models fine as long as I had multiple mesh objects set to be read as a single sized LOD.

When the Beat-Em Up waifus are extra thicc

I had tried various other model formats and found FBX and BLEND to be the easiest at automagically loading the corrects textures into the material slots. Amusingly - or not as the case may be - the original DAE importer was the worst and created the most hassle. Not all the models I had found on the internets had their textures setup for a standard PBR material, hence the rather off colour Chunners.

DAE->OBJ->FBX->BLEND

I had also seen someone using the normals editing tool in Blender in a way that I had not thought of before. For foliage and tree leaves they had placed the mesh inside of a huge sphere object and then targeted it. This made the leaf faces orient outwards to the nearest sphere point. For my current project all leaf and foliage mesh faces are orientated nearly vertically upwards, targeting a node high above, because that's pretty much where the player's camera is for a top-down perspective.

No normal editing target->Vertical target->Spherical target

Did I mention distraction? Yes I did. I had been harassed by "The Idea Fairy" and suddenly had the urge to make a Dieselpunk Ace Combat style game. I ended up writing up a design document and fairly in depth statistics of how the whole thing would play, utilising real world 1930s and 1940s aircraft. I imagined it would play rather like the old Freespace space combat simulator, only in high altitude clouds rather than space. Aircraft would ... well, aircraft, and airships would make up an equivalent of a real world navy. I also ended up playing through Freespace 2 and the original Freespace mod for it. For the first time ever, I have a state of the art gaming PC and use it for playing 20 year old games.

This thing needs keeping on a short leash ...

So that was the distraction that stymied this month's progress. I did however get some work done on the current project, the one that I am supposed to be working on, by transferring some heavily used scripts for targeting to C++ code to take a bit of weight off the processor when they are called so often. I also added went mad for statistics and added rankings for player performance on to the already percentaged data. I went for the Japanese obsession with S which may or may not mean SPECIAL, so the highest rank is SSS, SS, S before getting into a more standard alphabetical descent, and it goes down all the way to F for FAILED MISERABLY.

Yo Dawg I heard you like Statistics ...

Of course the real reason I did all of this stuff was simply to avoid having to model 3D hair because it's boring. Yep, that was it. An entire month of obfuscation to not doing something that is time consuming and dull. I also got poisoned with a chemical gas leak for two weeks having had an engineer out to investigate a gas leak, then getting a methane detector thinking that it was a gas buildup in the drains before eventually finding the source leaking out of a vat, and I was also immobilised with a back injury for another week, which was caused by just bending over the sink. So not a great month in general.

Next month, getting back to what I should have been doing this month ... allegedly ...

Saturday, 12 July 2008

8 million shades of brown

My first developed game was a text adventure on the Spectrum 48k, way back in the early-to-mid-1980s (history's greatest decade!). The humble Specky, brainchild of boffin Sir Clive Sinclair (when inventors wore white coats and still looked like mad scientists), had a range of 10 colours. My text adventure was black and white.


There's Colour in Them There Rolling Hills

Then came the Amstrad 64k, initially with a green screen, but then a colour one. Little more than a glorified Specky, but those extra 18k gave a whole new world of colour.

The appearance of the Amiga was a big boost to colour (1-2meg memory!). I remember a graphics/art package with 4096 colours!


UV mapped characters are on the to-do list - which is piggin' huge

And finally the PC (with good old DOS), and future -- or rather the present -- was here. My first PC had a 25mhz processor and whopping 4megs of RAM - my current has a dual 2.3ghz chips with 2gigs of RAM. And the games are more visually realistic than ever. Call of Duty 4 has 2 million shades of grey whilst Gears of War 2 promises to break new boundaries in the shade of brown. HDR lighting means every glance to a virtual sky burns out the player's retina as the screen fills with the burning brilliance of a supernova - which is odd, 'cos I look up at the sky all the time and it doesn't seem to damage my sight. Nor do I see lense flare from every angle.

So what is the Indie Dev to do with this march of monotone progress?


Base Painted Texture

Well, the Indie Dev could play along with hyper-real world of grey and brown psuedo-photorealism. I've got a pretty decent digital camera, I know how to edit images and understand colour (I should do, I got a degree and post-grad and then spent X years bumming around the arse-end of the Mediteranean as a Bohemian artist type).

And then get lost in the haze? I expect the brownness of GOW2 is costing the outstanding national debt of a small impoverished country - Hallo3 certainly did. Then there's the team numbers - which is pretty much the same thing as cost. One bloke in his bedroom, furiously hammering away at a graphics tablet and keyboard, is not a 100-300 strong development team spread across multiple studios (a la GTA4).


And with Normal Mapping

So, back to that tablet and digital painting for textures, and tile and reduce detail in photos to make normal maps for brickwork and surfaces. My first attempts at striking a balance between artistic paint style (textures) and realism (normals) is pretty okay ..... ish. Though I might like them to be a tad rougher.


After further practise/messing I worked out a technique to make a painted skybox by hand.

Colour - and only 2 shades of brown!


Roads and foliage next me thinks, and the creation of an actual environment.