Jump to content

How Normals stores in Fallout 4 ?


Anton0028

Recommended Posts

My question is: How Nifskope/Fallout4 stores Normals in "byteFloat" format.

 

Help me please to understand: how Nifskope converts Float type (4 bytes) to ByteFloat type (1 byte) ?
I made few tries to make this conversion with C but failed.
I have tried: S EEE MMMM, S EE MMMMM, S EEEE MMM representations of ByteFloat, where:
S - sign bit
E - exponent bits
M - mantissa bits
But my Normals looks weird in Nifskope after import :(
I noticed Nifskope understands some byteFloat numbers like this: -1.0 as 0x00, 1.0 as 0xFF , 0.5 as 0xBF , -0.5 as 0x40 - but this must to be wrong because of sign bit ... (according to IEEE 754)
So, how they do this trick ?
Why Nifskope normals (when I use "Face normals" feature on my imported to NIF model) looks good in Fallout 4 ?
Link to comment
Share on other sites

Thank you.

I posted message to Nifskope developers and got an answer from Jon !

And after that, I found all missing parts in source code of Nifskope :)

Now my normals looks the same in OBJ file and Nifskope after I imported my model to NIF.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...