MeltyPlayer / FinModelUtility

Model viewer and command-line tools for extracting models from various GCN/3DS/PC games en-masse.
GNU General Public License v3.0
100 stars 11 forks source link

[Bug] Mipmap LODs not working correctly in viewer #49

Open Deschamps12 opened 1 month ago

Deschamps12 commented 1 month ago

Describe the bug When trying to export models in any format, it gives missing method error. Also upon importing .BMD the model is black now, previous versions would load materials properly.

System.MissingMethodException: Attempted to access a missing method. at fin.model.io.exporters.assimp.indirect.AssimpIndirectModelExporter.ExportFormats(IModelExporterParams modelExporterParams, IReadOnlyList1 exportedFormats, Boolean exportAllTextures) at uni.games.ExporterUtil.Export[T](T threeDFileBundle, Func1 loaderHandler, ISystemDirectory outputDirectory, IReadOnlyList`1 formats, Boolean overwriteExistingFile, String overrideName) in C:\Users\Ryan\Documents\CSharpWorkspace\FinModelUtility\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 268

On Import image

Exporting image

MeltyPlayer commented 1 month ago

Thanks for reporting this issue, sorry about that! Exporting is fixed now, though the material issue probably isn't.

Is this model from Twilight Princess?

MeltyPlayer commented 1 month ago

After more investigation, I've figured out that this problem has to do with how mipmaps are rendered in the viewer. It turns out that the first mipmaps for this character are the expected texture, but the second mipmaps are black (which I'm assuming is expected behavior?). It's always rendering with these second mipmaps for some reason, which is why the character always appears all-black.

So this is just a viewer issue, the characters should still export correctly. I just need to fix how the renderer uses mipmaps, so it switches between textures at the correct distance.