Sun Settings

Tutorials for CoD:WaW Mapping

Moderator: Core Staff

Post Reply
steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Sun Settings

Post by steveuk » November 25th, 2008, 4:10 pm

Sun Settings

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

“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.
Sunflare

1. Create the sun file.
- Create a new file under CoDWaW/raw/sun (create the folder sun is not there already) - Copy this in the new file:

Code: Select all

r_sunsprite_shader "sun"
r_sunsprite_size "28.8433"
r_sunflare_shader "sun_flare_icbm"
r_sunflare_min_size "237.8"
r_sunflare_min_angle "40.869"
r_sunflare_max_size "669.9"
r_sunflare_max_angle "2.14669"
r_sunflare_max_alpha "0.62536"
r_sunflare_fadein "0.2604"
r_sunflare_fadeout "0.2992"
r_sunblind_min_angle "33.9543"
r_sunblind_max_angle "9.9647"
r_sunblind_max_darken "0.20934"
r_sunblind_fadein "0.5"
r_sunblind_fadeout "1"
r_sunglare_min_angle "10.6101"
r_sunglare_max_angle "48.2526"
r_sunglare_max_lighten "0.21569"
r_sunglare_fadein "2.263"
r_sunglare_fadeout "3"
r_sun_fx_position "X Y Z"
All can be customize to suit you, especially "r_sunsprite_shader/r_sunflare_shader". One parameters is VERY important:
r_sun_fx_position
You need to replace X Y Z by your Worldspawn value for "sundirection".
Once happy, save the file as mp_yourmapname.sun

2. Add sunfile to Zonefile:

Add the following line to your Zone File:

Code: Select all

rawfile,sun/mp_yourmap.sun

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests