aap/librw

reVC doesn't render model textures correctly

Opened this issue · 11 comments

Hi,

I've built both re3 and reVC for ARM (32bit) linux.
I'm running Gnome 40 on wayland and I'm using glfw from here: https://github.com/ChrisLane/glfw/tree/wayland

My platform (Odroid XU4) uses the ARM Mali wayland drivers.

Grand Theft Auto 3 from the master branch works and renders perfectly fine.
However Vice City from the miami branch doesn't render the textures on the character models correctly.
Screenshot from 2021-04-19 14-42-39
Screenshot from 2021-04-19 14-43-24

Any ideas how to resolve this?
Perhaps some setting somewhere?
The game works fine otherwise.

I'm using the game files from Steam by the way.

It only seems to happen when #define USE_TXD_CDIMAGE // generate and load textures from txd.img is enabled.
Upon first run it will generate models/txd.img and models/txd.dir, but that causes the corruption on the character models.
When disabled, it will render fine.
Perhaps this is a bug that only occurs in the miami branch as it's working fine for gta3.

aap commented

Hm, that's strange. Never noticed that before but i suppose it must be a bug in my conversion somewhere. probably only triggered under specific circumstances.

Yeah definitely something that only happens in reVC during texture conversion which only applies to my platform (arm linux using proprietary ARM drivers for the mali T628 gpu).
But at least I can disable it :)

okias commented

@MastaG Sorry for OT, nowhere else to ask - how it's performance? I think GTA 3/VC would be wonderful on the Linux mobile phones and tablets, but they often offer low performance.

@okias
It runs very well on 800x600 with the draw distance at half.
The only downside of glfw is that it basically uses the desktop resolution (at least when running as wayland client).
Meaning I have to manually set my desktop resolution to 800x600 before launching the game.
Other than that it's very good!

okias commented

@MastaG feel free to also try GTAmodding/re3#1328 it won't fix this bug, but since DXT1 and DXT3 is most likely supported by your GPU, the symptom of this bug should disappear for you.

Ah thanks @okias
Will give it a shot then.
My build is very dated now so I'm definitely going to give it a shot.
I see, a lot of Wayland fixes also went into glfw, so perhaps I can just use the upstream or even the distro version now instead of the fork.

Hi @okias,

Sorry to bump this old issue.
But I've tried the latest re3 snapshot (from a fork that wasn't removed) and I've also bumped the vendor/librw submodule to the latest master branch.

It seems the original developers did enable dxt1 and dxt3 for miami as well.
And I've built with lto and no-git-hash against the latest glfw (configured for Wayland).

While the texture bug is still present when enabling the txd.img generation, the performance is now a lot better and it even runs at 1080p with the draw distance turned down.

Also I did some comparison and noticed that generating the txd.img doesn't really improve the performance for me.

One thing I'm wondering if it's possible to change the in-game render resolution.
It seems to be locked to the display resolution.
So if I want to play at 720p which should be the sweet spot for my platform (Fedora 36 / Gnome 42 wayland on Odroid XU4), I'll have to manually set my resolution to 720p first before running the game.

Any ideas if this is possible?

okias commented

Development needs to be restarted, but I assume no-one has decentralized solution, which could give people to oportunity to work on the re3 code.

About resolution, I looked into code which handles it back then and it would need a rewrite (at least for Linux backend).

TXD is used only for cards which doesn't have DTX1,3 acceleration (game manually converts textures to compatible format -> cost is filesize and larger demand on VRAM), but I guess almost all cards have support for it. It was used only for pre GeForce cards.

It only seems to happen when #define USE_TXD_CDIMAGE // generate and load textures from txd.img is enabled. Upon first run it will generate models/txd.img and models/txd.dir, but that causes the corruption on the character models. When disabled, it will render fine. Perhaps this is a bug that only occurs in the miami branch as it's working fine for gta3.

Thank you for this. I was experiencing the same problem when porting it to the PlayStation Classic which uses armv7 and disabling this fixed it. However I'm now experiencing random crashes.
2023-12-18 03-31-52 mp4_snapshot_38 34 328

I'm no expert but it seems like a memory leak maybe? I am able to play for about 12 minutes, then I notice sudden slowdown and it crashes. I tested it before with the corrupt textures for over a hour and it didn't crash. Here's a video where it crashed 3 times in the span of 40 minutes
https://www.youtube.com/watch?v=VEJrH6qRP8A

Also, any tips on how to improve performance? Like maybe there's some options I can disable such as the Debug menu? I'm using 720x480 resolution and I'm only getting around 15-20fps according to the "Show timebars" option. It does appear more than that, mayb the fps counter is inaccurate