Facepunch / garrysmod-issues

Garry's Mod issue tracker
143 stars 56 forks source link

Self-breaking cubemaps #5755

Open Lombaxtard opened 7 months ago

Lombaxtard commented 7 months ago

I've included a video. It is imperative you watch it in full in order to understand that this is no ordinary cubemap issue.

Details: My cubemaps become corrupted every single time a new 3D icon is generated (utilizing spawnmenu's method) or re-generated. mat_specular does not solve the issue in full, it only fixes some items' reflections it seems, while map reflections such as those in windows still emit famous purple&black debug textures. This problem here I used to not have at all. And although I'm making a showcase on an unofficial map (which weighs around 4 MBs, uses almost exclusively those assets that are shipped with GMod, except for two models - of a hummer and sand bags, hasn't been updated since it's release in 2016), I previously have played (on a different computer a few years ago, using chromium branch as well) on it for monstrous amounts of hours, using the spawnmenu for mapping and subsequently generating a lot of icons and I have never had such a problem back then. Until recently, I was using invisible debugempty textures to alleviate this, however after a couple of months of inactivity in GMod and a few released updates made to the game (as of today) when I returned this "fix" of mine no longer worked as the emos were back again. I have indeed tried to verify integrity of game files, removed all addons (including local addons), reinstalled the game a couple of times, reinstalled graphics drivers, updated everything I could, tested with the original x32 GMod version, even reinstalled my Windows 10 at some point with absolutely no success. Whilst searching for a solution on the Web I have only found cases of "set mat_specular to 0 to fix missing cubemaps reflections on custom maps", but the cubemaps are not missing at first. They are being rendered corrupt by the use of icon generation (seen in the video, as cubemaps are completely fine at first). Strangely enough, this does not happen to all maps. For example, there are two versions of Pripyat for GMod on the workshop: Pripyat and Pripyat Remastered. I am positive that both have cubemaps. However, after generating a single icon the former attains debugempty in place of cubemap reflections, while the latter does not. It's very inconsistent in between the maps. That's why I had to resort to showcase on a map I can reproduce this consistently. An important detail - I have tasked my companion with testing the exact same thing on his end using the same actions, but he wasn't able to reproduce the issue, which makes me believe it's a hardware-specific issue. It is also very likely, as I'm using AMD Ryzen 7 3700U with Radeon Vega mobile gfx (an APU) from 2019.

Steps to reproduce: pretty much impossible on someone else's end, I reckon The video footage with all the steps, console and additional demonstration of mat_texturelist before and after: https://youtu.be/hdIT19NxfOw

robotboy655 commented 7 months ago

Yeah, I cannot reproduce this. I do have an nvidia GPU though.

Using r_showenvcubemap 1 shows all cubemaps on that map as black, which would indicate lack of cubemaps altogether, or that they were not built. image

This is what it should look like: image

Even mat_texture_list 1 shows no cubemap textures on that map.

I do not know why the behavior is different for you on a different GPU.

I have noticed that even your texture list window looks incorrect and has a white background.

Have you tried maxing out your in-game graphics settings, restarting, and trying again?

Completely reinstalling the game? (Specifically I am thinking delete the resource/ scripts/ addons/ download/ lua/ gamemodes/ cache/ folders as well as the sourceengine/, bin/, and platforms/ folders and verify the game)

Lombaxtard commented 7 months ago

Have you tried maxing out your in-game graphics settings, restarting, and trying again?

I have. Models, textures, reflections, HDR, resolution - you name it. Lowest, highest, mid

Completely reinstalling the game?

As mentioned. I also tried a completely full reinstall at some point, including using "FactoryReset-GMod.bat", disabling Steam cloud...

And just to emphasize, why on Earth would gun cubemaps disappear with mat_specular 0 (as in my video) but not in the glass? And why is replacing debugempty since recently no longer changes that particular texture in the glass (it successfully hides broken gun reflections, though)? Does it suddenly use a new separate debugempty texture now? And why would act of rendering/re-rendering an icon would even break stuff in the first place? Shouldn't it revert to default cubemaps in case of an error/missing cubemaps on custom .bsps (to the ones that are super bright with an orange undertone)? Any mods (extracted or not) that replace the default cubemaps don't have an effect on them, as well those for the debugempty And shouldn't whereis show the path of the emo texture in materials/debug/? It's just labeled "error" with "file not found" Like I said, I have played probably a couple of hunders of hours at least on another computer whilst using icon rendering constantly and never once breaking a thing, you can't reproduce this issue, flashing a completely fresh GMod installation does nothing... I wish I could fix this myself and not have to post an issue here on GitHub, I wish I could simply put mat_specular to 0 at least. Deprive myself of some nice reflections, but at least be free from the missing textures. I have tried everything there is to try it seems, therefore I'm curious to the nature of this bug, to know what even happens in these moments to the game

robotboy655 commented 7 months ago

I don't know why what is happening is happening to you. Without the ability to reproduce the issue I cannot tell you why any of that is happening.

Regarding the missing texture being "file not found" - that is completely normal, the texture is not loaded from your disk, it is generated by the game automatically.

Given your claim it is potentially a hardware/GPU driver specific issue, the change in behavior could've come from that as well.

Lombaxtard commented 7 months ago

I don't know why what is happening is happening to you. Without the ability to reproduce the issue I cannot tell you why any of that is happening.

Regarding the missing texture being "file not found" - that is completely normal, the texture is not loaded from your disk, it is generated by the game automatically.

Given your claim it is potentially a hardware/GPU driver specific issue, the change in behavior could've come from that as well.

I tried installing DXVK 2.3 (for x64, DX9) and it fixed the issue. Tested around 6 times with/without it in the exact same environment, the results seem to be consistent. It's not a perfect solution, as it eats a bit more of my weak CPU. But it's 'A' solution, since debugempty replacements refuse to work in this situtation

JokerR3310 commented 7 months ago

I discovered that if the map is compiled without an at least one env_cubemap entity, then exactly this problem happens.

This problem can be triggered not only by the generation of new icons but:

This problem is somehow recent (maybe) on 19.03.2020 maps without cubemaps entities had no such problems with AMD gpu's.

SCEEPWARE commented 7 months ago

I don't know if it will add something to the issue, but I have the exact same problem. The problem appear when the game is rendering an icon for me as well. I also have an AMD GPU (Radeon 780M) and did not have this issue on my older PC with a NVIDIA GTX 1070. I think it also happened with the AMD Vega 8 of my other laptop but I'm not too sure.

Likewise, my friend also has the same problem, he also has an AMD GPU (Radeon RX 6650 XT) and did not have this problem with his older PC with a RTX 3060.

I tried using older drivers version and all but the issue still remains.

robotboy655 commented 7 months ago

It is evident that the issue is either with AMD drivers, or something fixed by NVidia drivers. Unfortunately I do not have any AMD GPUs, all PCs in my life had NVidia GPUs.

Can anyone reproduce this issue on an Intel Integrated GPU or Intel ARC? Just as a point of comparison.

JokerR3310 commented 7 months ago

Intel i3 4gen CPU with Integrated HD 4400 (driver: 10.18.15.4279) - OK intelHD4400 and, AMD RX580 (driver: 24.1.1) (problem exist) amdRX580

robotboy655 commented 7 months ago

So that suggests it's more likely an issue with AMD drivers, idk.

Lombaxtard commented 7 months ago

...right. Anyway, I've referenced this topic on AMD forums,, so you AMD guys might wanna check in on it from time to time

robotboy655 commented 6 months ago

Potentially duplicate of https://github.com/Facepunch/garrysmod-issues/issues/2218

JokerR3310 commented 6 months ago

and finally, NVIDIA GeForce RTX 3080 (LHR) (driver: 552.12) - OK 20240407015603_1