DarkStarSword / 3d-fixes

Stereoscopic 3D fixes using Helix mod & 3DMigoto
105 stars 126 forks source link

Can't import fmt with 4D Position from WARRIORS OROCHI 4 #3

Closed fatboyzz closed 11 months ago

fatboyzz commented 4 years ago

Try to import some model from WARRIORS OROCHI 4 here. I have some .fmt .ib .vb exported. (Athena's helmet, files attached below) Both '0.ib' and '2.ib' imported correctly. But importing '1.ib' got error 'Positions are 4D'. Inside 1.fmt I found the format for position is 'R32G32B32A32_FLOAT'. I guess these are cloth and hair and have special usage for the extra dimension. Some settings are needed to omit the extra dimension. 00000.zip

cg87742467 commented 4 years ago

I have the same problem~I find the image texture to these files all have alpha channel.

DarkStarSword commented 11 months ago

Sorry that it has taken me so long to get around to this.

I've adjusted the script so that the data in the 4th dimension of a POSITION and NORMAL semantic will be stored in a vertex layer (like it does for other unhandled semantics) and written back to the mesh on export, and will now warn about the 4D coordinates rather than treating them as fatal - I can now import and export the 1.vb in your zip file, though it looks a bit weird (I remember something similar on the skirts in DOA6 that also had 4D coordinates) and I would appreciate if you can confirm that the exported one works ok once re-injected into the game.

Note that if the data in the 4th dimension is important that certain types of edits may be problematic, e.g. anything that adds a new vertex won't have any data in this dimension, so whatever it is used for may not work. Things like deleting part of the mesh might work ok, while moving a vertex is anybody's guess.

DarkStarSword commented 11 months ago

I have the same problem~I find the image texture to these files all have alpha channel.

This issue doesn't have anything to do with alpha channels - I think you might be getting confused by the "R32G32B32A32_FLOAT" format since that would seem to imply an RGBA colour, but in DirectX that same format is also used for 4 dimensional coordinates, so it actually signifies XYZW in this case, not RGBA.