DarkStarSword / 3d-fixes

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

Two separate drawcalls for mesh. One handles the posing whilst the other handles drawing to the screen. #20

Open HazzyDevil opened 11 months ago

HazzyDevil commented 11 months ago

Hi Ian, just wanted to say thanks for updating the blender script to handle 4D data! Appreciate the work you've put in.

Thought I'd mention this incase you hadn't come across this. But for several games such as Genshin Impact and One Piece Burning Blood, there are multiple draw calls that handle the same mesh. One drawcall will have a specific vertex shader with two vertex buffers (vb0 with position, normal, tangent, and vb1 with blendindices and blendweight data). Both of these buffers appear to have a pointlist topology. When this VS is set to skip, the mesh in-game will stop being animated properly so I take it this is the drawcall that's posing the mesh.

The second draw call will have again two vertex buffers, with position, normal, tangent in one buffer, and texcoord and texcoord1 in the other. But this time the txt/bin files will have a pixel shader in addition to a vertex shader in the name as you would normally expect and a standard trianglelist topology. Now setting either of these to skip, will hide the mesh in-game.

Is this something you've come across, and would you happen to know how we can use data from these two drawcalls to create mods?

DarkStarSword commented 11 months ago

Yes, I'm actually working on this exact conundrum with @Hetaneko for a Unity game in another thread - Google tells me that Genshin Impact is a Unity game, so I expect it will likely be following the same pattern I'm looking at. I'm not positive what engine One Piece Burning Blood is using - based on the files listed in the depot I can see in steamdb I gather it is something custom or rare, but from what you say it must be doing something pretty similar, so hopefully whatever solution we come up with for Unity will help there too.

Take a look over my analysis from tonight and see it it lines up with the games you are looking at - if so, this should be enough to get the mesh + weights into Blender (still tbd how we get them back into the game): https://github.com/DarkStarSword/3d-fixes/issues/19#issuecomment-1747241061