Difference between revisions of "User:Qazaaq/NIF Format Notes"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Qazaaq
(notes about NIFs)
 
imported>Qazaaq
(some minor changes)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
These are some notes I took while looking at the NIF files. Feel free to comment, discuss and add your own.
These are some notes I took while looking at the NIF files and info I got from others. Feel free to comment, discuss and add your own.
 
== General ==
*All NIFs start with a BSFadeNode block, very similar to NiNodes. Exceptions:
**cameras
**master particle systems
**lod meshes
*All block Values strings (Value column in Block List view) are stored in a Strings array in the header and are referred to with an integer.


== Textures ==
== Textures ==
Line 8: Line 15:
       +- BSShaderTextureSet
       +- BSShaderTextureSet
==== Notes ====
==== Notes ====
*BSShaderTexturesSet contains the textures (color-, normal- and glowmap) in the '''Textures''' array. Size is controlled by the '''Num Textures''' variable, this is always 6.
*BSShaderTexturesSet contains the textures (color-, normal- and glowmap) in the '''Textures''' array. Size is controlled by the '''Num Textures''' variable, this is always 6 even when the last ones aren't used.
*The color map is always first, the normal map second and the glow map third. The fifth entry appears to be the reflection map (example: meshes\weapons\1handminedrop\minecryo.nif:10).
*Texture order:
:#color map
:#normal map + specular map in alpha
:#glow map
:#parallax map
:#reflection/environment map  
:#environment map mask
*Sometimes, for simple/small objects or animated textures, the old/Oblivion method is used (NiTexturingProperty + NiSourceTexture).
*Sometimes, for simple/small objects or animated textures, the old/Oblivion method is used (NiTexturingProperty + NiSourceTexture).


== Block Values ==
*All block Values strings (Value column in Block List view) are stored in a Strings array in the header and are referred to with an integer.


== Collision ==
== Collision ==
=== All collision ===
=== All collision ===
*'''Layer''' and '''Response'''(?) is controlled by bhkRigidBody.
*'''Layer''' and '''Response'''(always(?) set to RESPONSE_SIMPLE_CONTACT) is controlled by bhkRigidBody.
*Use bhkRigidBodyT instead of bhkRididBody to apply translation to the collision shape.
*Use bhkRigidBodyT instead of bhkRididBody to apply a transformation to a collision object.
*Use bhkTransformShape to apply a transformation to a collision shape
=== Primitive collision shapes ===
=== Primitive collision shapes ===
*Hardly ever used. Convex and Mopp shapes are much more common even for shapes like boxes.
*Hardly ever used. Convex and Mopp shapes are much more common even for shapes like boxes.
Line 27: Line 39:
       +- bhkXXXShape
       +- bhkXXXShape
