>> Home > Courses > LMP   

GP3 Workshop I - Lightmapping & Radiosity



Level:
Intermediate / Advanced
Instructor(s):
Adam Hoult & Gary Simmons
Time Blocks:
6 weeks
Credits:
Continuing Education Units (CEUs) : 3
Professional Developer Hours (PDHs) : 30
Tuition:
$95.00 - Enroll Now

 
 
You may also like to consider some of our related course and event offerings:


3D Engine Programming Module I

3D Engine Programming Module II

Game Mathematics
 

Why should I take the workshop?

In this workshop we will examine pre-compiled lighting as a means to improve the visual quality of the applications you develop. In Modules I and II in this series we relied on the fixed-function DirectX vertex lighting system to illuminate our environment. Although that lighting system is fast, dynamic, and easy to use, it has several drawbacks. For starters, we are limited in terms of the number of lights we can use. Furthermore, because light samples are only recorded at the vertices, the quality of the lighting is tied directly to the resolution of the scene geometry. The low polygon scenes we typically see in games often look very poor as a result. Finally, it uses a simple lighting model that does not provide for shadows in occluded areas.

In this workshop we look at some of the techniques that professionals use to move the lighting calculations for static geometry offline and into the development pipeline. Because such lighting calculations are performed at development time, we are no longer required to use simple lighting models. We will build several lighting compiler tools that can use much more accurate and complex lighting models to light the environment in such a way that shadows are generated and the resolution of the lighting is decoupled from the resolution of the environment.

By the end of this module, you will have a set of high-quality lighting compilers that you will have developed which can be used in all of your future projects. These tools will also play a large part in the workshops that follow, where we move into engine development and look at how to integrate the results of our static lighting compilers with dynamic per-pixel lighting techniques.

What are some of the topics we will study in this workshop?

In each lesson you will create a different lighting compiler that specializes in illuminating the environment using a specific technique. By the end of the workshop, you will have developed a collection of tools that you can use to compute attractive lighting for your game levels. Each compiler that you develop will showcase either a specific lighting model or a different technique for storing the compiler data for efficient reproduction at runtime.

In the first lesson we will look at how to move vertex lighting calculations offline into a tool. This tool will be ideal for those games that still require the use of vertex lighting but would like to have much more realistic results than the DirectX lighting module can provide. During the development of the vertex lighting compiler you will learn how to tessellate the scene geometry to the required level of detail such that more vertices are introduced into the scene for use as light sampling location. You will learn how to leverage the power of the spatial trees developed in Module II to perform efficient line of sight tests to calculate which areas of the level are in shadow with the respect to a given light source. The output for this compiler will be a modified dataset with diffuse colors stored at the vertices which fully factor in the shadows in the environment. This modified geometry can then be saved to disk and loaded into the runtime component where the lighting and shadows can be recreated simply by rendering the scene using those pre-calculated vertex colors. We will also see how these pre-calculated diffuse light samples can be used alongside dynamically calculated specular highlights using a specular mask, so that highlights are not observed in shadowed regions of the scene.

In the second lesson we will develop the more traditional lightmap compiler that has been used in commercial titles for many years. With lightmapping, we decouple the quality of our lighting from the tessellation level of our scene, so we can create very detailed lighting even for a very low polygon dataset. The tool we will develop will use the same ray-casting approach to calculate its lighting samples as the previous compiler and will also use the same Blinn-Phong illumination model to calculate light contributions. The difference in this compiler however is that the light samples will be stored in texture surfaces such that the recorded lighting for a given polygon can be recreated at runtime by way of efficient multi-texturing. The result will represent a significant leap forward from the lighting model we have been using in the series to date.

We will also learn how to pack multiple lightmap textures into master texture surfaces; an important optimization for keeping our runtime batches small. In addition, we will build a specular mask right into the lightmap data so that we can add dynamic specular contributions at runtime without highlights being observed in shadowed regions.

In the third and final lesson we will develop another texture-based lightmap compiler, but this time we will explore a much more realistic lighting model used in many of today's top titles -- radiosity.

The radiosity method allows us to model light interaction between surfaces to generate a much more realistic diffuse lighting result which includes soft shadows and color bleed. This type of lighting model is a departure from those we have examined so far in that it is a fully global system. All the models we have looked at so far have used local (direct) lighting only. That is, a surface is only lit if it falls within the direct influence of a nearby light source. Radiosity models what happens in reality as light is bounced around between surfaces and caters for the case where a surface, not directly within the influence of any light, might still be illuminated because of the light that reaches it from other nearby surfaces which are directly illuminated by a light source.

Radiosity remains a vitally important topic for game developers and there are a variety of methods that exist to tackle it. In this lesson we will implement several different approaches to solving the radiosity equations, all within a single compiler. We will show how to implement radiosity using both traditional ray-casting techniques and rendering techniques (i.e., the hemicube method). At the end of this lesson you will have a powerful and flexible radiosity compiler that generates its lightmaps using a true global illumination model.

In addition to all of the things discussed above, you will pick up many new skills along the way as we examine topics like world-space color filtering, barycentric coordinates, patch clipping, and much more.

The topics discussed include:

  • Detailed coverage of the Blinn - Phong illumination model
  • Geometry Tessellation
  • Texture Coordinate Generation
  • Image Filtering and Sampling
  • Lightmapping
  • Texture Consolidation
  • Efficient Line of Sight Testing using Spatial Trees
  • The Radiosity Method - Hemicube and Ray-Casting implementations
  • World Space Filtering
  • Barycentric Coordinates
  • Local and Global Illumination
  • Detailed Analysis of the Form Factor Equation
  • Handling Transparent Polygons within a Lightmap Compiler
  • Surface Caster Light Sources
  • GILES 2.0 Integration
  • Command Line Parameters
  • Soft Shadows
  • Binary Trees for Efficient Data Organization
  • Terrain Lightmapping
  • Terrain Line of Sight Testing
  • Runtime Dynamic Specular Contributions

  NB:For more detailed information on the topics covered by this course offering, please download and review the LMP Lesson Plan.
(To view this PDF, you will need to ensure that you have installed the free Acrobat Reader 5.0 or above.)

Who should take the workshop?

You should take this workshop if you wish to learn more about lighting techniques and would like your scenes to exhibit the professional lighting seen in many top commercial titles. You should also take this workshop if you intend to take any of the later modules in this series since this will be pre-requisite material.

What are the prerequisites to understanding the workshop material?

Graphics Programming with DirectX 9 - Module II is a pre-requisite for this workshop.

Note: You will not be able to purchase this module unless you have purchased GP Module II.

What software do I need in order to take this workshop?

  • Microsoft Visual C++ 7.0 (2002 .NET) or higher
  • Microsoft DirectX 9.0c SDK





Home  :  Register Now  :  Courses  :  Curriculum Packages  :  Events  :  Faculty  :  Tools  :  Assets
Affiliate Program  :  Help  :  Student Lounge  :  About Us  :  Privacy  :  Student Agreement  :  Contact Us