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 Rayman 3 #81

Open
WinterSnowfall opened this issue Jan 15, 2023 · 19 comments
Open

Missing textures in Rayman 3 #81

WinterSnowfall opened this issue Jan 15, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@WinterSnowfall
Copy link

WinterSnowfall commented Jan 15, 2023

Some objects are untextured or textured incorrectly. It doesn't appear to be caused by CopyRects missing transfers from DEFAULT to MANAGED in this case.

WineD3D also doesn't render things correctly, but it does appear to get some textures right. I'll have to try it on Nvidia to see if ANV isn't at fault here.

I've tried to capture a trace but it crashed before reaching the main menu. Doesn't appear to be entirely empty however, so hopefully it does contain something relevant.

Software information

Rayman 3 (GOG)

System information

  • GPU: Intel Xe (TigerLake GT2)
  • Driver: ANV/23.0.99
  • Wine version: 7.22 Staging
  • DXVK version: d0f5903

Apitrace file(s)

Rayman3.trace.tar.xz

Log files

@WinterSnowfall
Copy link
Author

P.S.: Gave it a go on Nvidia, and can confirm it's not an ANV problem. Same missing textures/see-through surfaces show up here as well, including with WineD3D.

@mrdeathjr28
Copy link

Yeah here shows similar error with UHD 630 GT2

rmn3d8vk

@AlpyneDreams AlpyneDreams added game bug Something isn't working labels Jan 30, 2023
@WinterSnowfall
Copy link
Author

Apparently the missing textures are a known problem with the game and there is an unofficial mod that fixes it: https://raymanpc.com/forum/viewtopic.php?f=13&t=12854

The mod ships its own d3d8.dll - not sure what that does, but it does look like it brings back some of the textures (some character textures still look wrong with d8vk though).

I'll attempt to grab a trace with the mod applied, perhaps that will shed some light into what's going on.

@AlpyneDreams AlpyneDreams removed the game label Feb 23, 2023
@WinterSnowfall
Copy link
Author

I've looked into this a bit more closely, and it seems like Rayman 3 with Better Rayman works well with d8vk already.

Rayman3

I don't think we should spend more time backporting whatever Better Rayman is doing, since the original version of the game most likely relied on some driver hacks to render properly. WineD3D also needs Better Rayman to render correctly, and according to some posts I've read so do some native drivers.

@mrdeathjr28
Copy link

mrdeathjr28 commented Mar 26, 2023

No sadly in my case with intel graphics still have troubles

rymn3b

Rayman3_d3d8.log

Sadly dont leave make a trace, crash loading main menu

@WinterSnowfall
Copy link
Author

It works on Intel as well, I have checked, but you need both d3d8.dlls. To be more exact:

  • the d3d8.dll from Better Rayman next to the game exe
  • the d8vk d3d8.dll in system32/syswow64, where it is normally installed in Wine
  • a Wine override for d3d8.dll with "n,b"

@mrdeathjr28
Copy link

mrdeathjr28 commented Mar 26, 2023

No in my case stay without change

rmn3goga

Maybe can stay related to mesa drivers if you have xe igp based is diferent compared igp before xe

Curiously with d3d8to9 graphics are ok

d3d8to9

@WinterSnowfall
Copy link
Author

WinterSnowfall commented Mar 26, 2023

Here is my d3d8.ini config file. I have not changed anything in the game folder outside of installing the game (GOG version) and then the Better Rayman 3 mod. If you are using the same with latest d8vk (from main branch) there's no reason for it not to work outside of it being misconfigured:

;; Config file for DirectX DLL Wrapper
[General]
LoadCustomDllPath        = BetterRayman3.dll

[Compatibility]
D3d8to9                  = 0
DdrawCompat              = 0
ForceTermination         = 0
SingleProcAffinity       = 0

[Window]
FullScreen               = 0
WaitForWindowChanges     = 0

@mrdeathjr28
Copy link

Here is my d3d8.ini config file. I have not changed anything in the game folder outside of installing the game (GOG version) and then the Better Rayman 3 mod. If you are using the same with latest d8vk (from main branch) there's no reason for it not to work outside of it being misconfigured:

;; Config file for DirectX DLL Wrapper
[General]
LoadCustomDllPath        = BetterRayman3.dll

[Compatibility]
D3d8to9                  = 0
DdrawCompat              = 0
ForceTermination         = 0
SingleProcAffinity       = 0

[Window]
FullScreen               = 0
WaitForWindowChanges     = 0

In my case appear same, however for now with d3d8to9 work

@WinterSnowfall
Copy link
Author

WinterSnowfall commented May 24, 2024

I've had the chance to run the game on Windows XP and a GeForce 4, and indeed, on age-accurate hardware and drivers, it renders the textures just fine, without the need of unofficial patches.

It would be nice if we could figure out why that is happening and have a workaround for it (even if it relies on some sort of incorrect behavior that was in drivers at the time). I'll reopen the issue and potentially look into it at some point.

@mrdeathjr28
Copy link

I've had the chance to run the game on Windows XP and a GeForce 4, and indeed, on age-accurate hardware and drivers, it renders the textures just fine, without the need of unofficial patches.

It would be nice if we could figure out why that is happening and have a workaround for it (even if it relies on some sort of incorrect behavior that was in drivers at the time). I'll reopen the issue and potentially look into it at some point.

I test again maybe when appear dxvk 2.4, maybe d8vk stay merged for release

@WinterSnowfall
Copy link
Author

