Call of Duty 4: Advanced Lighting

From COD Modding & Mapping Wiki
Revision as of 01:52, 16 October 2008 by Daevius (talk | contribs) (New page: Category:Call of Duty 4 ==Sunlight== Image:Nutshell.png Sunlight is considered a “Direct” light. What this means is that Specular and Normal Maps on models and world materials...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sunlight

Sunlight is considered a “Direct” light. What this means is that Specular and Normal Maps on models and world materials are effected by this light. In other words, this is a real time dynamic light that casts shadows and can change over time through script.

The sunlight is an infinite parallel light. This means that it does not emanate from a single point in space.

This is the simplest, easy to use, of all the light types in COD4.

You must enter a direction, color, and sunlight value for the sun to turn on.

Note: You can disable the sun as a primary light if needed by entering "sunIsPrimaryLight" "0" into the world spawn.


  • SunDirection


This works exactly the same as COD2

The axis is based on world space, not local to the light. The first number is the north south axis. The second number is the up down axis. The third number is the axis that is along the direction of the light and has no effect (Why is it there?...Who knows.).

Here are some examples looking top down in radiant:

“sundirection” “0 0 0” --- Light comes from the right
“sundirection” “90 0 0” ---Light comes from the bottom
“sundirection” “-90 0 0” --- Light comes from the top
“sundirection” “0 90 0” --- Light comes from the top
“sundirection” “0 180 0” --- Light comes from the left


  • Sun Color/Sunlight (Brightness)


“suncolor” “# # #” uses three numbers to set the color. They represent RGB. Instead of using a 0-255 format, radiant uses a 0-1 format. To convert a value in the 0-255 range to the 0-1 range, divide the number by 255.

Example:

128/255 = .5 (roughly)

“sunlight” “#” Is how bright the sun is. You can use values over one if needed.

 Note: By hitting f8 you can activate the light preview in radiant. 
You need all setting for sun and ambient light for this to work.