Anton0028 Posted January 22, 2017 Share Posted January 22, 2017 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 bitE - exponent bitsM - mantissa bitsBut 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 More sharing options...
TrickyVein Posted January 22, 2017 Share Posted January 22, 2017 You might want to post here. Link to comment Share on other sites More sharing options...
Deleted15964729User Posted January 23, 2017 Share Posted January 23, 2017 Or check the source code https://github.com/jonwd7/nifskope/archive/v2.0.dev6.zip Link to comment Share on other sites More sharing options...
Anton0028 Posted January 23, 2017 Author Share Posted January 23, 2017 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 More sharing options...
TrickyVein Posted January 23, 2017 Share Posted January 23, 2017 Great! Link to comment Share on other sites More sharing options...
Recommended Posts