LOD Fixes and Improvements - NVSE

Summary
Mod focused on improving various parts of game's LOD system, removing node, texture and material limits, adding animation and specular support, and fixing tree LOD.
Tags
Languages
Any


What?
Vanilla LOD system is pretty jank like all Bethesda code, with lots of elements being hardcoded. Goal of the mod is to change that.

First issue - NiGeometry can handle only 65536 vertices due to using a 16 bit value to count them. Normally it's pretty rare to hit this limit, but in case of LOD blocks, which are created from lots of other meshes, it's very easy to go way past that number.
LODGen is meant to handle such cases - it splits the "overflowing" geometry into a new block. Unfortunately, only Skyrim and upwards can load all blocks - FO3/NV only load the first one, meaning you will get broken LOD in these cases.
Not anymore!
Now there can be as many blocks as you want, meaning texture and geometry limits are a thing of the past!

This also means you can treat LOD files (the final ones) as any other nif - it can contain multiple shader properties, geometries and even animations.
(Sounds exciting but in reality this means that you'd have to edit LODGen output files by hand, since LODGen does not support any of these things and will destroy them if used in _lod.nif files).
Blocks with "Ignore Fade" flag will keep rendering even if cell is loaded.


Another issue is - Object LOD does not support specularity - it's force disabled. This mod adds an option to enable it if you happen to have LOD that has specular textures.

Tree LOD related "fixes" have been removed since 1.3.0, as the issue was with xLODGen, not the game itself. Make sure to use up to date xLODGen for proper tree LOD generation.

Other fixes
- Water LOD using incorrect height for its multibounds, leading to water planes getting culled at incorrect angles.
- Object LOD in the loaded area being missing in low detail water reflections.


Questions that I'm sure will be asked
- Add emissive support to LOD?
- Game already supports that - LODGen is the one removing it.

- Add vertex color support to LOD?
- Use latest LODGen beta.

- Add env mapping support to LOD?
- Game already supports that - LODGen is the one removing it.

- Add parallax support to LOD?
- No idea why would you want that, but anyway, game already supports it - LODGen is the one removing it.

Source Code
GitHub

Credits
NoBarkNoBiteNoonan for pestering me about Tree LOD
Bethesda for making the jankiest code I have ever seen
Everyone who told me it's impossible
Everyone who told me LOD doesn't support X thing
Credits
NoBarkNoBiteNoonan for pestering me about Tree LOD
Bethesda for making the jankiest code I have ever seen
Everyone who told me it's impossible
Everyone who told me LOD doesn't support X thing