LIT: Difference between revisions
Barncastle (talk | contribs) m (→Header) |
Barncastle (talk | contribs) m (→Sky data) |
||
Line 71: | Line 71: | ||
So there are 18 time-based color rows described here, for the first block these are always the sky colors (well, the first 8 at least). WoWmapview is currently only drawing a very crude, fake sky globe - the colors may or may not match up ;) | So there are 18 time-based color rows described here, for the first block these are always the sky colors (well, the first 8 at least). WoWmapview is currently only drawing a very crude, fake sky globe - the colors may or may not match up ;) | ||
{{Template:SectionBox/VersionRange|min_expansionlevel=0|max_build=0.5.3.3368}} | |||
Just as in v8.5 each 'sky' has 4 sets of light data. | |||
struct LightData | |||
{ | |||
DiskLightDataItem m_lightdata; | |||
DiskLightDataItem m_stormdata; | |||
DiskLightDataItem m_lightdataWater; | |||
DiskLightDataItem m_stormdataWater; | |||
}[LitFile.lightCount]; | |||
struct DiskLightDataItem | |||
{ | |||
int32_t m_highlightCount[18]; | |||
LightMarker m_highlightMarker[18][32]; // this is the equivalent of [[DB/LightIntBand]] | |||
float m_fogEnd[32]; // the following float arrays are the equivalent of [[DB/LightFloatBand]] | |||
float m_fogStartScaler[32]; | |||
int32_t m_highlightSky; | |||
float m_skyData[4][32]; | |||
int32_t m_cloudMask; | |||
}; | |||
struct LightMarker | |||
{ | |||
int32_t time; | |||
{{Template:Type|CImVector}} color; | |||
}; | |||
The 7 sets of floating-point values have to describe the arrangement of the sky colors somehow, but they're pretty difficult to interpret. They usually contain at most 8 values, the rest being 0. | The 7 sets of floating-point values have to describe the arrangement of the sky colors somehow, but they're pretty difficult to interpret. They usually contain at most 8 values, the rest being 0. |
Revision as of 15:37, 11 September 2017
These files are obsolete!
LIT files have stored lighting-information until some patch. Today, lightning is stored in the following .DBCs:
For worlds that have terrain data, a corresponding LIT file includes information about the sky color, and possibly lighting conditions. They are stored in World\name\lights.lit
Header
Offset Type Description 0x00 uint32 Version number 0x04 uint32 Light count - number of skies defined in this file
64 bytes per sky:
Offset Type Description 0x00 C2iVectorⁱ (-1,-1) for the 'default' first record, (0,0) otherwise 0x08 int32 -1 for the 'default' first record, 0 otherwise 0x0C C3Vectorⁱ Coordinates (X,Y,Z) 0x18 float Light radius 0x1C float Light dropoff 0x20 char[32] Sky name
The float values seem to be multiplied by 36. Dividing by 36 gives back the original scale (I think) In the case of "I think", I think that the game client uses the floats to perform some kind of Cube-Mapped LightMapping (hence the X, Y, Z, -X, -Y, -Z values). -DG
The below structure has been taken from (0.5.3.3368) however it appears to have never changed.
struct LitFile { uint32_t_t versionNumber; // 0x80000004 v8.4 in 0.5.3, 0x80000005 v8.5 starting from ?? uint32_t lightCount; LightListData lightList[lightCount]; struct LightListData { C2iVectorⁱ m_chunk; int32_t m_chunkRadius; C3Vectorⁱ m_lightLocation; float m_lightRadius; float m_lightDropoff; char m_lightName[32]; }; }
Sky data
4 * 0x15F0 bytes per sky.
The first block of the four seems to have the sky colors, the second and fourth are usually all black, the third might be lighting colors or something else entirely.
Offset Type Description 0x0000 18 * int32 Lengths 0x0048 18 * 64 * int32 Color + time records 0x1248 32 * float Float values A 0x12C8 32 * float Float values B 0x1348 uint32 Int value I 0x134C 32 * float Float values C 0x13CC 32 * float Float values D 0x144C 32 * float Float values E 0x14CC 32 * float Float values F 0x154C uint32 Int value J 0x1550 32 * float Float values G 0x15D0 8 * uint32 Padding (all 0)
The color and time records are in the following format:
Each row of 64 integers contains 32 pairs of integers: the first value is the time in half-minutes (on a scale of 0 to 2880 from midnight to midnight), the second value is a BGRX color. The i-th row contains Lengths[ i ] records like that. I think the color values for intermediate times are interpolated based on the times given in this list.
So there are 18 time-based color rows described here, for the first block these are always the sky colors (well, the first 8 at least). WoWmapview is currently only drawing a very crude, fake sky globe - the colors may or may not match up ;)
Just as in v8.5 each 'sky' has 4 sets of light data.
struct LightData { DiskLightDataItem m_lightdata; DiskLightDataItem m_stormdata; DiskLightDataItem m_lightdataWater; DiskLightDataItem m_stormdataWater; }[LitFile.lightCount]; struct DiskLightDataItem { int32_t m_highlightCount[18]; LightMarker m_highlightMarker[18][32]; // this is the equivalent of DB/LightIntBand float m_fogEnd[32]; // the following float arrays are the equivalent of DB/LightFloatBand float m_fogStartScaler[32]; int32_t m_highlightSky; float m_skyData[4][32]; int32_t m_cloudMask; }; struct LightMarker { int32_t time; CImVectorⁱ color; };
The 7 sets of floating-point values have to describe the arrangement of the sky colors somehow, but they're pretty difficult to interpret. They usually contain at most 8 values, the rest being 0.
So today I experimented with a custom .LIT file (red and blue skies are hilarious), so here are the meanings for the various color tracks:
Number Description 0 Global diffuse light 1 Global ambient light 2 Sky color 0 (top) 3 Sky color 1 (middle) 4 Sky color 2 (middle to horizon) 5 Sky color 3 (above horizon) 6 Sky color 4 (horizon) 7 Fog color / background mountains color 8 ? 9 Sun color + sun halo color 10 Sun larger halo color 11 ? 12 Cloud color 13 ? 14 ? 15 Ground shadow color 16 Water color [light] 17 Water color [dark]
The different skies are interpolated based on distance.
The four sets of data are completely different. #0 is the default look. #1 and #3 are usually all black. #2 might be the 'ghost view' lighting for when you're dead, but I'm not sure.