Version:

IN THIS ARTICLE

Generating Stars .dat File

Generating Stars .dat File

The Stars .dat file contains star data that is used in sky rendering. This topic provides information you’ll need if you want to modify the data in this file. It assumes you have some familiarity with generating binary files.

Star data is located in Build\Engine\EngineAssets\Sky\stars.dat. This data is loaded in the function CStars::LoadData, implemented in the file CRESky.cpp.

File Format

The Stars .dat file uses a simple binary format; it can be easily modified using an editing tool. The file starts with a header, followed by entries for each star. The header specifies the number of entries in the file.

All types stored in little-endian format, float32 in IEEE-754 format.

Star data provided in the SDK is based on real-world information. Typically, you can also use existing star catalogs to populate this information for you.

The file elements are as follows:

Header (12 bytes)

NameOffsetTypeValue
Tag0uint320x52415453 (ASCII: STAR)
Version4uint320x00010001
NumStars8uint32Number of star entries in the file

Entry (12 bytes)

NameOffsetTypeValue
RightAscension0float32in radians
Declination4float32in radians
Red8uint8star color, red channel
Green9uint8star color, green channel
Blue10uint8star color, blue channel
Magnitude11uint8brightness, normalized range