Lighting the Terrain

      Terrain maps also require some rethinking about the way you light maps.

Vertex Only

      If you are making a large terrain map, you should plan on making your terrain textures be lit by vertex lighting only. Lightmaps can quickly become far too large for the game to handle.

Make sure your large terrain textures contain the following parameters:

Surfaceparm nolightmap //signifies vertex lighting only.

Q3map_novertexshadows //this is what keeps those caulk vis blockers from causing ugly shadows to form on your terrain.

      If you are using q3map_sun in your sky …

Q3map_forcesunlight //this makes the light emitted by a q3map_sun parameter affect the vertex lit surface.

Light Sources

      For outdoor maps, the obvious source of lighting ought to be the sky. The skies in the mpterra maps began with skies used in more conventional Team Arena maps, but were modified to better suit the needs of the terrain worlds.

· Slow Down Those Clouds. One thing to consider is slowing down the rate of cloud movement. What looks OK in smaller maps looks wrong in vast panoramas.

· Strong Sunlight is Good. For team maps, you want to try and keep the light relatively the same in both base areas, so if you have mountains or large base structures, having the light come in at a nearly vertical angle is good, but less dramatic.

· Ambient Light is Not So Bad. Since the beginning of Q3A map development we’ve said things like “Ambient Lighting is bad”. Well, the problems caused by ambient lighting are still there (flattening of shadows and colors), but with the distance of the play areas from the sky surface (in some maps), adding an ambient really helps bring up the overall light value in the map. Start low, maybe around an ambient value of 5 and creep upwards until the map looks right. It is VERY IMPORTANT that you give your ambient light a color. If you leave it white, you get ugly pink light instead of white. Even specifying white makes it look wrong. Best suggestion is to sample the sky texture color and translate that into an rgb formula for your ambient. One warning though … if you include “interior spaces” in your maps, the ambient light will affect those areas too. You will not get the deep dark shadows you may want in there.

· Sky Shader Trick #1: Lose the Backsplash. The attributes of the sky shader can have a significant effect on the amount of time it takes to perform a light compile on a map. You have to think of the sky as a huge area light. However, unlike light emitting textures (like your average light fixture), the sky doesn’t need to be illuminated itself. Therefore, you can eliminate the backsplash light feature which is the default status of the q3map_surfacelight parameter. Your sky shader should have the parameter q3map_backsplash with a value of -1. Removing backsplash light doesn’t affect the appearance of the sky, but does remove a significant amount of compiling overhead when the -light algorithm is used (the normal way you light things).

· Sky Shader Trick#2: Big Subdivisions. Q3Map automatically subdivides the sky into triangle quads. The more triangle quads, the more light emitting surfaces you have on your sky (if q3map_surfacelight is used). The light compile calculates for every one of these light emitting surfaces. Increase the size of the subdivision and you get less light emitters and a faster compile.

· Sky Shader Trick #3: -V-light. This is a fast lighting algorithm. It’s especially fast for calculating sky lighting. It loses a little precision, but it can greatly speed up the time it takes to light a map. Even if you decide to use a normal light operation for your final map, using -vlight for interim compiles can mean a lot less time spent waiting on the compiler to see your results.


The Light Grid

      This is discussed in detail under terrain-related Worldspawn features. One of the things that can add enough memory complexity to a large terrain map, enough to make it unplayable (read crash the game), is the light grid. Think of the light grid as a map for determining how to light entities in the world. It’s what makes player models appear to move in and out of shadows as they move through the world. It’s a nice effect, but costly in memory terms. For the largest maps in Q3:TA, we “traded down” to a less detailed light grid. Increasing the size of grid subdivisions from 32 units to 256 units did this. We experimented with smaller and larger grids and settled on 256 x 256 x 256 as the best size. Smaller and the grid became large and unwieldy. Larger (especially on the z dimension) and not enough light reached some of the entities.

      The details of this feature are noted below under Terrain-Related WorldSpawn Features.

Back - Table of Contents - Terrain Worldspawn Features