niftools / blender_niftools_addon

The Blender Niftools Addon is a Blender add-on to enable import and export of NetImmese File Formats including .nif, .kf, .egm.
http://www.niftools.org
Other
389 stars 105 forks source link

Exporting NiTriStrips creates excess triangles #630

Open pacific-breeze opened 9 months ago

pacific-breeze commented 9 months ago

I'm using displacement to add detail to rock meshes in FNV in Blender, with 0.1.1 version of the plugin. I subdivide the mesh and then decimate it, exporting to NiTriStrips. The exported mesh has a very high number of triangles: 7k vertices with 45k triangles. Whereas a 7k vertices mesh would normally have around 20k triangles. It seems that the changed topology in some way leads to the creation of the excess triangles.

What I did to reproduce: Open a mesh with 7k vertices, 20k triangles, displace and subdivide, then decimate back to 7k vertices. General shape remains, the displace only adds finer detail. Export using stripify creates a mesh with 45k triangles

Found an easier way: Import nvn_cliffcanyonl01_frosted.nif and export without any change. Doubles the number of triangles from 6000 to 12000

ja231c commented 4 months ago

Vertex count is not an indication of triangle count. Increased triangle count when using strips is to be expected as strips require additional 0 area triangles in some cases. That being said, the plugin does seem to output highly sub-optimal strips.

pacific-breeze commented 4 months ago

After further investigation, it is required to reset normals before exporting, which in some cases helps reduce the triangle number. Not always though. The issues is, that the suboptimal export affects performance in-game negatively, directly reducing FPS. 3dsmax plugin exports lower strips count and in all cases.