HoiHoiDeluxe Posted Monday at 02:49 AM Posted Monday at 02:49 AM So, I have been trying to make a script to generate .Obj files automatically from the game's psp files. To explain all the details: A .psp contains the meshes, animations and textures of a single 3D object. And they look something like this: The meshes are stored in .PSO files, while the animations are in .PSA, and the textures in .PSI (don't care about those two yet). Since there can be multiple meshes, textures, and animations in a single file, information like what texture corresponds to what mesh and such is stored in a .PSM file: I haven't really tried to check what the list of floats could possibly mean for the meshes so far. I have no idea. Alright, and here is what the PSO files look like, finally: Using the triangle strip algorithm from @Sparagas 's triangle generator in my script, I have managed to somewhat successfully re-construct the individual meshes from the .pso files: If you look closely, though, you can see there are these ugly triangle spikes coming out of the model. But if you look even closer, you can see the mesh is actually full of them: (There are also a lot of overlapping faces but that's another thing) From my understanding of tri-strips, this is probably intended? The result is good enough that my guess is the developers used a sub-optimal tri-strip conversion algorithm, and all these spikes aren't actually meant to be displayed, which is why most of them are inside the mesh and not outside. This doesn't explain what's up with the ones outside though. And, another problem: some of the models are missing a few faces! You can see on the top picture that the gun and the parallelogram-thingy have holes on their surfaces. But HoiHoi-san's head doesn't seem to have any. Weird! So, all that's left is figuring out: If there is a way to make all the visible spikes go away Why the missing faces If there is a way to fix the overlapping faces And all of this should be able to be done by a script, of course. I'll leave the raw .psp, .pso, and .obj files if anybody wants to take a look. And also my python script (it requires Open3D, which was a pain to install and is pretty resource heavy, if you can adapt it to something else I highly recommend you do that instead LOL). I'll also leave the textures here if anyone wants to figure that out. pointVisualizer.py HoiHoiFiles.7z 3
Engineers shak-otay Posted Monday at 05:27 AM Engineers Posted Monday at 05:27 AM (edited) 3 hours ago, HoiHoiDeluxe said: From my understanding of tri-strips, this is probably intended? The result is good enough that my guess is the developers used a sub-optimal tri-strip conversion algorithm, and all these spikes aren't actually meant to be displayed, which is why most of them are inside the mesh and not outside. Hello, the problem has been widely discussed in this forum without a final result, afaik. It depends on the triangle strips algo used and/or stop markers (if any) for face building. edit: no markers found (There's a similar problem with "skipfaces", see posts from roocker666 but I think it's not related here.) edit: those bytes at vertex start +12 seem to be uvs, as you've assumed, so 12 bit tx, 12 bit tv? A little bit uncommon. Edited Monday at 06:24 AM by shak-otay correction, uvs 2
Engineers roocker666 Posted Tuesday at 07:15 AM Engineers Posted Tuesday at 07:15 AM Yeah, these models are a pain in the ass, lol. Sometimes after vertices is a kind of Flag but not in this case. And there is other problem.. I tried to read all meshes but all appear in the center, that is not good(image1), I exported like that and moved the meshes(image2) using Blender. Maybe you need the skeleton(?) I also read Uvs but I need to scale Y axis and rotate, weird.. So yes, buffer size is 16 bytes: 12 bytes(3 Floats) for vertices and 4 bytes(2 shorts) for Uvs. I can't do more, this is a mess.. 1 1
Engineers shak-otay Posted yesterday at 05:35 AM Engineers Posted yesterday at 05:35 AM @roocker666: yeah, a skeleton file might help, if any. An idea to exclude weird faces is to calculate their 3 angles (maybe using a threshold of 10 degrees for a test?) And checking face normals could help to exclude faces which tilt inwards of the head. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now