Markemp / Cryengine-Converter

A c# program to convert Crytek files to Collada (XML) format
https://www.heffaypresents.com/GitHub/
GNU General Public License v2.0
209 stars 53 forks source link

Normals aren't correct for SC datastreams with 16 byte structures. #5

Closed Markemp closed 2 years ago

Markemp commented 6 years ago

The normal part of the VertsUV struct seem to have been changed to Color, and the Normal is a calculated value from the Tangents datastream. Need to calculate the correct normals from the Tangents datastream by taking the cross product of the tangent and bitangent.

pixelpath commented 3 years ago

To fix normals not displaying correctly in 3DS Max: Select the model and add an Edit Normal modifier to the stack. Now press CTRL + A to highlight all normals and click the Reset button in the Edit Normal modifier panel. Now the models explicit normals should be working.

Markemp commented 3 years ago

Thank you for the workaround!

pixelpath commented 3 years ago

No problem! I think by default, 3DS Max has them rotated in a different default direction and doing the reset forces it to rotate the normals relative to surface / tangent space but I am still trying to figure out the different normal modes. FWIW the 3DS Max SDK docs list some info on them that may shed more light on the situation: http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-SDK-Programmer-Guide/files/GUID-88FB1FC7-F557-4B78-9659-0DE6045AD45B.htm and http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-SDK-Programmer-Guide/files/GUID-9B83270D-1D20-4613-AB35-5EE9832C162E.htm

Baconator650 commented 2 years ago

The newer "weighted normals" produces a more accurate result.

Markemp commented 2 years ago

This has (finally) been resolved. I think. Closing the issue, but will reopen if necessary.