bo3b / 3Dmigoto

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

Which type of draw call is correct after compute shader slot replace in a TextureOverride? #344

Closed StarBobis closed 2 months ago

StarBobis commented 2 months ago

Sorry to bother you but I need some help from more smart brain about 3dmigoto.

In NarakaBladepoint, I used to use vb0,vb1 replace ,to replace Position and Blend data to make game mod, but after naraka's update, it can only replace through cs-t* slot, but in this case I can't find a way to draw more vertex number than it's original number, even I changed it's all IASetVertexBuffer's CreateBuffer's desc to let ByteWidth to become more than original value.

here is how original mod replace work [TextureOverride_VB_bc90be8d_Position] hash = c3e6e7f3 vb0 = Resource_VB_Position vb1 = Resource_VB_Blend handling = skip draw = 13780,0

above is draw a more vertex number after vb0 and vb1 slot replace ,but when game version is update, they use compute shader to pre-skinning instead of original vertex shader way, so now it becomes:

[TextureOverride_VB_bc90be8d_Position] hash = c3e6e7f3 cs-t0 = Resource_VB_Position cs-t1 = Resource_VB_Blend

but I can't use handling = skip and draw = 13780,0 here, because after the draw ,the mod's animation is disappear (not disappear when use VS to pre-skinning) ,if I don't skip and draw them, their vertex number won't change which will cause model looks like this: image

extra vertex which is larger than original vertex number's vertex will lost and can't draw correctly, at this situation how to use draw or is there other draw type to use to fix the problem,because if I use original one like this, it will not generate animation anymore like the picture below:

[TextureOverride_VB_bc90be8d_Position] hash = c3e6e7f3 cs-t0 = Resource_VB_Position cs-t1 = Resource_VB_Blend handling = skip darw = 13780,0

image

(the body part is not perform animation and always solid)

the core problem is if I replace cs-t*, handling = skip and draw = 13780,0 will not work, is there any other way to let it work?

image it use a compute shader to receive Position and Blend and BoneMatrix input to calculate a posed model to u0 slot and then pass to later index, here 09d91b2eee7e232f-cs.txt is some attachment: log.txt ShaderUsage.txt

ed4584a8-d9ae-4645-8862-e58f29c1e9e0.ini.txt

StarBobis commented 2 months ago

After 18 hours reading thousands of 3Dmigoto source code lines and tons of microsoft's documents and digging everywhere...,I finally find a way to solve this problem: use resource copy and call a custom shader to do it instead of trying to draw in a constant buffer.

The correcty way is to use handling = skip to this computeshader's calculation and use dispatch command in customshader to get the final result and then finally copy them back.

Sorry for bother but my problem has been solved, anyway, thanks.