Material
From NS2 community wiki
| | This page is a stub.
|
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.
Contents |
Example
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>
- The
<material>tag encompasses all of the parameters of the material. - The
<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, andvalueis a path name to the texture image file, relative to thens2folder (or possibly the relevant mod folder)
Textures
Map Types
texture
This is the default type; a texture map of the material. A typical material should have exactly one base texture.
bump
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.
opacity
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.
emissive
This type is most likely for self-illumination effects (muzzle flash, computer screens, LED's).
specular
Specular maps represent the reflectivity and shininess of the material.
Formats
The Spark engine natively supports DDS files for textures, and is also backwards-compatible with VTF files from the Source engine.
A texture may also be an SWF file, possibly for implementing GUIs on models.
External Links
NVIDIA Texture Tools (for DDS and Normal Map generation)
