Friday, April 29, 2011

Changelog 001

This was a quite successful week. I've learned a lot of things and started implementing them aswell.

The first thing i worked on was finally getting the per pixel lighting shader to work, which i did after numerous talks with several developers both on and irc. Eventually, all that was left to do was transforming the lights position by the camera matrix, so everything is in the same view space, and can be lit accordingly.

Failed lighting
Successful lighting
Currently it is only using diffuse lighting. Adding ambient and specular would be easy but it is not necessary right now, as for now i just like to tinker around with shaders and to get a better understanding of how to work with them.

Another thing i wanted to get done for month is model loading, and thus i started coding a collada importer. For now it is crudely hacked together, and it only supports triangulated models and no quads or other polygons. It took a couple of hours but eventually i got it working pretty good.

Quick and dirty model made in blender

I added another shader for texturing which includes the lightingcode from before and shaders really are awesome to work with!

Lastly, i want to give some credits to iq of rgba for writing this awesome shader live editor.
Something like this would really increase the workflow, and instead of alt-tabbing and recompiling all the time you just hit a button and see the results. So this encouraged me to remake this idea and write my own shader live editor. It took just a few hours, but for now it is more of a proof of concept. The editing capabilities are crude, but at least it is working!

I will keep working on it to make it a useful and fun tool eventually.

Friday, April 22, 2011

Jitter physics

I thought it finally is time to implement some physics into my game engine.

Physics usually require a tedious amount of work and you probably need a degree in computer science and math to implement them nice and smoothly. Because i have neither, i was looking for the alternatives.
There are a handful of libraries available for C# which seem to work quite well.
JigLibX and BulletX are both implemented for Microsoft XNA, so it would require some rewriting, which wouldn't be so bad since they are both opensource.
There is however Jitter Physics which works tremendously well for me. Implementing it and getting it to work was an hours effort. It comes with samples for XNA, XBox360 and Windows Phone. The XNA sample is just that though. Jitter Physics is in no way tied to XNA like the other libraries mentioned. So it could be seamlessly implemented in my engine. It comes with the zlib license which means you can do virtually anything with it. But you should be nice and mention that you're using it. That's the least you could do!

One thing i will have to adjust would be changing the vector and matrix classes to use my own, because they currently need conversion every time. I'm curious how much of a performance gain that will bring.

Hell, thats an ugly box!
Oh yeah, since i haven't mentioned anything about the engine yet; it is in development for around 9 month in my spare time. It is realized in C# using OpenGL rendering through OpenTK.
Currently i am still working on a lot of base features rather than gameplay, even though i have some prototypes i will show off some other time.

The humble bundle

If you're a gamer, you should buy the humble bundle.
If you donate money for charity, you should buy the humble bundle.
If you like to spend money, you should buy the humble bundle.

You can pay as little as 20cent or as much as $$$ to get Trine, Shadowgrounds, Shadowgrounds:Survivor and two more games. They cost around $50 when you buy them in the store, so go for it and grab 'em while they're still hot! The offer is available for another 4 days.


Finally, a fitting name for a blog, and it was not even taken yet!
This is the beginning of a new era, for me anyways.
"Red water?", you might ask, "How that relate to game development?" Well, take a wild guess.

Anyways, this blog will keep you updated and informed about the progress i make with my projects, things I was able to accomplish, or failed at, and theories and ideas about various topics, mostly, but not exclusively related to games.