bo3b / 3Dmigoto

Chiri's DX11 wrapper to enable fixing broken stereoscopic effects.
Other
688 stars 109 forks source link

Issues importing poses #163

Open ideka opened 1 year ago

ideka commented 1 year ago

The tutorial video was really helpful, but it does not explain much about pose importing. In the video, he sets vs-cb2 as a dump option, then later specifies it when importing to blender. Why? what's the significance of the vs- prefix? and why is it 2?

I'm dumping using the following global options: analyse_options = deferred_ctx_accurate dump_ib dump_vb dump_cb txt buf

This only seems to produce a vs-cb0 whenever I do a dump. But when importing a frame analysis dump to blender with vs-cb0, this is what I get:

Screenshot (9)

If I delete or reset the pose, the model goes back to normal.

Any ideas on how to solve this?

DarkStarSword commented 1 year ago

vs-cb2 = Vertex Shader Constant Buffer 2

It's where that particular game passes skinning matrices to the vertex shader, and it's game specific - other games might store them in a different constant buffer or somewhere even more esoteric. There isn't even a guarantee that it will be in a form that can be used by the Blender plugin at all since it depends on how the developer wrote their skinning pipeline, and they could well have implemented it in a completely different way. Because of this I can't really give any specific advice on what value to use for a given game - it requires some investigation of how skinning works in the game in question or some good luck to guess the right value.

You can dump out the vertex shader with 3DMigoto and study it to try to determine where it is looking for the skinning matrices - with luck the game might have left reflection data in and used an obvious sounding name (like "skinningMatrices"), though even if that is missing it is possible to guess likely candidates based on the code itself. You can also/alternatively dump out all constant buffers passed to the vertex shader and try to identify which ones appear to contain data that could be skinning matrices.

ideka commented 1 year ago

I see. The vertex shader references cb0, but I can't quite work out what it's using it for. I'm guessing it could be anything.

My real issue here is, I'm trying to do essentially the same thing you show in the tutorial video but can't complete all steps without this particular part working.

I'm at a point where I have a 3D model that has 13 vertex groups, say 1 to 10, plus X, Y and Z. Groups 1 to 10 exist in the original model so they're not an issue, I have to figure out where X, Y and Z belong. I've also noticed that groups 4, 5, 7, 8 are empty in the original object, so I guess X Y or Z could actually fit in one of those, possibly...

Groups equivalent to X, Y and Z exist on another vertex buffer used to draw the same model, but obviously the numbers do not match up, and I'm assuming because I can't get poses imported, the whole process used in the video to fix that is not quite working for me.

Thanks for your response, and I'd appreciate any ideas on how to figure out where X Y and Z could go.