| "We need more resources!"
A material is an XML file that defines a two-dimensional texture in the Spark engine. The extension of a material file is, naturally, .material.
These are the contents of a typical material file (ns2/materials/refinery/refinery_grate_01.material):
<material> <maps> <map type="texture" value="materials/refinery/refinery_grate_01.dds" /> <map type="bump" value="materials/refinery/refinery_grate_01_normal.dds" /> <map type="opacity" value="materials/refinery/refinery_grate_01_opac.dds" /> </maps> </material>
<material>tag encompasses all of the parameters of the material.
<maps>tag contains a list of one or more texture maps used for the material.
- Each map element has two known parameters;
typespecifies what type of texture map it is, and
valueis a path name to the texture image file, relative to the
ns2folder (or possibly the relevant mod folder)
This is the default type; a texture map of the material. A typical material should have exactly one base texture.
This is usually a normal map or bump map of the material. Normal maps (and other maps) should be the same size as the base texture.
This type represents an alpha map of the material. White pixels are opaque (blocks light and vision), black pixels make the corresponding pixels of the material invisible, and anything in-between makes the material partially visible.
This type is most likely for self-illumination effects (muzzle flash, computer screens, LED's).
Specular maps represent the reflectivity and shininess of the material.
A texture may also be an SWF file, possibly for implementing GUIs on models.