Wednesday, March 11, 2009

Anatomy of a Dead Space frame

So there were a few good comments after I tweeted that there should be a "lighting" category when referring to video game awards. Great to hear that lots of peeps really agree regarding the importance of lighting. This prompted me to dig up a few images from a Dead Space lighting and Post Effects presentation that I gave here at EA Black Box in Vancouver. Theses images are from a slide entitled "Anatomy of a Frame" from the video game Dead Space. I was the lighting director on this title and the lighting / rendering /post effects aspect was paramount in an effort to achieve a living breathing ship where actions had consequences not only in a game play sense, but in a visual sense as well.

So.... here is a breakdown of lighting and post effects for a single frame of Dead Space.

------------------------------------------------------------------------------------------

Ambient Only - This is what the frame would look like if there was just a single ambient light in the scene set to a value of 1,1,1. An ambient light is infinite and has no directionality. Might be easier to say that it is a light that contributes equally from all directions. It does not contribute to specular term. Compare this frame to the final frame for the true before & after.
------------------------------------------------------------------------------------------
Ambient Occlusion - We are storing the ambient occlusion values in the form of lightmaps. Ambient Occlusion is computed using a simple raycast to determine visibility. Our max distance is set quite low to only provide occlusion values between objects that are quite close in spatial relation. These lightmaps are computed offline via a Render Farm. Only the occlusion values are used in rutime to effect the final pixel values generated via shader calcs.
------------------------------------------------------------------------------------------
Lighting - When considering all the lighting calculations the image starts to become more compelling and complex. We can't see what's in the background because it's very dark... starts to feel slightly scary? One of the limitations to this deferred rendering approach is the lack of specular "outside" of the light volume. This is becoming more apparent to me when looking at these images closely. Further investigation and potential solutions on this topic are in my future.
------------------------------------------------------------------------------------------
Shadows - This might not be the best example of shadows in the game, but here I have enabled shadow casting from the main directional light in the scene. I won't get into the details of this cheat, but the effect seemed to work fine. Nothing really fancy here, just a depth map runtime shadow approach. We supported multiple depth map buffers including shadow casting from the player weapon/light. Even though the shadow rendering tech was basic, our shadowing triggering/messaging system was complex. Next time check out what happens when you enter and exit one of the stores/upgrade stations in the game. You will see a shadowing light turn on and also a depth of field effect being triggered. Notice how these go away when you exit. This is a good example of our messaging system triggering lights / shadows and post effects.
------------------------------------------------------------------------------------------
Emissive Lights - One of the key elements or visual signatures of Dead Space was through the use of emissive textured light sources. Clearly in this example it helps define the length of space and direct your eye into the frame. These very bright light sources are critical aid to navigating through a level. One of the key observations here is that during "low-light" situations, the natural "filmic-response" is for anything moderately bright in the frame to become completely blown out.
------------------------------------------------------------------------------------------
Post effects - There are a few post effects that we used regularly. This image features a "bloom effect" that basically takes the brightest part of the image, blurs it, and composites this back over the top of the original image. It's not quite that simple, but that's basically what is going on... combined with a few added tricks. You might be able to see some camera relative "lens effects" that are part of the ceiling lights here as well.
------------------------------------------------------------------------------------------
Final Frame - Here is the final shipping frame. The only difference here is that I am showing it with the "look-up" table applied. The lut or color correction is a way that we remap the colors of the image. We implemented a very nice way of scripting the color correction based on game-play or just about any event in the game. In this image the color is being pushed toward cyan/blue and re-balancing the contrast a bit, while pushing the brights to achieve more bloom. Color correction is such a vital part of the image. Take a peek at any Michael Bay film or Minority Report. What would these look like without color correction! Now take a look back at the first frame and see just how important lighting & post are to crafting a compelling image.

1 comment:

SWATJester said...

This is why I can't play DeadSpace. Because you're good at your job, and therefore it scares the living shit out of me!