Pori nirumpa yamuta

One of the most disheartening things I found about working in the games industry is that when I came back from work each day, my desire to fire up Visual Studio and just sit working on stuff through the night, like I used to, had gone. I was assured from speaking to others that the flame of graphics programming would return but I was sceptical. Work was satisfying my programming needs (and still is …it is great 8) ) so any coding at home was very infrequent and lacked direction … BUT LOCK UP YOUR POLYGONS, I HAVE RETURNED!! :D

Aaaaaaaaages ago now I was working on a nice little .smd loader (decompiled HL2 models) and it went pretty well. However recently I returned to the project and looked in my steam folder …there were LOADS of models for me to play around with, but there was no way I was going to decompile all those (and the MDLDecompiler is temperamental). I also had a new goal…

Just before starting in the games industry, I’d been meaning to play with inverse kinematics (don’t get your hopes up though, I am not about to show some IK related stuff …at least not yet ;) ). So this was my new goal and to accomplish this I needed some data. Since I’d already been looking at HL2 models (and I really quite like Valve’s artwork) the choice was straightforward. I’d load the binary stuff, the .mdl!

C# and SlimDX being my usual weapons of choice, I got stuck right in. It proved challenging but very rewarding (my favourite kind of coding) and when I got my first combine guy rendering correctly I was very happy. Then I tried loading Alyx …and things messed up :(

I was greeted with a rather nasty mess of triangles, giving very little relation to how she should look. But annoyingly the lower levels of detail rendered perfectly. I spent ages trying to work out what was going wrong before coming across the ‘Fixups’ chunk in the .vvd file. With the fixups applied, Alyx was complete! …and since then any .mdl I fire at my loader (even stuff from the orange box) has been fine. The next problem though was materials.

For the same reason that I didn’t want to convert all the .mdl files to .smd, I really didn’t want to have to go through all the .vtf and make them .dds. So I recently started into a vtf loader too. It is still quite hacky, only supporting the key formats, but it is usable and will only get better as I put more effort into the material system, but the key thing is, it is just about ready for screenshot time!! :D

Marcus FenixNomad

Don’t be fooled by the appearance of Nomad and Marcus Fenix in the screenies 8) They are still HL2 models which I found on the Garry’s Mod site. I also need to finish off loading the animation stuff, but the good thing is that the .mdl contains all the batches in nice ‘vertex shader skinning’ sizes, so it will be a breeze :)

Also, observant readers may notice all models are flipped horizontally (Marcus Fenix has a scar on his right cheek, not his left) …I need to fix this ;)


Return of the Graphics

I’ve been taking a small break from the physics stuff and returned to tightening up the graphics on level 3 (that commercial still makes me laugh even after all this time) :D

Physics Framework with Scattering and Bloom

Basically I’ve revisited the atmospheric scattering using the excellent sample on FilouGK’s Blog to help me out. Swapping it in instead of the old Preetham Scattering I had done before was very painless and the sun size really makes the difference (I actually had the sky done in the last batch of shots but I’ve gotten the atmosphere on the terrain now which is the main reason for this entry) ;)

On top of that I added some Bloom. I was a bit unsure about it at first (as it tended to make things look blurry), but it is safe to say it has grown on me. I reckon I’ve gotten it just about subtle enough and I love the way it makes things look a lot warmer :)

I’ll probably continue on with the graphics development for a little longer as there are a couple more things I’d like to play around before returning to the Physics ;)

Edit: I’m aware that some people have a dislike of bloom in general, so I took some comparison shots to give a better idea whether or not I have overdone it :)


AfterBurner Beta

A few months back I came across a rather interesting paper on generating radiosity lightmaps (Radiosity on Graphics Hardware). The reason I found it so interesting is because it uses quite clever techniques to do nearly all of the radiosity calculations on the GPU. So, I decided to give it a go :)

I made some decent early progress implementing it, but then took some time out to do some terrain work with XNA and was also working on a DBP entry. With those out of the way (or cancelled ;) ) I was free to return to my radiosity 8)

AfterBurner Beta

It is written in C++ (mainly to prove that C# hasn’t made me soft ;) ) using DirectX 9 and it has actually been loads of fun, especially optimizing it. I was able to reduce the time it takes to perform 256 (16×16) hemicube shots/emissions from nearly a minute, down to as little as 1.5 seconds :D

On a whole though it is still not blisteringly fast (the screenshot took quite a while to render), as to get a decent level of accuracy, I have to increase the resolution of the hemicube as well as the resolution of the textures. I also have to shoot residual energy from the topmost mipmap level, as shooting from a lower mipmap level can produce some nasty artifacts :(

As you can see from the screenshot, I am still not completely free from artifacts (even when running on quite a high level of detail) but I am still working on it (I did say Beta right? ;) ) The most notable artifacts are around the base of the rotated boxes, where the luxel’s centre is occluded and so fails the visibility test, even though the luxel itself is partially visible. I will probably be able to fill those in as a post-process on the lightmaps when packing them, but I am not sure yet if that will work :)

Anyway, you can expect to see more of this as it progresses (I’ll be giving this project it’s own page on this site shortly) :)