View Single Post
Old 03-01-09, 05:01 PM   #183
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 28
Uploads: 3
Default

The first float (intensity) becomes attenuation (gradual loss of intensity), and the 2nd float (the last 4 bytes) is 'Range' in game units. In the ambient/directional scenario this has no meaning and no data is stored at all... (in this case the chunk is 4 bytes shorter)

[edit]
Here's the structure:

public class Light
{
LightType _type;
Color _color; // ABGR
float _attenuation;
float _range; // Not stored when _type != 2 (Omni);

.. excluded property accessors..
}

public enum LightType
{
Ambient,
Direct,
Omni
}
skwasjer is offline   Reply With Quote