The shader_
Singleplayer units have their colors set in their actor_
Base map
The base map controls the diffuse color and transparency of the shader. The RGB diffuse color is multiplied with the color change source if used, masked by the multipurpose map's color change mask. The base map's alpha channel is a transparency mask.
Multipurpose map
The multipurpose map is an optional bitmap whose individual channels provide greyscale masks for color change, reflections, self illumination, and detail maps (a technique called channel packing). The purpose of each channel depends on the game version:
Gearbox
When Gearbox ported Halo to PC, the channels were reordered for an unknown reason. This is also true for all Gearbox-derived ports like H1A unless the OG Xbox channel order flag is set. Because of this change in shader behaviour, multipurpose map tags differ between H1X and Gearbox.
If you're using the legacy HEK and H1CE, don't pay attention to Guerilla's channel usage description when editing this tag. It describes Xbox channel order only which is incorrect. In H1A Guerilla the channel order is corrected described.
- Red: is an auxiliary mask. It can mask the detail map if the detail mask is set to multipurpose map alpha. Despite the option saying "alpha" in Guerilla it really means the red channel in this context.
- Green: Masks self-illumination, used for lights on the model. The self-illumination is added to diffuse light and then multiplied with diffuse color, rather than being added after. This means pure black areas of the diffuse map cannot have self-illumination.
- Blue: Masks cube map specular reflections. Pure blue is highest specularity, while black is none.
- Alpha: Masks color change, such as for armour ranks/teams. Color sources include the actor_
variant, multiplayer colors, and object.
It is a common misconception that multipurpose maps need to be purple due to some stock tags having an identical red and blue channel. However, it is not necessary to have any red channel information if you do not require detail map masking or another channel can serve as the detail map mask.
Xbox
Channel order is different on the classic Xbox version of the game. Guerilla correctly describes multipurpose maps extracted from Xbox maps:
- Red: Specular reflection mask (modulates reflections)
- Green: Self-illumination mask (adds to diffuse light)
- Blue: Primary change-color mask (recolors diffuse map)
- Alpha: Auxiliary mask
Change color
The change color feature allows parts of the shader to be recolored at runtime for random variation and different ranks without requiring a different bitmap for each color.
The color from the change color source gets multiplied against the base map, using the color change mask from the multipurpose map. The channel of the mask depends on the channel order (Gearbox vs Xbox).
Change color sources originate from either the object tag's change colors block or are overriden by actor_
Structure and fields
Field | Type | Comments | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shader model flags | bitfield | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
translucency | float | ||||||||||||||||||||||||||||||||||||||||
change color source | enum | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
shader model more flags | bitfield | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
color source | enum ? | ||||||||||||||||||||||||||||||||||||||||
animation function | enum | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
animation period | float | ||||||||||||||||||||||||||||||||||||||||
animation color lower bound | ColorRGB | ||||||||||||||||||||||||||||||||||||||||
animation color upper bound | ColorRGB | ||||||||||||||||||||||||||||||||||||||||
map u scale | float | ||||||||||||||||||||||||||||||||||||||||
map v scale | float | ||||||||||||||||||||||||||||||||||||||||
base map | TagDependency : bitmap | A bitmap which provides diffuse colour and transparency information to the shader. See details. | |||||||||||||||||||||||||||||||||||||||
multipurpose map | TagDependency : bitmap | A bitmap which provides masks for reflection, self-illumination, colour change, and detail maps. See details. | |||||||||||||||||||||||||||||||||||||||
detail function | enum | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
detail mask | enum | Determines the source of detail map masking. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
detail map scale | float | ||||||||||||||||||||||||||||||||||||||||
detail map | TagDependency : bitmap | ||||||||||||||||||||||||||||||||||||||||
detail map v scale | float | ||||||||||||||||||||||||||||||||||||||||
u animation source | enum | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
u animation function | enum ? | ||||||||||||||||||||||||||||||||||||||||
u animation period | float | ||||||||||||||||||||||||||||||||||||||||
u animation phase | float | ||||||||||||||||||||||||||||||||||||||||
u animation scale | float | ||||||||||||||||||||||||||||||||||||||||
v animation source | enum ? | ||||||||||||||||||||||||||||||||||||||||
v animation function | enum ? | ||||||||||||||||||||||||||||||||||||||||
v animation period | float | ||||||||||||||||||||||||||||||||||||||||
v animation phase | float | ||||||||||||||||||||||||||||||||||||||||
v animation scale | float | ||||||||||||||||||||||||||||||||||||||||
rotation animation source | enum ? | ||||||||||||||||||||||||||||||||||||||||
rotation animation function | enum ? | ||||||||||||||||||||||||||||||||||||||||
rotation animation period | float | ||||||||||||||||||||||||||||||||||||||||
rotation animation phase | float | ||||||||||||||||||||||||||||||||||||||||
rotation animation scale | float | ||||||||||||||||||||||||||||||||||||||||
rotation animation center | Point2D | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
reflection falloff distance | float | ||||||||||||||||||||||||||||||||||||||||
reflection cutoff distance | float | ||||||||||||||||||||||||||||||||||||||||
perpendicular brightness | float | ||||||||||||||||||||||||||||||||||||||||
perpendicular tint color | ColorRGB | ||||||||||||||||||||||||||||||||||||||||
parallel brightness | float | ||||||||||||||||||||||||||||||||||||||||
parallel tint color | ColorRGB | ||||||||||||||||||||||||||||||||||||||||
reflection cube map | TagDependency : bitmap | ||||||||||||||||||||||||||||||||||||||||
unknown | float |
Acknowledgements
Thanks to the following individuals for their research or contributions to this topic:
- Giraffe (Animation for change color masking)
- Jakey (Discovering that self-illumination is added to diffuse light, not diffuse color)
- Kavawuvi (Invader tag definitions)
- MosesOfEgypt (Tag structure research)
- t3h lag (Explaining multipurpose map channels)