Seems like Better Rayman is either using d3d8to9 or dxwrapper to apply this fix: https://github.com/crosire/d3d8to9/blob/2b25f270c4119437e80e52f41d0dc30236c62865/source/d3d8to9_vertex_buffer.cpp#L88

If I replicate this behavior, it does indeed seem to fix the issue, so I am guessing this is also inline with what native was doing, at least in the Windows XP era, because the game doesn't run into this issue on an age-accurate system.

@dungeon007
Copy link

For a BetterRayman3, it is probably better to use files from ray3fix https://gamebanana.com/mods/492495
This avoids dxwrapper's d3d8 loading BR, here is winmm.dll as a loader to scripts/BetterRayman3.asi and dinput8, optionally probably you want dsound, maybe yes, maybe dont... and DGVoodoo2 files you can delete.
In ubi,ini select a resolution you want, your desktop res i guess, etc...
As for a bug, seems like you can just add d3d9.allowDiscard = False as a workaround.
R3

@Blisto91
Copy link

d3d9.allowDiscard was removed in dxvk 2.3

@dungeon007
Copy link

dungeon007 commented Jul 26, 2024

Hm, then i have no idea how this started working... i played with older drivers/dxvks releases a bit selected this... and somehow it started working even on more recent, weird seems consistenlty working now... played with DGVoodoo2, d3d8to9, ENB d3d8 wrapper, even:GoG;s d3d8 wrappers, etc... ENB and GoG d3d8 wrappers have similar bug like this DXVK d3d8 (unlike d3d8to9)... in relation to second thread and TnL=1 option in ubi.ini.
Well, maybe just Ray3Fix somehow fixed it for DXVK's d3d8 D But no, you dont need to disable TnL... dont follow everything strictly there. winmm, dinput8 and scripts/BetterRayman3.asi is enough:
WINEDLLOVERRIDES="winmm=n,b;dinput8=n,b;d3d9=n;d3d8=n"
R3_2
With Ray3Fix loader even this ENB d3d8 wrapper from year 2008. is working fine for Rayman3 via DXVK d3d9 :D
http://enbdev.com/convertor_dx8_dx9_v0018.htm
R3_3
"If I replicate this behavior, it does indeed seem to fix the issue, so I am guessing this is also inline with what native was doing, at least in the Windows XP era, because the game doesn't run into this issue on an age-accurate system."
It more seems to me, that order of loading of these wrappers was what corrupting something there... as BetterRayman3.asi or dll is identical :D

@WinterSnowfall
Copy link
Author

WinterSnowfall commented Jul 27, 2024

As for a bug, seems like you can just add d3d9.allowDiscard = False as a workaround.

That option has been removed some time ago, just like Blisto mentioned. I've fixed the problem with: doitsujin#4143 , which won't penalize applications that don't depend on this d3d8 buffer discard quirk. And we haven't seen anything besides Rayman 3 abusing this behavior so far.

It more seems to me, that order of loading of these wrappers was what corrupting something there... as BetterRayman3.asi or dll is identical :D

I have fixed the base game without any mods or patches. Should you use Better Rayman, it will apply this fix for you anyway.

@dungeon007
Copy link

dungeon007 commented Jul 27, 2024

I have fixed the base game without any mods or patches.

For which base version? 1.0, 1.0.2, GoGs, retail 20th year anniversary version... i heard that there are many versions differences :D
Who will play original version when it fluctuates FPS in half all the time?
If not synced and your screen is at 60Hz, then game runs at 72 fps. Further if yours screen is at 75Hz then game runs at 90 fps, etc... depends on your screen Hz how high it goes and then goes occasionally in half to 36 or 45, etc... because of this you want to mod it anyway, regardless if you want to run wide or original 4:3. Maybe only if your screen is 120Hz or greater, then you can limit original to 60, not to drop in half anymore... for example, probably not an issue on ROG Ally X since that is 120Hz :D But even there you still want to mod it at least partially with something more modern like with Ray3Fix.

@WinterSnowfall
Copy link
Author

For which base version? 1.0, 1.0.2, GoGs, retail anniversary...

Whatever GOG has. But I think it would fix original retail copies also.

Who will play original version when it fluctuates FPS in half all the time?

Disabling direct buffer mapping actually helps a lot in this regard (part of my PR). The game still drops to half the framerate at times, but a lot less frequently. It's the best I could do for people who may not be aware Better Rayman exists.

If not synced and your screen is at 60Hz, then game runs at 72 fps. Further if yours screen is at 75Hz then game runs at 90 fps, etc...

No, that won't happen with dxvk's new vsync frame limiter. You can see in the logs that it's properly preventing the game from overshooting the refresh rate.

@dungeon007
Copy link

dungeon007 commented Jul 27, 2024

For now just to confirm original game behaviour, one needs 100Hz screen or greater, so that game run at 120 fps or greater... there you can just limit it to 60.
100Hz4120fps
Doing stupid thing, overshooting Hzs by 20% then halfs it, as not everybody have same Hz screens... anyway, just one of the reasons for modding :D
Anyway this missing textures bug seems to be in relation to second CPU thread and HW TnL, this combination probaly fails on some d3d9 drivers once made threaded. On NINE if i do ENB year 2008. wrapper with csmt_force=0 then it works as is, but since default is csmt_force=1 then bug appear there too. Yeah, there are older apps that missbehave on multicore CPUs. But age accurate drivers (Windows XP and a GeForce 4) of old hardware and d3d8 are likely doing it not threaded, so just run TnL on a single CPU core, thus not a problem. That is a major difference from back then drivers and today's ones and guess what there are bugs potentional once drivers are threaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants