With the new lighting engine introduced in patch 81.8193.15, the core shaders of NWN:EE now accepts a number of inputs for generating more advanced content that benefits from the new PBR lighting engine. These can be set by supplying a custom material file that a given model can then refer to, using either the standard "bitmap" field or the designated "materialname" field, as described in the material file format section.
These inputs are used to modulate how meshes applied the material are rendered, generally by informing the renderer with the desired physical properties of the surface of the objects, which the engine will then use to generate results with a high level of realism.
The main way of supplying these inputs is by special texture maps. You specify these by adding a "texture*" entry in the material file, where "*" is replaced with the index in the table below, followed by your texture name for that input. If using NWN Crunch (recommended), you can also get the tool to generate the material file for you by simply adding certain standardized suffixes to the texture map names instead.
Below is an overview of the texture map inputs supported by default.
|0||3 or 4|
Base color / diffuse map with optional alpha.
This map affects the color of the diffuse reflection from the material. For metals, it also adjusts the specular reflection color.
If omitted, the material will simply use the texture matching the material name.
Notice: PLT textures can not be designated through material files, so for those, the texture0 entry must be omitted (and the material file must match the name of the PLT texture).
Used to generate the illusion of higher levels of geometric complexity of models when doing lighting. For a basic introduction, see this.
You can supply three channel normal maps (RGB), but only two color channels (red and green) will be used, where green is up (the OpenGL standard).
Sets the material specularity. As the value goes toward 1 (white), this will also result in the material behaving as metallic, where the diffuse texture will be used for tinting the specular reflection color. For the same reason, a metallicness map can usually work as input for this texture (NWN Crunch also takes metallicness maps as inputs).
If omitted, the renderer will try to approximate a value based on diffuse texture alpha if environment mapped, and use a basic value that fits the average non-metal materials otherwise.
If omitted, the renderer will try to approximate values based on specularity (see above).
Used for parallax displacement as well as basic light occlusion.
By default, 1 (pure white) is the base level, with lower values resulting in the appearance of depressions in the surface geometry.
If omitted, light occlusion is partly derived from diffuse texture brightness.
Makes the material light up in the color and pattern
The example textures combined produce this result:
Example material file:
In addition, the standard shaders accept a number of standard parametric inputs, listed below.
For these to work, you must specify a shader to use in the material file, even if using the default. Usually you will want to just use the standard "vslit_nm" and "fslit_nm".
|float||Roughness||0.001 - 1.0||Sets the roughness for the material.|
|float||Specularity||0.001 - 1.0||Sets the specularity for the material.|
|float||Metallicness||0.001 - 1.0||Sets the metallicness for the material, which again determines the saturation of the specular reflection color. Normally, this is derived from specularity, but this parameter can be used to override that setting.|
|float||DisplacementOffset||0.0 - 1.0||Sets an offset to the base level for displacement when reading the height map. By default, 1.0 (white) is the base level, but with a DisplacementOffset of 1.0, the base level is 0.0, etc.|
This is an example material file (used in the core game to make ice appear non-metallic):