hakasapl / ParallaxGen

Dynamic mesh patcher for Skyrim
https://www.nexusmods.com/skyrimspecialedition/mods/120946
GNU General Public License v3.0
10 stars 3 forks source link

Improve optimize-meshes #68

Open hakasapl opened 2 weeks ago

hakasapl commented 2 weeks ago

Right now we're just calling the NIFLY library's optimize meshes, which seems to result in some invisible meshes. We need to look at what optimize actually does and probably not do all of it depending on shader

From Nexus:

After running ParallaxGen with the following flags: --upgrade-shaders --optimize-meshes

The following mesh is invisible: cavegewallstraight01.nif

Image 1

The mesh used by ParallaxGen was the one from Skyrim Remastered - Caves and I have tested that the source mesh works fine by hiding the mesh from ParallaxGen Output

Image 2

Admittedly I haven't tried without the --optimize-meshes argument, so I don't know if this will make any difference.

If it helps you to isolate the root cause, I have created a mod with the affected files for repro here

The location is Understone Keep coc MarkarthUnderStoneKeep

Sebastian-81 commented 2 weeks ago

Could be the bounding sphere or the deletion of unreferenced blocks

 void NifFile::Optimize() {
    for (auto& s : GetShapes())
        s->UpdateBounds();

    DeleteUnreferencedBlocks();
}
Sebastian-81 commented 2 weeks ago

Ticket nifly/issue/51 created