Daggerfall Mod:Image formats/SKY

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

The SKY??.DAT files found within the ARENA2 folder are used to draw the "skybox". This is the texture which is applied to the extent of the visible range within the environment. These textures include the "flat" mountains and trees which compose the horizon, as well as the sun rising and setting.

General Format[edit]

A SkyFile structure is very similar to a palettized RciFile. Each begins with a palette list, followed by a block of unknown data (appears to be a set of colour translation tables), followed by a set of images.

SkyFile coarse structure
PaletteList
ColourTranslationList
ImageList

PaletteList[edit]

Each SkyFile structure immediately begins with a set of 32 ColFile structures.

ColourTranslationList[edit]

Immediately following the PaletteList is a contiguous list of 32 ColourTranslationFile structures. Each is associated with a palette from the previous list by ordinal; that is to say the fifth ColourTranslationFile element is associated with the PaletteList's fifth Palette element.

These are used to "fade" objects as they approach to or recede from the player.

ImageList[edit]

Immediately following the Section2 section, is a contiguous list 64 RciFiles, in uncompressed format. Each image is 512x220 pixels. The first 32 images are those with the sun visible, and the latter 32 are those without the sun visible. The first set are used for the Western sky in the morning hours with the second set used for the Eastern sky. At noon the assignments are reversed and thus one may observe the sun rising in the East and setting in the West.

These two sets could be considered an animation of sorts, similar to Magic Spell CIF Files, where the frame-rate is measured in hours rather than fractions of a second.

Reading SKY Files[edit]

Given the sizes for all records within a SkyFile are each of fixed size, one may read a SkyFile randomly. In this case, one may merely read the appropriate Palette, ColourTranslation, and pair of RciFiles by computing their offsets.