xivdev / Penumbra

FINAL FANTASY XIV modding, but actually good this time
576 stars 113 forks source link

LOD Support #426

Open DTV96Calibre opened 1 week ago

DTV96Calibre commented 1 week ago

I like to fix little mesh problems I come across and would like to retain LOD support when I do. Penumbra's model import/export feature currently doesn't support multiple LOD, so if no cleanup is done on my end, all LOD meshes get put on the same LOD. I can delete the lower detail meshes of course, but I'd rather retain them.

I'm researching a good way to implement LOD support myself, but I'm submitting this issue to get the go-ahead first. The approach I think is most viable is to parse the mesh names to determine the LOD they belong to (i.e. 'mesh 0.1' is the first mesh in the first LOD, 'mesh 2.3' is the third mesh in the third LOD). This feature could be toggled on the import screen.

The MSFT_lod extension to glTF 2.0 is a bit more involved, has lackluster support, and requires more configuration of the models' LOD parameters than is applicable to FFXIV use.

If there is any documentation on the mesh naming scheme used by FFXIV, I haven't found it. Please point me to it if it exists, otherwise I'll probably have to examine the names myself.

ackwell commented 1 week ago

This is a planned feature; though I haven't had any intention to implement it until DT hits. You're welcome to do so yourself, or help out when the time comes.

I'm not particularly keen on using the LOD extensions in glTF.

As-stands, my current plan for LOD handling is to allow editing (i.e. re-assigning the breakpoints) of LOD groups in the model editor, post-import. This means we're not reliant on metadata in blender/glTF/etc for determining the additional distance metadata, and users can edit LODs of models without round trips outside the application.

Much like attributes and such, taking this approach would also have a "retain existing" option for import cases where the old and new models share mesh count &c, allowing the resulting model to match the prior configuration.

I have a (stub) discord thread for this feature @ https://discord.com/channels/884363610640498698/1209106081536540722/1209106081536540722 - feel free to dump thoughts there if you want fast(er) paced comms, or issues/comments is fine too 👍