All colours in TR are specified either explicitly (using either the [[fundamentals#​tr_colour|[tr_colour]]] structure, described below, 16-bit structures or 32-bit structures) or implicitly, by indexing one of the palettes. However, it is only applicable to TR1-3 — there is no palette in TR4 and TR5.

+

All colours in TR are specified either explicitly (using either the [[.savegame:​trs:​fundamentals#​tr_colour|[tr_colour]]] structure, described below, 16-bit structures or 32-bit structures) or implicitly, by indexing one of the palettes. However, it is only applicable to TR1-3 — there is no palette in TR4 and TR5.

In TR1-3, mesh surfaces could be either //​coloured//​ or //​textured//​. //​Coloured//​ surfaces are “painted” with a single colour that is either specified explicitly or using an index into the palette.

In TR1-3, mesh surfaces could be either //​coloured//​ or //​textured//​. //​Coloured//​ surfaces are “painted” with a single colour that is either specified explicitly or using an index into the palette.

Line 103:

Line 103:

//​Textured//​ surfaces map textures (bitmapped images) from the texture tiles (textiles) to each point on the mesh surface. This is done using conventional UV mapping, which is specified in “Object Textures” below; each object texture specifies a mapping from a set of vertices to locations in the textile, and these texture vertices are associated with position vertices specified here. Each textile is a 256x256 pixels wide area.

//​Textured//​ surfaces map textures (bitmapped images) from the texture tiles (textiles) to each point on the mesh surface. This is done using conventional UV mapping, which is specified in “Object Textures” below; each object texture specifies a mapping from a set of vertices to locations in the textile, and these texture vertices are associated with position vertices specified here. Each textile is a 256x256 pixels wide area.

-

The 16-bit textile array, which contains [[fundamentals#​tr_textile16|[tr_textile16]]] structures, specifies colours using 16-bit ARGB, where the highest bit (''​%%0x8000%%''​) is a crude alpha channel (really just simple transparency — //​0 = transparent//,​ //1 = opaque//). The next 5 bits (''​%%0x7C00%%''​) specify the red channel, the next 5 bits (''​%%0x03E0%%''​) specify the green channel, and the last 5 bits (''​%%0x001F%%''​) specify the blue channel, each on a scale from 0..31.

+

The 16-bit textile array, which contains [[.savegame:​trs:​fundamentals#​tr_textile16|[tr_textile16]]] structures, specifies colours using 16-bit ARGB, where the highest bit (''​%%0x8000%%''​) is a crude alpha channel (really just simple transparency — //​0 = transparent//,​ //1 = opaque//). The next 5 bits (''​%%0x7C00%%''​) specify the red channel, the next 5 bits (''​%%0x03E0%%''​) specify the green channel, and the last 5 bits (''​%%0x001F%%''​) specify the blue channel, each on a scale from 0..31.

-

{{:​icons:​tr1.png?​nolink|TR1 only}}{{:​icons:​tr2.png?​nolink|TR2 only}}{{:​icons:​tr3.png?​nolink|TR3 only}} If, for some reason, 16-bit textures are turned off, all colours and textures use an 8-bit palette that is stored in the level file. This palette consists of a 256-element array of [[fundamentals#​tr_colour|[tr_colour]]] structures, each designating some colour; textures and other elements that need to reference a colour specify an index (0..255) into the ''​%%Palette[]%%''​ array. There is also a 16-bit palette, which is used for identifying colours of solid polygons. The 16-bit palette contains up to 256 four-byte entries; the first three bytes are a [[fundamentals#​tr_colour|[tr_colour]]],​ while the last byte is ignored (set to 0).

+

{{:​icons:​tr1.png?​nolink|TR1 only}}{{:​icons:​tr2.png?​nolink|TR2 only}}{{:​icons:​tr3.png?​nolink|TR3 only}} If, for some reason, 16-bit textures are turned off, all colours and textures use an 8-bit palette that is stored in the level file. This palette consists of a 256-element array of [[.savegame:​trs:​fundamentals#​tr_colour|[tr_colour]]] structures, each designating some colour; textures and other elements that need to reference a colour specify an index (0..255) into the ''​%%Palette[]%%''​ array. There is also a 16-bit palette, which is used for identifying colours of solid polygons. The 16-bit palette contains up to 256 four-byte entries; the first three bytes are a [[.savegame:​trs:​fundamentals#​tr_colour|[tr_colour]]],​ while the last byte is ignored (set to 0).

-

{{:​icons:​tr4.png?​nolink|TR4 only}}{{:​icons:​tr5.png?​nolink|TR5 only}} The 32-bit textile array, which contains [[fundamentals#​tr4_textile32|[tr4_textile32]]] structures, specifies colours using 32-bit ARGB, where the highest byte (A) is unused. The next bytes specify (in this order) the red / green / blue channels. The 16-bit and 32-bit textile arrays depict the same graphics data, but of course the 32-bit array has a better colour resolution. It’s the one used if you select a 32-bit A8R8G8B8 texture format in the setup menu from TR4 and TR5.

+

{{:​icons:​tr4.png?​nolink|TR4 only}}{{:​icons:​tr5.png?​nolink|TR5 only}} The 32-bit textile array, which contains [[.savegame:​trs:​fundamentals#​tr4_textile32|[tr4_textile32]]] structures, specifies colours using 32-bit ARGB, where the highest byte (A) is unused. The next bytes specify (in this order) the red / green / blue channels. The 16-bit and 32-bit textile arrays depict the same graphics data, but of course the 32-bit array has a better colour resolution. It’s the one used if you select a 32-bit A8R8G8B8 texture format in the setup menu from TR4 and TR5.

==== Meshes and Sprites ====

==== Meshes and Sprites ====

Line 255:

Line 255:

The only difference is the extra field ''​%%Effects%%''​. It has this layout:

The only difference is the extra field ''​%%Effects%%''​. It has this layout:

-

* //Bit 0:// if set, face has //additive alpha blending// (same meaning that when the ''​%%Attribute%%''​ field of [[miscellany#​tr_object_texture|[tr_object_texture]]] is 2, but this flag overrides it).

+

* //Bit 0:// if set, face has //additive alpha blending// (same meaning that when the ''​%%Attribute%%''​ field of [[trs:miscellany#​tr_object_texture|[tr_object_texture]]] is 2, but this flag overrides it).

All the info about ''​%%Texture%%''​ and ''​%%Effects%%''​ fields is also similar to same info from [[fundamentals#​tr_face4|[tr_face4]]] and [[fundamentals#​tr4_mesh_face4|[tr4_mesh_face4]]] respectively.

+

All the info about ''​%%Texture%%''​ and ''​%%Effects%%''​ fields is also similar to same info from [[.savegame:​trs:​fundamentals#​tr_face4|[tr_face4]]] and [[.savegame:​trs:​fundamentals#​tr4_mesh_face4|[tr4_mesh_face4]]] respectively.