Jump to content

[Skyrim] Dissecting Skyrim Meshes


Hana
 Share

Recommended Posts

Dissecting Skyrim Meshes

(De-mystify the mysterious nif)

 

 

This tutorial uses the latest version of NifSkope as of the time of writing - 1.1.3 - unless otherwise stated. Download at the Niftools website.

 

First off, forget everything you know about any other TES game meshes. Now, let's look at a Skyrim mesh.
We'll start with an ordinary static object - clutter\carts\handcart01.nif

 

gallery_1482_10_3290.jpg

 

 

In the NiHeader we have the important User Version information. Each game is different and you'll understand why I point this out now when it comes time to import any Skyrim mesh into Blender (see Import/Export tutorial)

 

gallery_1482_10_34403.jpg

 

 

User Version = 12
User Version 2 = 83

Export Info:
This is not important but it's a little known field that anyone can change. Made a new custom mesh? Why not put your name on it as the "Creator"?

Num Strings and Strings:
This is the number and the names of each node in the mesh. It's best to keep this tidy and clean. If you remove any nodes from a mesh you may want to remove it from here too. Note: It really makes no difference to how the mesh works.

 

Returning to the previous picture, in the Block List we have;

BSFadeNode - this is the same as a NiNode block, and is Skyrim specific for static items.
BSXFlags - a previously existing block type for animation/collision flags
bhkCollisionObject - collision block that holds all collision information
NiTriShape - a previously existing block type that holds all mesh information

So far, the blocks seem familiar to other TES game meshes. Once you dig down deeper, that changes. Any block or option starting with "BS" is a new Skyrim-specific block/option. You'll find them listed in NifSkope if you right click > Block > Insert. All new types are added at the top of the list under "Bethesda". Sorry, I'm not going to explain them all.

 

gallery_1482_10_30102.jpg

 

 

BSFadeNode:
- this block acts just like any other NiNode
- this block needs to be manually added to any mesh freshly exported from Blender, as the current Nifscripts will still label it a NiNode
- contains all the high level information about the mesh; Number of Children, Collision object, Extra Data Properties, Controllers for animation, etc

 

gallery_1482_10_137134.jpg

 

 

BSXFlags:
- this block is the same as previous games, containing the basic collision and/or animation information required for static objects.

 

gallery_1482_10_16960.jpg

 

 

bhkCollisionObject:
- details the type of collision used on the object, same as previous games
- unlike previous games, the Nifscripts is currently unable to export collision data from Blender for Skyrim meshes - a 3rd party tool - NifUtils - is required to 'make' collision objects, or simply re-use collision from an existing mesh
- more on collision in a later tutorial

 

gallery_1482_10_39135.jpg

 

 

NiTriShape:
- this block is the same as previous games, but does contain different Skyrim-specific information
- this block contains all information regarding the mesh itself
- links to NiTriShapeData for specifics
- links to new block type BSLightingShaderProperty, which contains all the options for mesh settings
- the BSLightingShaderProperty links to the BSShaderTextureSet which directs the mesh to the texture to use

 

gallery_1482_10_117259.jpg

 

 

Now to dig down deeper into the NiTriShape, as it contains the most important information.

You'll notice the new block details line "BS Properties" in the picture above (at the very bottom). There will always be two properties to identify here; the BSLightingShaderProperty is always first, and the second line is for a NiAlphaProperty if required on the mesh.

Looking closer at the NiTriShapeData block, there's also a new Skyrim-specific property called "BS Num UV Sets".

 

gallery_1482_10_87787.jpg

 

 

This is a unique property that has 2 option choices. I honestly don't know what they mean but it is very important. A wrong value can cause the mesh to not work or even crash the game. The definition given by NifSkope is "denotes whether UV's are present" which is odd because everything is UV'd.


The values are;
1 for anything that is skin (character related)
4097 for everything else