==== Notes ====
==== Notes ====
*Used shapes:
*Used shapes (should be possible to use it with all shapes):
**Box
**Box
*Shape contains shape and '''material''' data.
*Shape contains shape and '''material''' data.
Line 54: Line 66:
*'''Material''' is controlled by the bhkMoppBvTreeShape block.
*'''Material''' is controlled by the bhkMoppBvTreeShape block.
*bhkPackedNiTriStripsShape and bhkPackedNiTriStripsData only contain data about the collision shape.
*bhkPackedNiTriStripsShape and bhkPackedNiTriStripsData only contain data about the collision shape.
*bhkPackedNiTriStripsData contains '''layer'' and '''material''' of subshapes.


=== Uncompressed collision shapes ===
=== Uncompressed collision shapes ===
Line 66: Line 79:
==== Notes ====
==== Notes ====
*NiTriStripsShape contains '''material''' data.
*NiTriStripsShape contains '''material''' data.
=== Other collision shapes ===
==== Location ====
BSFadeNode
+- bhkSPCollisionObject
    +- bhkSimpleShapePhantom
      +- [bhkXXXShape, bhkConvexVerticesShape]
==== Notes ====
*bhkSimpleShapePhantom controls the '''layer''':
**OL_WATER
**OL_TRIGGER
*last unkown float in bhkSimpleShapePhantom
**-204.0184 in all water NIFs
**0.0 in all triggers

Latest revision as of 08:21, 21 December 2008

These are some notes I took while looking at the NIF files and info I got from others. Feel free to comment, discuss and add your own.

General[edit | edit source]

  • All NIFs start with a BSFadeNode block, very similar to NiNodes. Exceptions:
    • cameras
    • master particle systems
    • lod meshes
  • All block Values strings (Value column in Block List view) are stored in a Strings array in the header and are referred to with an integer.

Textures[edit | edit source]

Location[edit | edit source]

BSFadeNode
+- NiTriStrips
   +- BSShaderPPLightingProperty
      +- BSShaderTextureSet

Notes[edit | edit source]

  • BSShaderTexturesSet contains the textures (color-, normal- and glowmap) in the Textures array. Size is controlled by the Num Textures variable, this is always 6 even when the last ones aren't used.
  • Texture order:
  1. color map
  2. normal map + specular map in alpha
  3. glow map
  4. parallax map
  5. reflection/environment map
  6. environment map mask
  • Sometimes, for simple/small objects or animated textures, the old/Oblivion method is used (NiTexturingProperty + NiSourceTexture).


Collision[edit | edit source]

All collision[edit | edit source]

  • Layer and Response(always(?) set to RESPONSE_SIMPLE_CONTACT) is controlled by bhkRigidBody.
  • Use bhkRigidBodyT instead of bhkRididBody to apply a transformation to a collision object.
  • Use bhkTransformShape to apply a transformation to a collision shape

Primitive collision shapes[edit | edit source]

  • Hardly ever used. Convex and Mopp shapes are much more common even for shapes like boxes.

Location[edit | edit source]

BSFadeNode
+- bhkCollisionObject
   +- bhkRigidBody
      +- bhkXXXShape

Notes[edit | edit source]

  • Used shapes (should be possible to use it with all shapes):
    • Box
  • Shape contains shape and material data.

Simple collision shapes[edit | edit source]

These are used for items.

Location[edit | edit source]

BSFadeNode
+- bhkCollisionObject
   +- bhkRigidBody
      +- bhkConvexVerticesShape

Notes[edit | edit source]

  • Both shape data and material are controlled by the bhkConvexVerticesShape.

Complex collision shapes[edit | edit source]

Buildings and other large static objects.

Location[edit | edit source]

BSFadeNode
+- bhkCollisionObject
   +- bhkRigidBody
   |  +- bhkMoppBvTreeShape
   |     +- bhkPackedNiTriStripsShape
   |        +- hkPackedNiTriStripsData
   +- BSFadeNode

Notes[edit | edit source]

  • Material is controlled by the bhkMoppBvTreeShape block.
  • bhkPackedNiTriStripsShape and bhkPackedNiTriStripsData only contain data about the collision shape.
  • bhkPackedNiTriStripsData contains layer and material' of subshapes.

Uncompressed collision shapes[edit | edit source]

Used in the following NIFs:

  • meshes\clutter\displaycase\displaycase.nif

Location[edit | edit source]

BSFadeNode
+- bhkCollisionObject
   +- bhkRigidBody
      +- bhkNiTriStripsShape
         +- NiTriStripsData

Notes[edit | edit source]

  • NiTriStripsShape contains material data.

Other collision shapes[edit | edit source]

Location[edit | edit source]

BSFadeNode
+- bhkSPCollisionObject
   +- bhkSimpleShapePhantom
      +- [bhkXXXShape, bhkConvexVerticesShape]

Notes[edit | edit source]

  • bhkSimpleShapePhantom controls the layer:
    • OL_WATER
    • OL_TRIGGER
  • last unkown float in bhkSimpleShapePhantom
    • -204.0184 in all water NIFs
    • 0.0 in all triggers