protonscr

[REQUEST] Add Toggle Option for Backface Culling On/Off in dxvk.conf

dxvkclosed
doitsujin/dxvk#3728 · opened 2023-11-27 by Mrblubb · updated 2024-10-14 · 15 comments · github
MMrblubb 2023-11-27 github

Few older games on PC render incorrectly (eg. GUN ) and some textures appear transparent when overlapped with another object. This is because of backface culling with D3D9. An flag to toggle it off with dxvk might fix this issue.

WWinterSnowfall 2023-11-28 github

d3d8/9 allow applications to control back face culling via a render state. Adding a toggle for it makes no sense, it should seamlessly work, much like on native drivers.

If you've noticed a particular issue with a game (e.g. GUN) please fill in the issue template and attach logs and a trace.

P.S.: If this is a game bug you're describing, then I'm not sure if it's in scope to alter proper behavior to address it, to be honest.

KK0bin maintainer 2023-11-29 github

What youre describing doesn't even sound like backface culling.

MMrblubb 2023-12-01 github

@WinterSnowfall @K0bin
Thanks a lot for taking this issue into account.
I'm sharing the video demonstration of the exact issue in the PC version : https://imgur.com/a/MLyWlBb
And Now here's the PS2 version : https://imgur.com/a/rggW4gL
Notice the feet and how they get hollowed in the PC version.
If somehow D3DCULL_NONE could be forced into the game, that would possibly fix it.

WWinterSnowfall 2023-12-01 github

This looks like a very minor game bug. There's nothing to "fix" here, since dxvk is very likely doing what the game is asking of it as far as d3d is concerned. Unless it ever looked any differently on PC, which I doubt.

If by "fix" you mean "make the game look like the PS2 version", that's really not something to pursue here and falls well within modding territory.

That being said, technically speaking you are free to force anything you want by forking the project and making your own build. As I mentioned before, you can use a render state to control culling, if you really want to give it a go.

MMrblubb 2023-12-02 github

Sure thanks! But how do I force render state to control culling in games ?

KK0bin maintainer 2023-12-02 github

You don't. I highly doubt your problem is actually blackface culling.

MMrblubb 2023-12-02 github

Yes it is! The game refuse to render inside polygons of any object and make it transparent. It is exactly what this article shows : https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Backface-Cull-Object-renders-transparent-when-facing-away-from-view.html
I want to force renderstate to see which culling mode actually fixes it given if it really works in runtime dx9

WWinterSnowfall 2023-12-02 github

@Mrblubb Like @K0bin mentioned, I doubt it will do anything, but since you sound like someone who wants to try it anyway, plopping a rs[D3DRS_CULLMODE] = D3DCULL_NONE; instead of this line should do the trick, assuming the game doesn't mess with this render state itself.

MMrblubb 2023-12-02 github

Many thanks! @WinterSnowfall but I'm assuming it would require compiling & building the whole repo & that I'm not familiar with. Could it be that it can be added configurable in dxvk.conf Or could you please be kind enough to provide me just this version please!!

WWinterSnowfall 2023-12-02 github

Or could you please be kind enough to provide me just this version please!!

The repo has a GitHub Actions builder that comes along with the project once you fork it, but sure, here's a build with the above change: https://github.com/WinterSnowfall/dxvk/suites/18696011657/artifacts/1088163286

Remember that this is incorrect behavior d3d-wise, even if it somehow works for this game.

MMrblubb 2023-12-02 github

Awesome! Thanks a ton. Going to check now. Hopefully it will fix everything :)

Edit: Sadly it didn't fix it. But Thanks to your Super support, I learned something new in graphics today. Will experiment more with d3d9 render flags & stuff. :D
But I wonder what could that issue be actually if not backface culling anyways??

WWinterSnowfall 2023-12-02 github

But I wonder what could that issue be actually if not backface culling anyways??

No idea. I have the game on PC, so could check what's going on, but it's highly likely it's just a game bug (ergo, something they messed up while porting the game over from consoles).

MMrblubb 2023-12-02 github

Yeah probably that's the case because I just watched some xbox gameplay of if and it's exactly the same there too. Only doesn't happen in the ps2 version, and PC version is xbox port.
Something unrelated but do you know when a game doesn't apply normal map + its alpha spec channel ingame ??
It's this game Dead to Rights (old classic) and it has all the proper normal maps with proper alpha channels but ingame no specular is shown despite texmod actually showing it's loading it. But on xbox console it has proper specular texture.
(I'm actually a small modder and make texture mods and simple fixes & want to mod a few games :)

WWinterSnowfall 2023-12-02 github

Something unrelated but do you know when a game doesn't apply normal map + its alpha spec channel ingame ??

I'm not sure I even want to know what old game engines did at times (or rather how they did certain things... :). d3d9 at least is truly a land of jank.

Btw, I don't even see the issue in the first part of the game... perhaps it's just the mesh for those pants that's not clamping on the shoes properly?

MMrblubb 2023-12-02 github

Well yeah! but there's more to the story here ;)
Actually GUN is a beautiful game but on PC is a messy game graphics wise. Controls are good and still holds up today. But devs really messed up to fullest in graphics.
It was made for originally Xbox & PS2 & so they have their advantages but later was ported for the 360. The PC version was based on xbox original but it was supposed to inherit all the improvements of 360 as well. So, for original Xbox graphics you need to keep the "Advanced Graphics" to "Low". This will match exactly xbox textures. The "medium" & "high" settings allow for normal maps & spec mapping but since the code was messed up, game loads between 64x64~128x128 texture assets despite there being original 256x256 & 512x512 present already. Not to mention all the texture & UV mapping errors with bad shading as well.

That's why "Low" Advanced graphics look better & sharper than "High" : https://imgur.com/a/KWff0i5

Now, about that "hollow feet issue" It will be first noticeable after the ALHAMBRA showdown where you get your first new Outfit. From there on, every other outfit have this exact issue. Including npcs too.

Nothing extracted yet.