Game Lighting Model
Question submitted by (30 July 2000)

Return to The Archives
  If you were going to make a space shoot-em up like like Wing Commander or Descent Freespace, what would be the most approriate lightning model to use? And why?  

  There are two choices here: "looks good" and "realism". The former is the easiest... just start playing with stuff until you're happy with the way it looks.

Realism (or in this case, "game-level realism") is a bit different. Game-level realism would be something like standard Phong or Lambert illumination, combined with Gouraud shading. The drawback to this is that without a bright light-source (a near-by star, for example) the objects in your scene will be practically unlit because all light sources would be too far away to illuminate the objects well enough to see clearly.

If there were a nearby star, all objects would only be lit from that direction. If approached from the other side, the objects would appear completely black (silhouetted against the bright star.) This can cause havoc in game-play, by not being able to see your enemies clearly. However, this might also add some depth to the game play, by forcing your player to attack from a specific direction (i.e. with the star to his back) or by using instrumentation (or the force, or...) Otherwise, they would be forced to attack by shooting at the black-on-black silhouettes that block out distant stars as they fly by. Could make for some interesting game play, but be careful when walking that thin line separating "frustrating" and "challenging."

In reality, polygons facing away from the light source would not be completely unlit. Often times, ambient lighting is employed to avoid the complete lack of illumination. For earthly scenes, this is almost acceptable, because ambient lighting is a quick hack that tries to account for the complex interactions of light bounding from surface to surface (this is where Global Illumination and things like Radiosity come into play.) However, in space this interaction is greatly decreased because there are so few objects close enough to make a noticeable difference. The exception to this might be a group of ships traveling in formation. In this case, there would be enough interaction to make a difference. Fortunately, this can be easily calculated by making each object a spotlight that points toward the primary light source in the scene (and a sharp falloff.) This would simulate the light bounding off of an object -- a quick hack that could easily be mistaken for real time radiosity. Though this is a bit of a hack, the results should be much closer to reality than the over-simplistic effects gained by ambient lighting.

Also, don't forget about those distant stars -- they do account for some illumination, just not much. If your outer universe of stars is relatively evenly distributed, then it would be perfectly acceptable to add a few extra percent of illumination globally (i.e. ambient light), but just a little!

Response provided by Paul Nettle

This article was originally an entry in flipCode's Ask Midnight, a Question and Answer column with Paul Nettle that's no longer active.


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.