From NS2 community wiki
Jump to: navigation, search

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):

        <map type="texture" value="materials/refinery/" />
        <map type="bump" value="materials/refinery/" />
        <map type="opacity" value="materials/refinery/" />
  1. The <material> tag encompasses all of the parameters of the material.
  2. The <maps> tag contains a list of one or more texture maps used for the material.
  3. Each map element has two known parameters; type specifies what type of texture map it is, and value is a path name to the texture image file, relative to the ns2 folder (or possibly the relevant mod folder)


Map Types


This is the default type; a texture map of the material. A typical material should have exactly one base texture.

Texture components of refinery_grate_01.material


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.


The Spark engine natively supports DDS files for textures

External Links

NVIDIA Texture Tools (for DDS and Normal Map generation)