ValveSoftware / Source-1-Games

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

[TF2] Mat_queue_mode 2/Multicore rendering causes water flickering and water material errors on first map loads #4937

Open Thespikedballofdoom opened 1 year ago

Thespikedballofdoom commented 1 year ago

Mat_queue_mode 2 causes water to flicker and spam material errors in the console in sv_pure 1 and above servers.

https://user-images.githubusercontent.com/43627353/235624585-a8b65871-54f5-4859-967f-3790911798a8.mp4 https://user-images.githubusercontent.com/43627353/235624595-46bf60fc-b91b-4636-8495-716687225adb.mp4 It is more apparent than this at higher refresh rates.

From all my testing it tend to happen more after visiting other servers but I can't identify the exact conditions it happens under no matter what so I'm only able to guess that sv_pure affects it. It will always happen if connecting to an official matchmaking server. It seems to go away after a while but it always still happens and in many cases induces lag at least once for me.

I can't tell if it's an issue related to my hardware so this is my system information from steam: ``` Computer Information: Manufacturer: Micro-Star International Co., Ltd. Model: MS-7C56 Form Factor: Desktop Touch Input Detected Processor Information: CPU Vendor: AuthenticAMD CPU Brand: AMD Ryzen 7 5800X 8-Core Processor CPU Family: 0x19 CPU Model: 0x21 CPU Stepping: 0x2 CPU Type: 0x0 Speed: 3800 Mhz 16 logical processors 8 physical processors HyperThreading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Supported SSE41: Supported SSE42: Supported AES: Supported AVX: Supported AVX2: Supported AVX512F: Unsupported AVX512PF: Unsupported AVX512ER: Unsupported AVX512CD: Unsupported AVX512VNNI: Unsupported SHA: Supported CMPXCHG16B: Supported LAHF/SAHF: Supported PrefetchW: Unsupported Operating System Version: Windows 10 (64 bit) NTFS: Supported Crypto Provider Codes: Supported 311 0x0 0x0 0x0 Video Card: Driver: NVIDIA GeForce RTX 3070 Ti DirectX Driver Name: nvldumd.dll Driver Version: 31.0.15.2647 DirectX Driver Version: 31.0.15.2647 Driver Date: 10 25 2022 OpenGL Version: 4.6 Desktop Color Depth: 32 bits per pixel Monitor Refresh Rate: 144 Hz DirectX Card: NVIDIA GeForce RTX 3070 Ti VendorID: 0x10de DeviceID: 0x2482 Revision: 0xa1 Number of Monitors: 2 Number of Logical Video Cards: 2 No SLI or Crossfire Detected Primary Display Resolution: 1920 x 1080 Desktop Resolution: 3000 x 1933 Primary Display Size: 20.91" x 11.77" (23.98" diag) 53.1cm x 29.9cm (60.9cm diag) Primary Bus: PCI Express 16x Primary VRAM: 8191 MB Supported MSAA Modes: 2x 4x 8x Sound card: Audio device: Speakers (2- Realtek(R) Audio) Memory: RAM: 32694 MB VR Hardware: VR Headset: None detected Miscellaneous: UI Language: English Media Type: DVD Total Hard Disk Space Available: 2860978 MB Largest Free Hard Disk Block: 1010022 MB OS Install Date: Sep 19 2021 Game Controller: None detected MAC Address hash: 0632084068b8b773312ff3bf13e4c05cdc38898c Storage: Disk serial number hash: d2bfc131 Number of SSDs: 0 Number of HDDs: 0 ```
Thespikedballofdoom commented 1 year ago

r_eyes 0 fixes it for me. I don't get how they are related. Also this bug only happens if you're on a pure server, sv_pure 1 or higher.

Void48 commented 1 year ago

For anyone wanting a band-aid fix, the Beta Eyes mod fixes the water flickering issue and also gets rid of the errors completely (though, this does introduce some console $cloak and Material eye-related errors, they are harmless and you can filter those out with these two commands: con_filter_enable 1 con_filter_text_out eyeball I recommend putting these in your autoexec.cfg

Preloading is required for this mod to work in Casual!

Thespikedballofdoom commented 1 year ago

I've created a better bandaid that looks the same as regular eyes without loading the broken shader. This really needs to get fixed before some poor mapper thinks this bug is their fault. https://github.com/Thespikedballofdoom/No-such-variable-fogenable-/tree/1

NULLYUKI commented 1 year ago

I've created a better bandaid that looks the same as regular eyes without loading the broken shader. This really needs to get fixed before some poor mapper thinks this bug is their fault. https://github.com/Thespikedballofdoom/No-such-variable-fogenable-/tree/1

Wouldn't this be a perfect thing to upload to the workshop as a "Community Fix" ?

Thespikedballofdoom commented 1 year ago

Nope, I'm fixing a bug by using lower quality shaders that will break mod compatibilities if it was actually put into the game.

Koi-TF2 commented 6 months ago

+1 for this issue. I've also found that, for me, being in spectator camera can sometimes make this effect worse (i.e. something as simple as being killed mid-match and waiting for respawn)

I can reproduce the exact same issue with the following two cvars: r_eyes 1 mat_queue_mode 2

The issue can be fixed by either of the following methods:

Disabling eyes entirely r_eyes 0 mat_queue_mode -1,0,2 (any queue mode)

Keeping eyes enabled, but forcing synchronous single thread queue mode r_eyes 1 mat_queue_mode 0 specifically

This being the case, it seems like the issue is caused by the eye shader/mat not playing nice with queued multithreading enabled..? Which is a very oddly specific issue. I would imagine that fixing the eyes would be the most simple fix, as previously mentioned in this issue

This issue still exists within the x64bit build of TF2, unsurprisingly