Water animation speed too fast at 60FPS
Validation
- [X] Game has been updated to the latest RE4HD release (v1.0.1: https://www.re4hd.com/?p=9471)
- [X] Data has been validated with SFV (a guide to using QuickSFV is available at that link, use that with this 1.0.1 SFV: BIO4-HDProject1.0.1-SFV.zip)
Describe your issue here (drag+drop ZIP to attach it)
Just saw a video from albert that shows the water effect running too fast at 60FPS: https://www.youtube.com/watch?v=50DzMInXku0&t=454s
There's a ton of different functions in the game labelled as water related, so not really sure what exactly is causing that, might be the Espgen45/Espgen42 funcs (which also uses Estgen45/Estgen42 funcs too), they seem to do something with water/waves anyway.
If anyone knows what room that video shows please let me know (or rXXX room code), or if anyone is able to post a save in that area that'd be fantastic (you can use debug menu to save game in that room)
E: oh it's right at the beginning of chapter 3-2 lol, missed the title of that vid for some reason.
E2: so playing with the vars that Espgen45_Move00 uses does seem to affect the water there, haven't really found a good way of adjusting the speed though... seems they did add some stuff using deltaTime there but not really sure what that's changing.
Made a little progress with this, seems the double at 0xB18FB8 (0.4339999854564667) has something to do with the water anims, halving that seems to lets the anim play at the speed 30FPS played at, hopefully we can add inline hooks to just multiply it by deltaTime instead.
Doesn't seem to help with water waves though, those still run a lot faster some reason, not really sure why yet.
E: nvm, water anim is still a lot different even with that changed, too bad.
While looking at this, I ended up trying to compare it with the GC version, and noticed the UHD water looks incredibly odd:

The GC water looks like this:

It appears the UHD water is taking a texture and stretching it really badly to create a weird projection, which ends up looking horrible:

Weird thing is: This texture doesn't appear to exist in the GC version at all?
@emoose, can you check if the water in this room is also using Espgen45 to render its water? I can confirm this is the function used in the UHD version, but maybe they use something else in the GC. Or maybe the UHD one is really broken somehow.
GC seems to be using Espgen45_Move00 for it, making that function ret (or blr for PPC) seems to stop water from updating at least.
Maybe that texture is part of the "HD textures" that UHD included? Maybe disabling that in settings can get it using same as GC?
Looks the same using SD textures on UHD, sadly.
Espgen45_Move is responsible for setting up position and the likes, while Espgen45_Trans(sub?) is what actually sets up the texture. Does GC have that one as well? Would be nice to compare the trans from both versions.
Yep GC uses _Trans/_TransSub too, looks like they might have changed it a bit though, but haven't looked too far into it.
In case you need it here's a IDB for GC debug: https://www.mediafire.com/file/zoquqyiq6hacsct/main_fix_Globals.zip/file
That's for IDA 7.5 though (since that's the last public ver with PPC decompiler), but might be able to upgrade it to 7.7, there is a hacked up PPC decompiler that works on 7.7 too, but not sure if that was in the pack I sent before.
Interestingly the PS2 ver only includes a empty _Trans func (no _TransSub), Espgen45_Move00 still includes some code inside but much smaller than GC/UHD, don't think it'll help us out that much though since PS2 rendering is a lot different afaik.
Wonder whether X360/PS3 has better water, could be something they messed up in PC port like the transparent item screen.
Ah nice, I'll take a look at that IDB. Thanks.
Looks like changing Espgen45_Move to ret before loading into the map stops the circular pattern from showing, doesn't show the reflections like GC though, guess maybe something in Move00 is distorting it?
Seems like Move00 is updating some values which then get shown with Trans(Sub), since you can freeze the state of the water with SPF_WATER or changing Move to ret - might be interesting if we could find what values are set in the GC ver and try copying them over to PC.
Think it's these 4 values that Move affects, probably at different offsets in GC though:
float *pPosBuf_78;
float *pSpdBuf_7C;
Vec *pNorBuf_80;
Vec *pHeightBuf_84;