Monday, November 15, 2010

Update & Unity

Wow! I can't really believe it's been 7 months (exactly!) since I last posted an entry here. I wish I had something to show, but sadly I do not. To be honest, I have been all over the place with my development. I experimented with a number of different things, but nothing for an extended period of time. I'm hoping to change that soon though. More on that later, first a list of the things I was working on:

Shadow Mapping
I had actually never done any shadow mapping programming before, so it was more of a learning experience in understanding the concept and what is required. I implemented a simple demo in SlimDX/DirectX 11 and posted a video of it on YouTube, but it really is nothing exciting. Standard, run of the mill, shadow mapping. No fancy tricks in the implementation.

Parallel City Generation
I pulled out the old procedural city generator code I blogged about before and updated and refactored the road generator to be able to run in parallel. This allowed me to draw the roads as they were being created. I thought it was pretty cool looking. My goal was to parallelize it to the point where I could implement it as a compute shader, but I couldn't seem to get it to that point. So, I kind of gave up on it.

Bullet Physics
I decided to go back and start messing around with physics again, and I used XNA and BulletSharp this time. I was working on an idea that I've had brewing in the back of my brain for quite awhile. I made some decent progress and was quite happy. However, I started thinking about how I was essentially writing my own game engine (terrain, lighting, shadowing, physics integration). Plus, looking at the target platforms for XNA (Xbox 360, Windows Desktop, Windows Phone), I started wondering if that was best for me. So, that led me to the next item.

For several months Unity had been looking appealing to me. Two of the biggest pulls for me were C# scripting (via the Mono Framework) and PhysX integration. The wide array of supported platforms was also a huge plus (Mac, Windows, iPhone, iPad, Web). When they announced support for Android as well, I was "sold" in a manner of speaking (as I have an Android phone myself). So, I installed the free version of Unity and tried to see if I could implement the functionality I had already implemented via BulletSharp and XNA inside of Unity scripting itself. One weekend later, I had accomplished that and more!

I'll be honest, Unity is far from the perfect engine. It severely limits you due to the wide range of hardware specs that it runs on. Don't expect to be doing any tessellation or compute shaders here. Heck, it doesn't even support geometry shaders! However, it does seem to be a very well organized engine with good documentation on their webpage and a component based system that I love. I like it enough to at least fiddle around with it some more over the next couple of months.

An added bonus is that my prototypes can be deployed to my server which means you (the reader) can run them in your browser without installing the them. Expect to see a Perlin Noise example soon. :-) That really has become my "Hello World" program for testing different graphics APIs.

A final note I'd like to leave here is regarding some other "big" game engines. I was slightly surprised last week to hear not just one, but two game engines have essentially "imploded". Both Torque and Gamebryo are closing up shop and looking for buyers. That leaves Unity looking even stronger.

Until next time!


Fabian said...

Having started with C# and D3D via SlimDX a good two years ago, basically only doing GPGPU thingys on D3D9 level for fun, I finally am trying to move on to DX11, especially compute shaders.
I still am wondering why the available infos on both, SlimDX and mainly the interaction of the shaders with the CPU side is so sparse on the net, and not having a background in C++ plus years of DX development put me in a rather difficult place. I couldn't draw much from experience and the bits you can find on the internet.

Long story short: Your little nice blog entries here wrapped up pretty much all I needed to know to get me started properly, whilst omitting a lot of clutter I saw elsewhere. Thanks A LOT!
Especially the thing with the backbuffer as CS output and it's solution. I would have tripped over that quite soon, since this is precisely what I'm going to need on my first DX11 CS project. It's rare, that you get such perfectly fitting information, which is why I am just so very happy having found your blog. Thanks again :)

Best wishes from a new reader, appreciating the few but highly informative (+interesting) entries here!

Patrick said...

You are very welcome! Thanks for such a nice comment. It makes me feel that it's worthwhile for me to write these posts, and it motivates me to write future entries. I know I've really been slacking off in terms of updates, but I hope to start posting new entries soon.

Thanks again and happy programming!