Sunday 14 June 2009

Light Pre Pass Rendering

Iv been looking at light pre pass rendering as described here and started playing round with it. The basic concept is:
  • On you z pre pass, render mesh normals and depth into a render target.
  • Then using this rendertarget you obtain the normal of a surface and the world position ( pos = mul( float4( In.Tex.xy, depth, 1.0 ), matInvViewProj ) ) and can render the lights into the back buffer.

This is as far as I have got. After this the idea is to render the scene again adding the objects material data ( albedo (texture colour ), reflections etc) to the backbuffer (which already has the light data in it). The advantage over deferred endering is that you dont need a huge G-Buffer, which is good on platfoms like the xbox 360 where there is a fixed frame buffer size.

The backbuffer containing a single directional light:

The pre pass buffer rgb channels(normals ):

The pre pass buffer alpha channel (depth):

Wednesday 18 February 2009

Android

I got myself a G1 a couple of month back (its a great phone btw) and lately iv been experimenting with the Android SDK.
So far iv managed to make a few apps (most of them direct tutorials from the android docs, which are also great). Iv also made a simple 2D space shooting game, the SDK is so easy to pick up it only took me a day to make the game! Ill post some pic and whatnot when i get time. Once its finished I might even turn it into a 3D game, iv already taken a look at the OpenGL ES stuff and started making a simple engine. If its good enough ill put it on the android market too.

Sunday 8 February 2009

Metaballs

Its been a while since i'v posted, been busy with work etc. Anyway, after playing GoW2 and the Kilzone 2 demo (which has also got me thinking about developing another defered shading engine at work, I don think it would ever get used but it would be a cool feature to add to our engine) I was wondering how the blood created. I did some digging around and I found these things called metaballs (or isosurfaces). Theres a great introduction article on GameDev, from it I as able to implement a simple metaball system in render monkey.
Using the equations in the article, you basically iterate through each metaball in the pixel shader and return the summation of affect each metalball has on the pixel. Its pretty cool stuff and not to hard to implement: