0 of 0

File information

Last updated

Original upload

Created by

RealExist

Uploaded by

RealExist

Virus scan

Safe to use

Tags for this mod

About this mod

A small program that goes through all NIF meshes and calculates the ratio of triangle area and its corresponding area in UVs. Basically you learn which meshes are large but have small textures, and if the 'density' of the texture is consistent across a mesh. It takes texture resolution into account, so you can see where you need higher resolution.

Permissions and credits
Since new update is in quarantine (again) either compile yourself, or use this mirror: https://file.io/8BvDxDnccHPB
Update 1.1:

  • By user suggestion, files are now saved as csv files, which are values separated by commas. You can still read them in a text editor (VS code has extensions to color them or put them in boxes), or open them in something like MS Excel. Now it is easy to load the data in another program (note that the first line is header).
  • By user suggestion, new result file where the values are calculated for each texture from all meshes it is used in. Sorted by average value (average of median value of each shape).
  • All values now consistently formatted using scientific notation with 0.00e+0 pattern. 
  • 1.23e+0 is just 1.23
  • 1.23e+5 is big big number
  • 1.23e-5 is smol smol number
  • A -f argument to filter files based on literals and * ? wildcards (by default is *.nif for all nif files)
  • A -e argument to exclude based on one or more keywords. By default excludes _lod, lod. and \sky\ as these clutter the results.
  • Fixed error in textured max value calculation.
  • Updated results based on the default filters, vanilla+SMIM meshes and kartoffel's cleaned textures.
  • Github page for source code: https://github.com/ThePagi/PixelDensityChecker
Caveman explanation: program go brr on models, see if big model smol texture and ugly game. The intended use case is for players to find which textures (or better models) they yet need to download. Or on the opposite side if they have some extremely high res textures on small clutter for no reason. Mod makers can download all the best textures and then check if some meshes/textures have been overlooked. Please keep in mind that this program only takes into account the size of object (well its individual triangles) and not how important the object is, how many times it appears in the game, how close you will get to it etc. It doesn't make sense to try bringing all the meshes to the same pixel density.

Ehm anyway... it only works on loose files, so if you want it to go through the vanilla game, first unpack all the texture and mesh .bsa in your Skyrim/data folder. Thanks to feedback, we now know that .NET 8.0 is needed to run this.

It recursively searches for .nif files starting with the current working directory. If you want it to also find textures linked in the .nif, you need to run it from your Skyrim/data folder. If you're using ModOrganizer, simply add it as a new executable (where SKSE and others are) and set Start in to your Skyrim\data folder wherever it is and whatever it is called. If you run it through mod organizer, the files with results will appear under your last mod in the Overwrite thingy.

The program was made in like three hours just now and it is totally possible that some equation does the opposite of what it's supposed to. Please let me know if it does. Anyway numbers do come out, worst case they are the wrong way around. Just noticed that it also calculates lod meshes, maybe they should be ignored..anyway that's for the future. You can see that the 'worst offenders' are some distant models from Dragonborn dlc, distant clouds and lods. So it should be working correctly.

Results? The program will spit out three text files in the current working directory (or Overwrite). They are pixel_density.md, pixel_density_sorted.md and pixel_density_sorted_textures.md. The first file goes through all meshes in the order they were found and details results for all the blocks in each mesh, with minimum, maximum and median values (and average of medians for the whole mesh). The second file only lists the average for each mesh, but sorted with the lowest (worst) values on top. The third file does the same, but it is sorted with texture resolution taken into account (only files where textures were found are listed).

The numbers in results? The intention is that larger number = higher pixel density = better. The calculation is in whatever units Skyrim uses for their meshes, which is probably this: https://ck.uesp.net/wiki/Unit. I tried some conversions to metric but it wasn't great, and either way the differences in density can be so great the unit kind of loses meaning.

My results are available in Optional files if you just want to look into the (almost) vanilla situation.

Credits:

Thanks to whoever maintains the .net modules niflysharp and DirectXTexNet. And of course the dev of nifly. Looking for any library that could chew up the new version of .nif actually took longer than writing this program. I will revisit this section later, but you can take all my code and do whatever with it as long as you also follow what the previously credited devs ask for in their code.