Here's a long overdue update on Camera Obscura. It's been quite a while since I've posted about it, but work has been continuing on. We submitted the game to the Independent Games Festival, for which the results are expected in January. The current plan is to beginning working on release at that point, hopefully with some more recognitions to our name!
There's tons of new stuff now, including over 50 levels, a vast array of background and tile art, and a number of new features for tracking statistics, best scores, and achievements. Oh, and a final level, complete with cutscenes and a "final boss" of sorts. This video should demonstrate some of the new shinies:
My random inspiration of this week occurred when one of my professors, Dan Frost, mentioned basic lighting techniques in lecture. It turns out that for any surface, the final color of that surface with a light on it can be calculated quite simply by multiplying the surface's color by the color of the light times the dot product of the surface normal and the normalized vector from the light to the surface. I thought to myself, "I could totally do that." Any about an hour later, I had this demo up and running:
Normal mapping has been traditionally used in 3D games on surface textures for 3D models. In this context, its use can easily make an extremely low-poly object appear much more detailed at a low processing cost by rendering textures with lighting such that they appear to "pop out". In this demo, I have instead used it to fake a 3D effect on a completely flat 2D plane.
The process is fairly straightforward. First, the standard scene is rendered to a render target cleared black, with nothing special done. Then, the scene is rendered a second time to a second render target, but this time the normal maps for each image, if they have one, are drawn instead of the standard image. Normal maps encode information about the surface normal, or the direction the surface faces, of each pixel in an image. In most implementations, the X, Y, and Z components of the normal vector are encoded as the R, G, and B components of the color of a pixel on an image. This can be seen toward the end of the above video. This second render target is cleared RGB(128, 128, 255) so that images that do not have normal maps can be rendered as flat planes. Finally, both of these renders are passed to a shader that calculates the final color of each pixel in the first image using information about the locations and colors of all the lights in the scene, and the pixel's normal from the second image.
I plan to post the code from this demo soon, after I get my work on ambient light, directional light, and multiple point lights in there, so look out for it!
We've just recorded a new trailer of this nearly feature-complete version of Camera Obscura. It demonstrates some of our cool new features, like the crawler enemies (shown briefly) that can climb walls and walk on ceilings. One of my personal favorite features of the game so far. It also demonstrates the basic ideas of the gameplay more clearly, without all that mucking around testing collision ;).
Camera Obscura is still trucking along. Summer is drawing to a close, and we hope to be done with the game's code by the time school begins. Most of the work that is left is with our level designers and our excellent artist, Dean Bottino. More gameplay videos and maybe some post-mortem-type stuff will be forthcoming.