Thursday, April 5, 2012

24 Hours is not enough


It's been a while since I posted any progress updates about the Osiris project, what spare time I have has been fairly thoroughly sabotaged this year so far by the double whammy of receiving Skyrim for Christmas then just as my interest in that was waning Mass Effect 3 coming out.  Instead of working on shaders and infrastructure generation I have therefore instead been largely sneaking up on bandits & dragons and battling the Reapers in deepest space.

I love playing games and I love working on interesting software projects...but it would seem that there just aren't enough hours in the day to do both.  Having said that I have managed to devote some time here and there to Osiris and have been primarily working in two areas: working on implementing a new and more flexible texturing solution for the terrain and adding oceans and other bodies of water.  I plan to produce more detailed posts describing my experiments in these areas in due course but for now I thought I would whet the appetite a little with a couple of screens from the water experiments.

Although I've done deep water simulation on previous projects (Isis) using a 64x64 FFT grid processed on the CPU, I wanted to try a more modern approach with Osiris so took inspiration from an NVIDIA demo and have implemented a 512x512 FFT using Compute Shaders to do the heavy lifting.  This produces a height field, gradient and folding maps that are then fed into the vertex and pixel shaders.  The effect is best suited to deep water so works well for oceans - rivers and smaller pools will need something else.

Like I say I'll go in to more detail later, but for now here are the screens - I'm particularly happy with the way the effect scales into the distance which requires a little work to stop the FFT grid visibly tiling: