Skip to content

Light and fog files

SEGA Ninja (SA2)Lighting and skyApplies toSA2B

Each stage can have a light file and one or more fog files. The stage module names them as strings (for example stg13_light.bin and stg13_fog.bin in stg13D.rel, or stg24_fogA.bin in stg24D.rel), and a named file need not exist on the disc: stg13_fog.bin is named but absent, so City Escape has no fog file. Observed stgNN_light_gc.bin files exist for 18 stages but are named in no module; they are found by name convention. Observed 104 light and fog files are present in all. Observed Counts come from a recorded census of the USA disc GSNE8P; they cannot be re-checked now. Observed

Big-endian, from SA Tools’ SA2LightFogEditor. Sourced · SA Tools

Light slot (stgNN_light.bin, 0x180 bytes = 12 slots)32 bytesSA2B0% known

Big-endian. Twelve slots; dir is the direction the light travels ((0, −1, 0) = from above).

ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x012f32[3]dirSourced
0xC4f32color multiplierSourced
0x104f32ambient multiplierSourced
0x1412f32[3]colorSourced
Light slot (stgNN_light_gc.bin, 0x240 bytes = 12 slots)48 bytesSA2B0% known

Big-endian. Twelve slots.

ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x012f32[3]dirSourced
0xC12f32[3]colorSourced
0x1812f32[3]ambientSourced
0x244s32overrideSourced
0x284s32unknownUnknown
0x2C4s32unknownUnknown
Fog header (16 bytes)16 bytesSA2B0% known

Big-endian. A 0x210-byte variant adds a 128-entry f32 table, which is not decoded.

ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x02s16typeSourced
0x22s16unknownUnknown
0x44u8[4]colourSourcedA, R, G, B
0x84f32max distanceSourced
0xC4f32min distanceSourced

Which light slot lights the landtable, how _light and _light_gc combine, which fog variant (A, B, C) is active where, and the 128-entry fog table are not in the files. Unknown Sky models are drawn by stage code and are not in the landtable. Observed

Which light slot lights a landtable and which fog variant applies?

All slots are present in the files; the selection is engine code. The first slot of _light.bin is probably the daylight slot, with its ambient multiplier as the world ambient (inferred).