Another important line is "Has Vertex Colors". Skyrim meshes make liberal use of vertex coloring (applied in Blender or 3DS Max) and this line tells the game whether vertex colors are applied or not. Directly below that line you can expand "Vertex Colors" to see on a per vertex basis which vertex has color applied.

 

BSLightingShaderProperty

 

gallery_1482_10_172653.jpg

 

 

This block contains information regarding what type of mesh this is and what render options to apply. There is a LOT of information in this block but most of it is default. Let's go through the important options;

Skyrim Shader Type:
There are many options here but most statics are "default". Other values will require additional options.

Shader Flags 1:
Default options listed. Does not usually require any changes, except for armor/clothing to add a "skinned" flag, and other values for skin data.

Shader Flags 2:
Default options listed. The SLSF_2_Vertex_Colors option depends on the value of the NiTriShapeData "Has Vertex Colors". If no vertex colors are being used this must be removed. Another common option one might add here is "Double-sided".

UV Scale:
Should always equal 1.0000. Must be added manually.

Texture Set:
Links to the BSShaderTextureSet node. Must be added manually.

Emissive Color:
Should typically always be 0.0. Must be changed manually.

Emissive Multiple:
Should always equal 1.0000. Must be added manually.

Texture Clamp Mode:
Should always equal WRAP_S_WRAP_T. Must be changed manually.

Alpha:
Should always equal 1.0000. Must be added manually.

Glossiness:
A general setting is 80.0000. Higher is less gloss, lower is higher gloss.

Specular Color:
Typically equals 1.0000 across the board but can be changed to add color if required.

Specular Strength:
Typically equals 1.0000 but depends on the object. Must be added manually.

Lighting Effect 1:
Typically equals 0.3000 but depends on the object. Controls the strength of lighting options in Shader Flags above. Must be added manually.

Lighting Effect 2:
Typically equals 2.000 but depends on the object. Controls the strength of lighting options in Shader Flags above. Must be added manually.

The best advice I can give for these options is to open a mesh similar to what your mesh is and how you want it, and copy the same values.

 

 

BSShaderTextureSet

 

gallery_1482_10_39848.jpg

 

 

This is where the mesh points to the texture. Each line is for a specific type of texture (and is explained more in the Texture Types tutorial)

 

That's the most important aspects of a Skyrim mesh explained. More details will be explained in other tutorials that focus more on certain activities.

 

 

 

 

 

 

 

Link to comment
Share on other sites

Liked - Very much.  :coffee:

 

I just gained a bit more NifSkopery passion.

 

Currently going through all of Exeters Armour and Clothing meshes for UNP ( Lorelai gave me quite a lot of tips early when I started "Alt Navetsea UNP Seamless", resulting in better body meshes / 1st and 3rd person hand meshes ( I was checking NiTriShape data changes required - BS Num UV Sets set to 1, Has Normals set to NO ) ).

 

All I could check at the time were the Dimon UNP meshes, but now I think there is a possibility to include an optional installer full of Exeters Armor and Clothing ( Exeter rapped recently leaving permissions open ) ..

 

And a lot of them need similar treatment ( but just on the skin mesh NiTriShape Data, not any other armour NiTriShape Data )   :construction: time to get the tools out. Its going slow there's a lot of them to do, but so far so good, I haven't crashed anything yet anyway.

 

6917276Untitled4.png

 

 

That's the most important aspects of a Skyrim mesh explained. More details will be explained in other tutorials that focus more on certain activities.

 

.. Would that include Body and Armour / Clothing / BSDismemberment problems :) ?

Link to comment
Share on other sites

Thanks, Hana. Great tutorial for such a layman as me ! :wink:

 

I really wish I would have enough time to invest myself in fixing the numerous glitches still present in Skyrim meshes. IRL business does count in the balance, however... :(

 

I reported an allegedly 'easy to fix' bug here. Can you confirm this requires an editing in Blender ? (deletion of vertices at the pillar base) Could a modified texture also fix the problem ? (turning the pillar base invisible by setting a proper alpha channel to this part) And finally, if both solutions work, then wich one would be the best ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...