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

Fix stretched FMVs for Resident Evil Revelations 2. #1695

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

noorus
Copy link
Contributor

@noorus noorus commented Jan 1, 2025

Add a fix for stretched FMVs for ReRev2.

Explanation:
FMV rendering uses a YUV decoding pixel shader with a crc of 0x9D190FC7 and a generic screenspace vertex shader with a crc of 0x1287841D. We hook D3DDevice9::DrawPrimitive, and if both of these shaders are active, we instead activate our own vertex shader (injected earlier) which resizes the verts according to 16:9 aspect.

Explanation:
FMV rendering uses a YUV decoding pixel shader with a crc of 0x9D190FC7 and a generic screenspace vertex shader with a crc of 0x1287841D.
We hook D3DDevice9::DrawPrimitive, and if both of these shaders are active, we instead activate our own vertex shader (injected earlier) which resizes the verts according to 16:9 aspect.
@ThirteenAG
Copy link
Owner

I would also replace vtable hook with a direct exe hook instead, I'll do it when I'm able to test this later.

@noorus
Copy link
Contributor Author

noorus commented Jan 3, 2025

Yeah, that way is probably more compatible with other 3rd party programs.
I realize now that the injected shader is also not getting released at all, but device/shader recreation is so infrequent that I don't think it's a real issue

@ThirteenAG
Copy link
Owner

Resident Evil  Revelations 2   Biohazard Revelations 2 Screenshot 2025 01 07 - 20 49 28 92

Pushed refactored code, but subtitles look weird now. Any idea on how to fix them?

@ThirteenAG
Copy link
Owner

Or maybe it's possible to clear the sides of the screen in the shader? That way subtitles would be at least on black, instead of artifacting.

@noorus
Copy link
Contributor Author

noorus commented Jan 8, 2025

Oh, I didn't try with subtitles.. I can try to take a look at some point later

@ThirteenAG
Copy link
Owner

Resident Evil  Revelations 2   Biohazard Revelations 2 Screenshot 2025 01 14 - 20 13 20 11

Managed to fix the subtitles, apparently my scaling code was not properly applied to cutscene subtitles.

@ThirteenAG
Copy link
Owner

ThirteenAG commented Jan 14, 2025

Also backported this to revelations 1, merging now, and thanks for the contribution.

Resident Evil  Revelations   Biohazard Revelations Screenshot 2025 01 14 - 20 35 55 70

@ThirteenAG ThirteenAG merged commit cf84aa4 into ThirteenAG:master Jan 14, 2025
0 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants