User Tools

Site Tools


This is an old revision of the document!


About Lights and Shadows

FIXME This page is currently under construction :!:

One of the key questions that mappers frequently raise is how to define and place light sources. While placing light sources is generally easy, this section explains the types of available lighting techniques in Ca3DE and the options to create light sources for each.

The Ca3D-Engine implements two different types of lighting techniques:

  • Radiosity-based lighting and
  • dynamic lighting.

The two lighting techniques are quite distinct from each other, and each comes with a set of feature of its own. Nonetheless, both techniques peacefully coexist in the Ca3D-Engine and mappers frequently employ both in a single map.

Radiosity-based Lighting

One of the most fundamental lighting techniques in computer graphics is the Radiosity method. Radiosity methods compute lighting based on a physical model, and it is the nature of the underlying mathematics that characterizes the features of the technique.

The big downside of Radiosity is that it requires a preprocessing step. This preprocessing step can be computationally very expensive and thus taking a long time to complete. It is implemented in a special tool called “CaLight”, which is one of the map compilers that are covered in sections Compiling Maps for Cafu and Compiling Maps at the Command-Line.

The fact that Radiosity is slow to precompute also means that it cannot work with dynamic objects: Radiosity takes walls and any other static object into account, but anything that moves will not influence the Radiosity-based lighting result.

Good news about Radiosity-based lighting is that once the preprocessing step it complete, it is fast. Independently of the number of light sources or complexity of the scene, Radiosity-based lighting provides very good performance at run-time during the game. It is therefore a natural choice for large-scale base lighting of any level.

Even better, Radiosity lighting results looks stunningly good. No matter what hardware vendors tell you about their latest products, no matter what game developers tell you about dynamic lighting (as I too do, see below), none of these techniques can beat the realism of lighting generated by Radiosity methods. Based on an accurate physical model, the natural propagation and appearance of lights and shadows is unique to Radiosity methods.

The Radiosity method also handles area light sources without special measures, but as a natural part of the algorithm. Area light sources are an important key feature, because they are the main contributors to a realistic lights and shadows distribution with diffuse reflections and soft shadows. This is contrary to dynamic lighting, where lights are only points in space, soft shadows are always the result of some kind of trick, diffuse reflections are not possible at all, and a physical model is never involved.

For these reasons, Radiosity was the first lighting technique implemented in Ca3DE.

Here is an overview of the available Radiosity light sources and how they are created in a map:

  1. Any brush or Bezier patch surface that you place in a CaWE map can be turned into an area light source.

This however is not done directly in some dialog in the CaWE editor. Rather, …

  1. xx
  2. yy
  • [ FIXME TODO: Screenshots!, link to my thesis in See Also section, link to DK project]
  • Radiosity lights are area light sources.
  • (whose irradiance is defined with the material),
  • radiosity point light source entities,
  • sky light.

Dynamic Lighting

  • hardware accelerated.
  • dynamic light+shadow entities

Spherical Harmonics Lighting

Lighting with Spherical Harmonics (“SHL”) is an area of active research in computer science. Its goal is to combine the merits of Radiosity-based lighting with light sources that can move, especially when the light sources are very far away from the scene, like for example the sun or the moon.

SHL has been implemented in the scope of my diploma thesis in the Ca3D-Engine, but is currently not supported by the public releases. You may refer to the thesis below for more information.

See Also

mapping/cawe/lighting.1193260370.txt.gz · Last modified: 2013-01-07 12:07 (external edit)