Material

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.

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

Textures

Map Types

texture

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

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)

Personal tools