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.

No comments:

Post a Comment