ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
634 stars 74 forks source link

[Linux] [TF2] mat_bumpmap "0" and mat_phong “0” cause black polygon corruption #3443

Open shoober420 opened 3 years ago

shoober420 commented 3 years ago

System Information: https://github.com/shoober420/linux-scripts/blob/main/home/shoober420/sysinfoamd

When setting mat_bumpmap "0" in console, my screen will bug out and black polygons are drawn all across the screen at random times.

LavaDesu commented 3 years ago

This issue started occurring after mesa 20.2, here's the issue on the mesa bugtracker.

shoober420 commented 3 years ago

Interesting, that’s the black polygon corruption I see, but it’s not triggered by mat_phong “0”. That setting didn’t bug out TF2 in my case. I also have phong disabled, but it’s disabling bumpmaps that caused the black polygons for me.

I created a mesa issue on gitlab about this yesterday.

https://gitlab.freedesktop.org/mesa/mesa/-/issues/3864

shoober420 commented 3 years ago

I must mention that a combination of both mat_bumpmap “1” and mat_phong “1” must be set for the black polygons to disappear. Enabling or disabling one or the other will still produce black polygons.

sweglord227 commented 4 months ago

this issue was fixed in the 64bit update. i previously had the same problem, and now it works as expected.

Ristovski commented 4 months ago

@sweglord227 I suspect the issue was fixed merely as a byproduct of the switch from Valves ToGL to DXVK (and thus might still be present under the Legacy OpenGL launch option).

Tiagoquix commented 3 months ago

OP, can you retest this on the new Vulkan version?

shoober420 commented 3 months ago

I havent been on my Linux machine in over a year. Its an AMD system with wayland, but I cant launch sway on it currently. It uses wayland and sway git master builds. Ive been using my girlfriends Windows 11 machine with a 4090, so I havent given it much attention.

I miss using Linux and its been on my heart to go back to Linux for quite some time. I should be able to test in like a week. ToGL is probably the reason for this and other little graphical bugs Ive posted about.

kisak-valve commented 2 months ago

Closing pending feedback.

TailsFanLOL commented 1 month ago

Closing pending feedback.

Still broken for me (Mesa 24.1.5-arch1.2.1 Intel(R) HD Graphics 4400 (HSW GT2))

Tiagoquix commented 1 month ago

@TailsFanLOL Which render are you using?

TailsFanLOL commented 1 month ago

@TailsFanLOL Which render are you using?

As in API? OpenGL, obvious.

Tiagoquix commented 1 month ago

ToGL is deprecated (called "Legacy OpenGL") by Valve on Team Fortress 2 specifically. I doubt this will be fixed, since the same problem does not exist on DXVK.

TailsFanLOL commented 1 month ago

ToGL is deprecated (called "Legacy OpenGL") by Valve on Team Fortress 2 specifically. I doubt this will be fixed, since the same problem does not exist on DXVK.

Unrelated, but why do Source games still even use translation layers to DX? Is it really that deep into the codebase?

shoober420 commented 1 month ago

@TailsFanLOL Source games used Direct3D as opposed to OpenGL back then. Fortunately, Source games now have an option for Vulkan which avoids the need for a Direct3D wrapper like ToGL. I would use the -vulkan launch option for all Source titles, on Linux and even on Windows. Vulkan is a superior graphics API compared to both Direct3D and even OpenGL.

TailsFanLOL commented 1 month ago

Fortunately, Source games now have an option for Vulkan which avoids the need for a Direct3D wrapper like ToGL.

Now tell me what DX in DXVK stands for.

Tiagoquix commented 4 weeks ago

All Source 1 games on Linux either use or used the ToGL (Direct3D-to-OpenGL) or DXVK (Direct3D-to-Vulkan) translation layer.

What exists is that there is a way to use DXVK natively, without needing Wine, but still is DXVK and not a native Vulkan render. As far as I can tell, no Source 1 game has any native rendering on Linux; all of them are just translation layers.

Native Vulkan only exists on Source 2 games (at the moment, Dota 2 and CS2).

shoober420 commented 2 weeks ago

My apologize, I thought the Source games used native Vulkan when using the -vulkan launch option, but thats not the case. Youre right @Tiagoquix, Source 1 engine games use DXVK when the -vulkan option is used. I guess theres no Vulkan (DXVK) in Counter-Strike: Source yet.

https://developer.valvesoftware.com/wiki/Vulkan