Arcane University:Mesh Export to NIF

The Beyond Skyrim Wiki — Hosted by UESP
Revision as of 05:19, 27 March 2020 by Hannes821 (talk | contribs) (Setting up the Nif-specific shader properties and texture sets)
Jump to: navigation, search

Meshes can be exported by the following applications:

  • Blender export plugin (Version 2.69 and 2.7x)
  • 3DS MAX export plugin (Versions xxx)
  • CK-CMD


General NIF structure

BSShaderProperties and BSTextureSet NIF (Netimmerse Gamebryo) files in Skyrim are the files that hold the 3D Model information necessary to display objects in the game. When you open a NIF file in NifSkope, every NiTriShape represents a 3D Object instance. A single NIF file can have multiple instances of these and they can reside under various parent nodes. A NiTriShape can have the following child properties among others: ● NiTriShapeData is the actual mesh. ● BSDismemberSkinInstance is the information necessary to handle limbs being dismembered from the base mesh. Those nodes hold all skinning/rigging data. They tell the mesh how to deform during animation ● BSLightingShaderProperty holds lighting and texture information. ● NiAlphaProperty tells the game how to handle transparency in the mesh. Nifskope Gamebryo NIF branch hierarchy example (object window): 1.1. Bethesda

File:Branches1.PNG

Setting up the Nif-specific collisions and physical properties (mass center, material data, inventory marker, nif cleaning)

Setting up the Nif-specific shader properties and texture sets

Shader Types

Number Name Use naming convention
SLOT 1 diffuse map diffuse (RGB) + transparency (Alpha) d.dds
SLOT 2 normal map normal (RGB) + greyscale Specular (Alpha) n.dds
SLOT 3 glow map emissive (RGB) / subsurface color (RGB) sk.dds
SLOT 4 bump map greyscale height / parallax (RGB) g.dds
SLOT 5 env. map / cube map environment (mirror) / cube map (RGB) e.dds
SLOT 6 material map environment / reflection mask (RGB) m.dds
SLOT 7 - map inner layer diffuse (RGB) + inner layer depth (Alpha) -.dds
SLOT 8 sst.m. subsurface teint outer colour s.dds
SLOT 9 - - -


1.1. Bethesda Shader Properties 1.1.1. Environment/Reflection Requirements: cube map (also called) environment map BSLightingShaderProperty => Skyrim

  • Default Shader
  • Environmental Shader

File:Shading1.PNG

General Structure of a Mesh


Make sure, that you visualize it as tree diagram.


Note that there is a hierarchical order, similar to shoulder -> arm -> hand -> finger. In theory, your mesh could be sorted differently, but most meshes look like this. If you see slight variations, don’t worry too much, the system behind is the same.

The top level is most commonly a BSFadeNode (static bodies) or a Ninode (Skinned rigged meshes) or a BSLeafAnim/tree node (plants). The BSX Flag below is for activating the collision. The bhkCollision object is the mesh of the collision.

The first sublevel has the Nitrishape, which is the “body” of the mesh. There can be as many as you want.

Each Nitrishape then has a second sublevel, which contains a NirtiShape Data tab and the LightingShaderProperty. This is where we set up the way the mesh is rendered. Here, we set the shader type and the shader flags and controllers.

If you double click on the BSLightingshaderProperty, you find the third sublevel, the TextureSet, which contains your texture slots. For detailed information on DDS formate texture files, please click here. For detailed information on texture sets/texture slots of shaders, click here.


Meshes can be rendered in Skyrim according to their BSLightingShaderProperty (this article) or the BSEffectProperty (more here).

Most commonly used BSLightingShaderProperties are Default shader type (“0”) and Environment Map shader type (“1”). You set your mesh shader property type in BSLightingshaderproperties. Note that each Nitrishape can only have one shader type and a small range of optional shader flags and use specific controllers(see below).

But, if needed, you can simply use multiple Nitrishapes combined on top of each other. As an example, it might make sense to split your mesh into subsections by material (metal, leather) and export each as a different Nitrishape (first sublevel) into the same mesh. Consider a leather armor for instance. I would suggest having an organic leather/cloth part (which usually absorbs light to a high degree and would use the default shader type) and the metal elements (which would reflect light stronger and profit from cube maps used in the environment map shader type).


Available Shader Flags, Controller Settings, and Texture Slots

BSLightingShaderProperty Shader Types BSShaderFlags Controller Settings BSTextureSets They have their own unique requirements. They need specific Texture Slots to be filled, depending on their character.


Most Common Shader Types

Default (0) Shader Type Default Shader Type

use: Assets with color, height, and specularity. common examples: rocks, clothes, furniture, stones, plants, sometimes metals if specularity is done in a way that can pretend metallic reflections. necessary slots: 1) base color/diffuse map 2) normal map with specularity in alpha channel (optional) necessary flags: those who are marked green above under shader flags, for export; and additionally what you need (vertex paint, specularity for example, if you learned how to apply these)

Example picture above, and shader settings of another example below.


The textures: 1) diffuse (base color) in slot 1, and 2) normal map with optional specularity in the alpha channel in slot 2 of the BSTextureSet.


Environment Map (1) Shader Type Comment regarding Parallax shaders

Texture Types