fps.gif (3966 bytes)
Sky Light

transparent.gif (893 bytes)FPSNews Up

FPSNews
Up
Target a Light
Add light to Models
Sky Light
Shaders
Light Beams
Ambient Light

Light Part 4
Sky Light
 

In Q3, textures can emit light. These textures are associated with a text file called a shader which has all the information about how bright the light is, the color, and whether there are any special effects such as flashing or pulsating.
Many of the textures that have affects in them by the use of alpha channels to make one check out my tutorial on alpha channels here.
Such textures are also referred to as shaders after the eponymous files

Basic types of light emitting textures in Q3A are:
Sky textures
Liquid textures like lava, or slime.
Textures on regular brush's one example would be a light texture.

These are all basically the same only different shaders.
Lets start with sky's.
Then are found in the texture skies folder.
Lets pick one say textures/skies/killsky


Here's the shader.

textures/skies/killsky
{
qer_editorimage textures/skies/killsky_1.tga
surfaceparm noimpact
surfaceparm nomarks
surfaceparm nolightmap
// surfaceparm sky

q3map_sun 3 2 2 70 315 65
q3map_surfacelight 75
skyparms - 512 -

//cloudparms 512 full
//lightning

{
map textures/skies/killsky_1.tga
tcMod scroll 0.05 .1
tcMod scale 2 2
}
{
map textures/skies/killsky_2.tga
blendfunc GL_ONE GL_ONE
tcMod scroll 0.05 0.06
tcMod scale 3 2
}
}


Insert pic from level


The sky does seem a little dark. That's because the q3map_surfacelight parameter only has a value of 75 which is not very bright for a colored sky.

The sun part of the shader tells the rest of the reason.
I have color coded it to help explain what all the numbers are for.
As you can see the color is red 3 2 2 the intensity is 70 the degree is 315 and the elevation is 65

q3map_sun 3 2 2 70 315 65

This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, nova, etc.). This is only processed during the lighting phase of q3map.

red green blue: Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn’t matter what range you use.

intensity: is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.

degrees: is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.

elevation: is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon

This might see hard at first but it really isn't and someday you will want to make your own sky shader.
At the very least you can now look at the shaders and know what they are doing....



Lets go to the next page to talk about the other textures that give off light.  Lighting part 5 


 

 

Hit Counter

 

Bill Brooks © 1999
email contact: Bill Brooks