Friday, January 28, 2011

Image Overlays

The Aware Engine code got a bit messy after I added the water effect feature.  It had me worried because I still have to add a fog effect and video loops.  After sitting down with pen an paper I came up with a better architecture. I'll call it Overlays.

Nothing revolutionary really.  It's basically a way of layering, (overlaying), small images on top of the pre-rendered scene image:


This concept of an Overlay gives me a unit of abstraction for all these types of effects.  This is good because:
  • It allows me to deal generically with all these dynamic effects.  (Clean code)
  • Adding new effects in the future won't require re-architecting the code.
  • I can load and render all overlay effects asynchronously using a thread pool.
The final point is a real relief to me because both the water effect and fog effects are CPU intensive and it would be a shame not to take full advantage of today's multi-core CPUs.

Wednesday, January 19, 2011

AwareEngine First Screenshots

Okay.  So I've been working on the "engine" code for this tech-demo.  I'm calling it the Aware Engine.  Using my newly honed water-effect techniques I've created a rippling background for the menu.  A still image does not do it justice but:

I've also applied the water effect to my lava using a mask:

(click to zoom)
The mask above is shown as a 360 degree equirectangular (aka panoramic) environment map.

Next I need to generalize the masked water effect code and then I'll begin work on the smoke effect.

I'm kind of struggling with performance issues too.  The water effect is calculated on the CPU per-pixel - I'm not leveraging the graphics card at all.  I've got it up to about 25 FPS on my laptop but I need more for the smoke effect.  Perhaps I'll use a second thread to asynchronously render the effect(s) and just set minimum system requirements to any dual-core CPU.  We'll see.

Friday, January 7, 2011

Cruxic Water Demo

I've been working on the water and liquid effects for the broadcast-room technology demo.  Although the Riven scene doesn't have liquid, I got carried away and now have a separate room with liquid lava.  This sent me off on a long tangent exploring various pixel-based water effects.  I was assisted greatly by the many online tutorials and example programs so I'd like to return the favor by posting the code I came up with.

I call this the "Cruxic Water Demo".  Here's a video:



I'm releasing the code under the MIT license so you can pretty much do whatever you want with it so long as you keep the license attached if you redistribute either the source or derived executables.  Note, however that the Perlin noise code, Noise1234, is not mine and is licensed under the GPLv2.

Download here  (source code and executables for Linux AMD64 and Win32)