Radiosity (Lighting)


The following section gives a quick overview of the radiosity lighting solution used in Halo.  Topics and tutorials include running the radiosity process on the level as well as information on the settings and options for radiosity, the creation of a lightmap for the level (.bitmap) and troubleshooting common problems encountered with lighting in Halo.


Radiosity Overview


Halo has both static and dynamic lighting.  The static lighting is created by running a radiosity process on the level geometry that then saves the results to a light map file that is just a special kind of .bitmap data tag.

The light used by the radiosity process can come from many sources.  The sky box or .sky data tag has numerous lighting settings and attributes that can be set.  Materials have radiosity properties that can be set to emit light that can be used in the radiosity process.  These materials can be applied to surfaces in the level environment.  Models can be setup to emit light using .light data tags as well. 

The effect of the radiosity process can be controlled for almost every face or surface in the game.  In the material or shader settings there is a value called "detail level" which exists under the "radiosity properties" area when the tag file is viewed in Guerilla.  This detail level setting affects the amount of tessellation or how much the surface is subdivided for the lightmap.  The higher the setting, the higher the resolution of the lightmap on the surface and the longer the radiosity process takes.  In addition, higher settings increase the amount of lightmap data (the .bitmap gets much larger) and thus affects the amount of memory used.

On a related note, just as there is static and dynamic lighting, there are also static and dynamic shadows.  Dynamic shadows are cast from objects such as vehicles and characters.  Static shadows of course are a result of the radiosity process.  Static models such as those used for .scenery objects can be setup to cast shadows or block light during the radiosity process.

The radiosity process can be run using Tool or in Sapien.  Sapien has a developer console which can execute many of the commands that can be run in the Halo game console. 

The following examples and tutorials will discuss the radiosity command options and demonstrate running the radiosity process on the tutorial level using Sapien.


Running Radiosity on a Level


The following examples and tutorials will discuss the radiosity command options and demonstrate running the radiosity process and saving the lightmap data to a .bitmap on the tutorial level using Sapien.


Lighting the tutorial level (running radiosity on the tutorial level):

Go to the main Halo directory.  In the root directory is where all the Halo tools exist, there should be a program file called sapien.exe.

1) Run Sapien.  When Sapien loads, an Open dialog window will appear.  Use this dialog to load the tutorial.scenario tag.

Sapien will now load.  Sapien runs many of the same systems as the game so give it time to load, especially for larger levels.

The first image further explains the above procedures.

Maximize or make Sapien go fullscreen.  Roughly organize the windows so that there is easy access to the Game Window.  The Game Window is the 3D window which renders many of the Halo game objects exactly as they will appear in game.  The 3D window runs the same rendering engine as Halo itself.

Sapien will be covered in more detail in the section Population.  For now, all that matters is the large 3D window.

2) Use the mouse pointer to click on the Game Window.  In the game window, bring up the developer console by hitting the ~ key.

When the game console is visible, the game and input controls for the camera are paused.

There are 3 console commands that will be used to run and complete the radiosity process.

radiosity_quality <0 or 1> - Sets the quality of the radiosity to be performed. 

A setting of 0 runs what is called a quick or "fast radiosity".  The number of "light bounces" or "radiosity bounces" that are run is fewer and the process ignores light occlusion or blocking caused by models. As a result the radiosity process does not take as long and is less accurate and the resulting lightmap .bitmap is smaller.

A setting of 1 runs what is called a "full radiosity".   This is the process that should be run for the final or "release" version of the level.  A full radiosity runs the radiosity process at its full settings.  As a result the radiosity process takes much longer and is much more accurate. The resulting lightmap .bitmap is much larger.

radiosity_start - Starts the radiosity lighting process on the level using the current radiosity settings.

radiosity_save - Saves the current radiosity lighting to a .bitmap lightmap file for the selected level (.scenario_structure_bsp). This command can be used at anytime after the radiosity_start command is used.  It will stop or interrupt the process and save the current progress to the lightmap .bitmap file.  As a result, any radiosity process (even a fast or quick radiosity process) that takes a long time can be cut short, saving time.  If this command is used upon the completion of the radiosity process, it behaves as normal and saves the lightmap .bitmap file out.

For more information on the console commands that will be used as well as console commands in general, see the Console Commands table in the Console Command List section under General Reference.

Since the tutorial level is small and radiosity will not take a long time to run, a "full radiosity" will be used.

