World Lighting
To configure sunlight and ambient light, we use the worldspawn settings.
With NOTHING in the map selected, hit N on your keyboard. This brings up the entity window and should select worldspawn. Here, you can input the keys/values required.
Ambient Lighting
These settings control the map’s global ambient lighting, which provides baseline illumination to all surfaces, preventing completely dark areas and setting the overall mood.
ambient
Sets the intensity of global ambient light, which uniformly illuminates all surfaces, regardless of specific light sources like the sun or lamps. This acts as a baseline brightness to ensure no area is pitch black.
- Values range from
0(no ambient light, completely dark) to1(full brightness) or2(overbright, very intense). - Must be paired with
_colorto define the light’s hue.
Note: Higher values can wash out shadows, reducing contrast and making the map look flat. Lower values create moodier, darker environments but may obscure details. Always test with _color for balanced lighting.
ambient 0.2
_color
Defines the RGB color of the ambient light, controlling its hue across the map. Values are specified on a 0-1 scale for red, green, and blue components.
- Used with
ambientto tint the map’s baseline lighting (e.g., blue for a moonlit effect, warm tones for sunset). - Example:
0.2 0.2 0.8creates a cold, moonlit ambiance, while0.8 0.6 0.4mimics a warm evening glow.
Note: Choose RGB values that align with the map’s theme (e.g., cool tones for night maps, warm tones for desert maps). Test with ambient to avoid unnatural lighting effects. In Call of Duty 2, press K on the keyboard to open the color picker for selecting RGB values.
_color 0.7 0.7 0.9
Sunlight
These settings control the map’s sunlight and its diffuse component, simulating natural outdoor lighting from the sun, including direction, intensity, and color.
sunlight
Sets the intensity of direct sunlight, affecting surfaces facing the sun’s direction. It determines how bright and prominent sunlight appears on the map.
- Values range from
0(no sunlight) to1(full brightness) or2(overbright for intense highlights). - Must be used with
suncolorto define the light’s hue.
Note: High values create stark contrasts between lit and shadowed areas. Test with suncolor and sundirection to ensure realistic lighting.
sunlight 1.5
suncolor
Defines the RGB color of direct sunlight, controlling its hue on surfaces it directly illuminates. Values are on a 0-1 scale for red, green, and blue.
- Used with
sunlightto set the sun’s color (e.g., golden yellow for sunset, white for midday). - Example:
0.9 0.7 0.3for a warm sunset,1 1 1for neutral midday light.
Note: Choose colors that match the map’s time of day or environment. Test with sunlight to balance intensity and hue. In Call of Duty 2, press K on the keyboard to open the color picker for selecting RGB values.
suncolor 0.9 0.8 0.6
sundirection
Specifies the direction of the sun’s light rays using a pitch-yaw-roll format (in degrees). Pitch controls the sun’s height, yaw its horizontal angle, and roll is typically set to 0.
- Determines where shadows fall and which surfaces receive direct sunlight.
- Example:
-45 135 0places the sun 45 degrees above the horizon, casting light from the southeast.
Note: Pitch is typically 0 (horizon) to -90 (overhead). Yaw aligns with the map’s coordinates (consider northyaw for consistency). Test to ensure shadows enhance map aesthetics.
sundirection -30 90 0
sundiffusecolor
Defines the RGB color of diffuse sunlight, simulating scattered light in shadowed or indirectly lit areas. Values are on a 0-1 scale for red, green, and blue.
- Used with
diffusefractionto add subtle lighting to non-sunlit areas, mimicking sky-reflected light. - Example:
0.4 0.5 0.8for a cool, sky-like diffuse effect.
Note: Should complement suncolor for a cohesive look (e.g., slightly cooler than direct sunlight). Test with diffusefraction to balance its impact. In Call of Duty 2, press K on the keyboard to open the color picker for selecting RGB values.
sundiffusecolor 0.5 0.6 0.8
diffusefraction
Sets the proportion of sunlight intensity that comes from diffuse lighting, on a 0-1 scale. Diffuse light affects surfaces not directly facing the sun, simulating scattered light.
- A value of
0means no diffuse lighting (sharp shadows), while1means diffuse light is as strong as direct sunlight (softer shadows). - Example:
0.5balances direct and diffuse light for natural outdoor lighting.
Note: Higher values reduce shadow contrast, brightening the map. Use with sundiffusecolor to control the hue of diffuse light.
diffusefraction 0.4
Advanced Lighting
These settings fine-tune lighting effects, particularly for radiosity and bump mapping, to enhance the map’s visual quality.
bouncefraction
Controls the amount of light that bounces off surfaces during radiosity calculations, simulating indirect lighting (e.g., light reflecting off a wall onto another surface).
- Higher values increase brightness in indirectly lit areas, creating softer, more realistic lighting.
- Lower values result in darker, more defined shadows.
Note: Radiosity is computationally expensive in Call of Duty 2’s engine. Higher values may reduce contrast but improve realism. Test for performance impacts.
bouncefraction 0.3
contrastGain
Adjusts the contrast of bump map lighting (normal maps) on a 0-1 scale. Bump maps simulate surface texture lighting without additional geometry.
- A value of
0applies no additional contrast, keeping bump maps subtle, while1maximizes contrast, making textures more pronounced. - Example:
0.5balances texture visibility and lighting smoothness.
Note: Requires bump-mapped textures to have an effect. High values may cause visual artifacts (e.g., sharp highlights). Test to avoid unnatural lighting or aliasing.
contrastGain 0.5

