Generating Stars DAT File

Overview

This document is targeted at people who want to modify the stars data that is used in the sky rendering. This assumes some familiarity with generating binary files.

  • Data file: Build\Engine\EngineAssets\Sky\stars.dat
  • Loader code file: CRESky.cpp, function CStars::LoadData

File Format

The file has a simple binary format, and you can easily write the data you want in there yourself with some tool.

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

The file starts with a header. The header is immediately followed by entries for each star (the number of entries is stored in the header).

Layout and types 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

Typically, you can use existing star catalogs to populate this information for you, or you can use the one that is provided in the SDK (which is based of real-world information).