Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing textures in Hitman 2 Silent Assassin #17

Closed
elishacloud opened this issue Apr 29, 2017 · 7 comments
Closed

Missing textures in Hitman 2 Silent Assassin #17

elishacloud opened this issue Apr 29, 2017 · 7 comments

Comments

@elishacloud
Copy link
Contributor

There seems to be missing textures on Hitman 2 Silent Assassin when using this wrapper/converter.

Here is what I get with d3d8to9:
hitman2_d3d8tod9

Here is what it is supposed to look like:
hitman2

I think this problem is different than the problem with Rayman 3: Hoodlum Havoc because when I try other converters, like the one here, it works fine. I am hoping someone can look into this as I need this converter to play the game in Windows 10.

@CookiePLMonster
Copy link
Contributor

Have you tried comparing pix frames from this wrapper and the one from Boris/ENBSeries? While those are useless for anyone but you (frames can't be viewed from a PC with a different driver/GPU model), maybe you'll spot something obvious in the render states (or texture sampler settings) for 47's draw call.

@elishacloud
Copy link
Contributor Author

Thanks for the suggestion! However I an new to DirectX programming (and C/C++ programming for that matter). I am not sure how to compare pix frames. I don't have the source code for the Boris/ENBSeries converter.

@CookiePLMonster
Copy link
Contributor

You'd need to use it to capture frames from ingame and then most likely compare render states during the draw call - no need for the source.

@elishacloud
Copy link
Contributor Author

Ok, I started looking at this in PIX for Windows using this guide here. So far I have found three differences between d3d8to9 and the Boris/ENBSeries converter.

  1. In the SetVertexShader function it seems that the Boris/ENBSeries converter calls SetFVF and SetVertexDeclaration before it calls SetVertexShader. Whereas d3d8to9 calls them in reverse order.

  2. In the SetRenderTarget function the Boris/ENBSeries converter does not call Release and only calls AddRef once. Whereas d3d8to9 calls Release and calls AddRef more than once.

  3. In the frame I captured the Boris/ENBSeries converter called GetRenderTarget as the very first call and then GetDepthStencilSurface as the third call, whereas these calls were completely missing from d3d8to9.

The first two items were easy to change. However for the third item, it seems like d3d8to9 is missing a call to GetRenderTarget and GetDepthStencilSurface. But I am not sure how to add these calls.

I did take a quick look at the GetRenderTarget and GetDepthStencilSurface functions in d3d8to9 and I noticed that neither of these call out to their D3D9 equivalent. When I manually added the GetRenderTarget and GetDepthStencilSurface functions then the calls for d3d8to9 and Boris/ENBSeries converter were exactly the same. However this did not solve the issue. Probably because when I called GetRenderTarget and GetDepthStencilSurface I just threw away their return results.

Anyways I think the problem is in here somewhere, but I am not quite sure how to fix it. Is it possible that there are multiple render targets in this game and d3d8to9 can only handle one?

@CookiePLMonster
Copy link
Contributor

This doesn't seem to be the case. GetRenderTarget and GetDepthStencilSurface don't call their d3d9 equivalents because the emulated device seems to cache those by itself.

Looks like d3d8 can't handle multiple render targets either (notice the absence of Index parameter in d3d8's GetRenderTarget). The issue is puzzling.

@elishacloud
Copy link
Contributor Author

This is the same issue as described in Indiana Jones And The Emporer's Tomb missing textures issue. The solution can be found in the comment here.

@elishacloud
Copy link
Contributor Author

Fixed with pull #27. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants