|
Features

Visual Look Development: Star Trek Online Starships - Pt. 2
Our Experiments with PRT
Pre-computed radiance transfer (PRT) is an ingenious way to approximate complex lighting interactions including shadows, bounce lighting and sub-surface scattering. The most straightforward and practical implementation of PRT has two significant limitations:
- Objects must be rigid (i.e. no moving parts or skin deformation)
- Lights must be at infinity
Starships in space meet these criteria (for the most part) and should be a perfect fit for PRT so we were eager to try it out. However, we soon ran into problems.
PRT can only be practically implemented at the vertex level. This means that the density of vertices will determine how good the lighting looks. The more vertices you have, the better the results. We found ourselves adding vertices next to shadow casting objects just to capture the shadows clearly. Our vertex counts increases dramatically and hand tuning the model was time consuming.
When using PRT, the lighting environment is approximated using the spherical harmonic (SH) basis. This means that a very complex lighting environment can be used. But it comes at a cost. The results of transforming a lighting environment into the SH basis are not intuitive. The approximation is very rough and has strange artifacts which result from the math. Our lighting artist found it very difficult to achieve the results he was after. For example, something as simple as a nebula which illuminates just one side of a ship can be hard depending on the location of the nebula in the sky.
Part of the realism of PRT lighting comes from the darkening of crevices and contact shadows. Sure enough, this looked great. However, we discovered that we could achieve the same result using an ambient occlusion term stored in a texture. Using a texture gave better results because it was per-pixel rather than per-vertex.
One of the most striking effects of PRT lighting is cast shadows which react to the lighting environment. PRT shadows are much cheaper than other methods. The only drawbacks are that they are extremely diffused and depend heavily on high vertex density. We could not achieve the sharp shadows one expects to see in space.
Shadow Experiments
Having failed to create satisfactory shadows with PRT we turned to the two mainstream techniques: stencil shadows and shadow maps. We implemented both solutions and we pitted them against one another in a variety of test scenes. We discovered that each has advantages and disadvantages. The following chart summarizes them.
Shadow Mapping |
Stencil Shadows |
No special processing needs to take place on the geometry. |
Requires special processing of the geometry to find edges. |
No special modeling considerations. |
Geometry must consist of closed manifolds which is a burden on the artists. |
Soft-edged shadows can be achieved via percentage closer filter and screen space blurs. |
Shadows have hard edges. |
The resolution of the shadows depends on the amount of video memory devoted to the shadow map. |
The resolution of stencil shadows is not limited. |
Geometry can contain screen-door transparency. |
Only solid triangles can cast shadows. |
Stresses the pixel processing pipeline. |
Stresses fill rate. |
Next: Finalization
|