Rendering issues in an old Sonic 3D fangame

#205 · closed · 3 comments

View on GitHub ↗

BareGamer

There is this really old Sonic fangame (https://gamejolt.com/games/sonic3d/28626) that I tried to launch with d3d8to9. It is fine at first, but instead of loading into the gameplay normally, it looks like this: <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/b3a0b840-2a66-4e11-82d9-9d21dbae83df" /> Here's how it should look(actually it renders a bit incorrectly because some of the image is cut off, the reason for which might be apparent later. This problem also doesn't happen in wine) <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/eb11f695-fd96-424d-b2a6-9713da0f9c3f" /> I suspect that the reason why is because it is doing funny things with display resolution(and vsync), possibly to make the intro video seem fullscreen, which can be seen if msi afterburner is running. I also did an apitrace capture. It does this in the first frame <img width="1431" height="203" alt="Image" src="https://github.com/user-attachments/assets/9b41b46f-5951-4615-ad51-94e1dc0d4a29" /> Later it does this, trying to set the viewport to 6256 * 10240 <img width="818" height="102" alt="Image" src="https://github.com/user-attachments/assets/296870e2-754f-4118-8886-c722880afea6" /> And this is the present at the end of the frame. Maybe this is the reason why the screen is cut off. <img width="1677" height="57" alt="Image" src="https://github.com/user-attachments/assets/80d7b6b6-b7d2-4262-823f-97c1105ec104" /> Interestingly, after entering a level, the screen fixes itself. Which also breaks apitrace <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/1bc9ad01-d2da-44de-b754-5c3b8b39e4c5" /> I will attach the apitrace file just in case https://drive.google.com/file/d/1RB-HlATH2usqNd8s2yQ-BYFefXp8tBiO/view?usp=sharing

Comments

BareGamer

I was retesting under linux today and noticed that d3d8to9 doesn't get used under wined3d but does under dxvk. Not sure what it's an issue with.

crosire

The invalid viewport was indeed the cause. This should have been filtered out by d3d8to9, but wasn't. Is fixed now.

BareGamer

Hello, thank you for taking the time to fix the bug. I just tested the fix today because it took me an embarrassingly long time to figure out how to download the artifact. I used the new version of the library to play this game portably in winlator, which also had a similar issue on my SoC, so it definitely works. Thank you for your work on the project!