|The following section discusses the materials system used in Halo. The materials or shaders are used to define the properties of the surfaces for which they are applied to as well as the rendering properties for the surface. This section includes material naming conventions and rules, special material names, and special shader symbols or flags.|
Materials define the properties of a surface in Halo. These properties not only include the basic texture image to render on the surface, but includes any special rendering effects as well as other data such as the type of material it is in regards to physics and projectile impact particle effects. Materials are often referred to as shaders.|
As with most data in Halo, shaders are defined in a data file called a tag. The shader tag contains many properties, flags, and fields for linking to other data tags, such as image data tags known as .bitmap tags. The .bitmap tag contains image data, such as an image and its associated mips, as well as other settings. The most basic shader typically contains just some simple default settings and a reference to a .bitmap for its base map.
There are many different shader types denoted by their file extension. The file extensions are fairly self explanatory, but there are 3 shader types that are commonly used for the creation of level geometry, these are listed and explained in the table below.
|Material Naming Conventions and Rules|
The following are some VERY important rules concerning materials used in Halo.
Materials have specific names and are applied to the surfaces (polygons, faces, etc...) of objects. It is these material names that reference a shader (in the form of a shader data tag). The shader is then used by Halo to apply the appropriate properties to the surface for that shader, including the rendering effects that should be applied as defined in the shader tag file.
The material name on the surface corresponds to the name of the shader tag. For example, a material is applied to the surface of a wall (the wall is made up of 2 polygons and the material is applied to these polygons). The name of the material as it appears in 3ds Max is "metal_wall". A shader will exist for this material, in this case the associated shader data tag would be named "metal_wall.shader_environment".
The shader data tags referenced for levels exist in subdirectories under the main level directories for that particular level. The subdirectory is called "shaders" (similarly, .bitmap files used by the shader files are contained in a directory called "bitmaps" ). These shader data tags contained in these shader directories are accessible to any level. Levels can reference their own shaders, shaders from other levels, the shaders can reference .bitmaps from other levels, etc...
When the .map cache file is created that contains the level assets, the associated resources (such as the shader data tags) are pulled into the .map cache file. Because of how the .map cache file is created and how the tools work the following rules must be followed:
1) Every material name (shader name) MUST BE UNIQUE. For example, you cannot have two or more shader files named "grass.shader_enviroment" that are used in a level(s) that are placed in multiple level's "shader" directories.
It is common practice that if custom shaders (new shader or a variation of an existing shader) are need for a specific level, the shader name is prefixed by the name of the level.
Using the example above, if you have a level called "mylevel" and wanted a new shader or to make changes to a shader that already existed called "grass.shader_environment" then you would call the shader "mylevel_grass.shader_environment" and place it in the "shader" sub-directory under the level directory, in this case the "mylevel" game level directory.
2) Material names (shader names) must be 32 characters or less (excluding the file extension name).
The following table shows the list of special material names in Halo. These material names are hard-coded in the tools and game to be recognized as having specific or unique functionality.|
These texture names should NOT be used or applied unless it is for the specific function for which they are designed. No data tags (.bitmap, .shader_environment, etc...) should use the name of a Special Material.
The following table shows the list of special material or shader symbols used to assign certain attributes or behaviors to a particular surface in the level.|
These shader symbols are hard-coded in the tools and game to be recognized as applying their associated attribute when added to the end of a material name.
These shader symbols should NOT be used or added to the name of a material unless it is for the specific function for which it is designed. These symbols should not appear anywhere in the normal name for a material nor should these special symbols appear in the name of a data tag (.bitmap, .shader_environment, etc...).
The shader symbols are taken into account during the compilation of the .jms and affect the surfaces at this time.
For example, if a ladder is created using 2 polygons and has the material "ladder" (without the quotes) assigned to it. This ladder is able to be viewed from both sides. To make the ladder a true ladder with respect to the Halo engine AND to make it able to be viewed or rendered from both sides the "%" would be added as well as the "^". The resulting material name viewed in 3ds Max for the Sub-Material under the Multi/Sub-Object would be "ladder%^" (without the quotes). The data tag name would still be ladder.shader_environment.