NOD Engine SDK 1.0

NAM File Specifications

Introduction

The NAM file (for Nihilistic Animated Material) is used to store additional information about a texture used in the game engine. Originally the file was created mainly to allow multi-frame animations within a material, but later was expanded to include any information needed to render a surface beyond the basic texture map.

NAM files are used for almost all displayed textured in the game. Textures can exist without NAM files, however. Within the game engine and data files, most materials are referred to by name alone, with no extension. For instance, if you apply a texture "wall1" to a surface in Embrace, it stores just the name "wall1" in the NIL file. If there exists a file named "wall1.nam", then it will parse and use the blend modes specified in that file. If no such file exists, it will try to open "wall1.tga" and use standard "decal" drawing modes for that texture. In other words, there is an automatic implied NAM file for every TGA that exists in the game.

NAM files are useful because they allow the behaviors of a texture or surface to be changed without re-texturing walls in the Embrace editor, by simply editing or creating an appropriately named NAM ASCII file.

Format

The basic file format contains keywords followed by parameters whose meaning depends on the initial keyword. All parameters are separated by spaces or TABS, and are not case-sensitive. The following table explains the keywords available in a NOD file

Material Keywords

Keyword

Parameters

Comments

Texture

<Name>

Defined the basic texture to use. In an animated texture, this keyword can appear multiple times, once for each texture frame. If an animated texture has the same texture repeated, the line can appear twice with the same texture name.

Numframes

<Count>

Specifies how many frames will be defined for a page-flipped animated material. Should be included BEFORE the first "texture" keyword so the system can pre-allocate an array of frame data.

Specular

None

Enable specular highlights for this material (not supported in 1.0)

Masked

None

Treats the alpha in the texuremap as a 1-bit alpha and renders the material as "masked", as if it has transparent holes. This affects the z-buffering methods used for a 1-bit alpha texture, as well as filtering, etc.

Fullylit

None

Always render this surface as fully lit. Used to simulate light-emitting surfaces.

Addblend

None

Use a blend mode that adds this texture to the existing frame color. This creates a glowing effect with the texture map, used often for particles. Similar to alpha blending.

Subblend

None

Like addblend, but darkens the texture beneath it.

Envmap

None

Enable environment mapping for this material (not supported in 1.0)

Glow

<Name>

Load an additional texture to be used as a "glow map". The glow map is rendered as an additional pass using additive blending. Used to make parts of a texture appear to be lit while the underlying texture is not.

Twosided

None

Objects textured with this material should be considered two-sided when rendered.

GlowRamp

<Integer>

Instructs the glow map to have its lighting controlled by one of the engine lightstyles.

Pageflip

<Integer>

Instructs a multi-frame material to automatically page-flip every <Integer> milliseconds.

Sound

<Name>

Specifies the sound type for the material. Valid sound names are shown in a table below

Flicker

<Integer>

If the material has multiple frames, flicker instructs the rendering system to alternate between frame 0 and frame 1 of the material based on a lightstyle internal to the engine (specified by the integer). Used to simulate broken fluorescent lights and so on

Detail

<Name>

Specify the name of a TGA for use as a detail map on all surfaces using this material. Detail textures use a special blend mode that will override any NAM file on the texture specified. Generally detail mips should MIP to 50% grey.

DetailScale

<Float>

Specifies the scaling factor used when computing the texture coordinates for the detail texture map. Higher numbers = smaller detail texture size.

Pass

<PassNum> [nomip] <Texture> <BlendMode>

The Pass keyword allows lower-level control for blend mode specification. This keyword is not compatible with most of the other keywords. This method allows the user to specifically control each pass of a multipass shader. PassNum begins at 0 and increases for additional passes. <Texture> specifies the name of the TGA to use for that pass. Special texture names are available: $lightmap specifies the surface’s lightmap texture (if any), $lightadd specifies the application of light decals from dynamic sources. Blend modes are described in a separate table.

Slide

<PassNum> (<du>,<dv>)

Used only with materials using the PASS keyword. Allows the user to enable uv-sliding on a specific pass in the renderer. The rate is specified as (du,dv) which is the slide rate in floating-point texels, and can be positive or negative.

Surface Sound Types

Specifying a sound type for a surface in the NAM affects the sounds that objects make when hitting the surface, or the sound that actor’s footsteps make when walking across a surface with that material. The default sound type for surfaces without a NAM file is "Stone".

Sound Type

Carpet

Dirt

Metal

Wet

Snow

Stone

Street

Wood

Creaky

Silent

PASS Blend Modes

The following table indicates which blend modes are available for specification with the "pass" rendering keyword. Not all cards will necessarily display all these modes correctly.

Blend Mode

Description

Carpet

 

Dirt

 

Metal

 

Wet

 

Snow

 

Stone

 

Street

 

Wood

 

Creaky

 

Silent

 

 

Sample File

pass 0 waterTest.tga modplusdest
pass 1 watertest2.tga modplusdest
pass 2 waterTest.tga modplusdest
pass 3 $lightmap modulatepost
sound wet
slide 0 (0.2,0.1)
slide 1 (0.1,-0.2)
slide 2 (-0.3, -0.05)