Type the following into the console and hit Enter:

radiosity_quality 1

Note that at anytime the values for the radiosity settings can be checked by typing in the console command without any setting or value and hitting Enter.  This will return the current value or setting.

The second image further explains the above procedures.

3) Now type the following into the console and hit Enter:

radiosity_start

When this command is executed 3 numbers should appear in the Game Window.  These numbers represent the RGB values for the lighting.  These numbers will countdown as the process continues, when all 3 numbers reach 0.0, the radiosity process is complete.

The third image further explains the above procedures.

4) When the 3 displayed velues reach 0.0 type the following in the console and hit Enter.

radiosity_save

The fourth image further explains the above procedures.

The level should now be visible.  If it is not, move the camera around in the Game Window until the level is visible.  The camera can be moved and rotated by holding down the Middle Mouse button and using the following keys to move around the level:

The mouse controls the pitch (up and down) and yaw (left and right) movement of the camera.

Shift - Cycles through the camera speed, making it move faster.

W - Moves the camera forward
A -  Moves the camera backwards
S -  Pans the camera left
D -  Pans the camera right
R - Moves the camera along the Z-Axis in the positive direction (up).
F - Moves the camera along the Z-Axis in the negative direction (down).

The fifth image or last image further explains the above procedures and shows the results of the radiosity process.  The level should now be fully visible.


Click to Open Larger Image in New Window






Click to Open Larger Image in New Window






Click to Open Larger Image in New Window






Click to Open Larger Image in New Window






Click to Open Larger Image in New Window


Troubleshooting Errors in Radiosity


The following table outlines some common problems or errors that may occur as a result of or in relation to the radiosity process and offers suggestions and solutions to these problems.


Problem or Error Suggestions or Solution
 
When the level is viewed in Sapien or in Halo it is completely dark. Make sure that the level has lights and that radiosity has successfully completed and created a lightmap .bitmap.

Remember that to save the radiosity solution the lightmap must be manually saved using the radiosity_save command.
The lighting in the level is very dark or darker than expected. There are several problems that can cause this, try the following solutions:

If the radiosity process was stopped prematurely, try running the radiosity process longer.

Run a full radiosity (radiosity_quality 1).  A full radiosity bounces the light more, therefore the level is lit better.

Check the light value settings and attributes in the appropriate tag files.
The lighting on certain surfaces is very low resolution (its "blocky" or "splotchy") There are several problems that can cause this, try the following solutions.

Use Guerilla to check the "detail level" setting in the "radiosity properties" area in the shader tag. If the value is set to low or "turd" try setting it to medium or high to see if this smooths the lighting on the surface.

Check the Smoothing Group settings in 3ds Max for the faces or surfaces.

Try increasing the amount of light that is falling on the surface.  Either increase the light values or add additional lighting that further illuminates the problematic surfaces.
There are black lines or patches on surfaces in the level. There are several problems that can cause this, try the following solutions.

Check the Smoothing Group settings in 3ds Max for the faces or surfaces.

Make sure that there are no duplicate Smoothing Groups being applied to multiple faces or objects.

Make sure that the Smoothing Groups are not applied to faces that are separated or exist far apart from each other.

Try increasing the amount of light that is falling on the surface.  Either increase the light values for the surrounding lights or add additional lighting that further illuminates the problematic surfaces.

Make sure there are no errors or warnings being reported by Tool during the compilation process.  Some of these errors can cause lighting anomalies.

Increase the amount of faces, subdivide the surfaces.  Increasing the density of the mesh may help smooth the lighting, this is especially true of very large faces or polygons.

Modify or adjust the geometry to see if it fixes the errors.
The surfaces are extremely bright or fullbright.  The surface appears to be completely saturated with light. There are several problems that can cause this, try the following solutions:

Check the light value settings and attributes in the appropriate tag files.  Make sure these values are not set too high.

Check the self-illumination properties and settings in the appropriate tag files.  If self-illumination was not intended, set the associated values to 0.


Conclusion to Radiosity


The level has now had the radiosity process successfully completed.  The level is now ready for object placement and editing using Sapien

Completed versions or example versions of the level tags that are created in the tutorial sections can be found under the "Halo\tags\levels\test\tutorial_examples" directory.  The compiled tags have been provided as a reference to aid in the learning process.

Once the user has successfully completed the procedures above to successfully light the level they can proceed to the next section Population.