-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot 4.1 Screen flickering in random colors. #79115
Comments
If you can compile the engine from source, you could look into bisecting the regression to greatly speed up troubleshooting. In fact, this is probably the only way this issue could be resolved, as nobody else has been able to reproduce it so far. |
Thanks, i will try that. I'll be keeping note of the possible culprits in this comment: Working commits so far: Other possible factors: |
Possible fix found: If a .godot/shader_cache/ folder from a previous versions is used, this may not be necessary (for some reason). Update: Re-Update: |
The effect on my laptop is more like disappearing meshes/graphic, but the causes seem to be similar. Doesn't happen in 4.0.3, sure does in 4.1.0. Appears to pop when it tries to save shader cache. Like it once had graphic glitch out at the same moment as it informed me that it failed to save shader cache but file was locked. But it sorta sometimes happens and sometimes doesn't on successful cache saves. OpenGL mode. Only 3D scenes. |
Oh, right, I just noticed the setting to disable shader caching in 4.1.0 (Rendering->Shader Compiler->Enabled) That fixed it for me, disabling it. NancokPS2 should try it too to pinpoint issue. I do however get EDIT: Actually, no, that didn't fix it, it keeps doing it at times, just a bit later. Sure keeps happening when I toogle preview light and preview environment. Those even freeze-before-glitching for a small period of time unlike 4.0.3. |
I could try to bisect this issue somewhere between 4.0.0 to 4.1.0. So I would need a compile buddy. (Have AMD GPU too like these two people, Windows, will write more later) |
Also possibly related issue where OpenGL rendering worked in Godot 4.0 and then stopped working in 4.1: This one also seems to hint at shader caching issues, although there seemed to be more problems behind it. The drivers and GPU were pretty ancient. They also did some good release bisecting, possibly pointing to some OpenGL change in 4.1 dev2: #78888 (comment) However, this is still just speculation, these issues might have nothing to do with each other. |
I tested and can confirm that my own bug starts to happen to me at 4.1 dev2 too. Also, here is my GPU stats as seen by Godot: Mine, I think, are related with #78936 too. |
A lot seems to point to #76092. It might be correctly implemented but old or buggy GPU drivers might just trip on that feature somehow, the general OpenGL driver quality has never been too high. If anyone wants to test, they can try to build Godot with that one-line patch by ChibiDenDen: #78888 (comment) Another alternative is to simply patch |
Ok, did some compiling. ChibiDenDen's one-line patch did nothing, bug still present. Then I played with making
So it must be something about saving to the cache (that doesn't get disabled by I did a bit of early return/break testing within cache saving function and I notice that my rendering starts breaking after I know nothing about rendering, so I would need clear instructions if you want to test further. |
Thanks @Foxysen, you have been a great help so far, looks like we are slowly closing in on a solution or at least a workaround here. None of the team members here seem to have access to hardware or drivers causing this issue, so debugging it is pretty hard.
It seems like both GLES3 and Vulkan shader caches are always enabled in editor mode. Only when playing/running the project or an exported version does the setting take effect. So it makes sense why forcefully patching it out helps: godot/drivers/gles3/rasterizer_gles3.cpp Lines 278 to 281 in 6588a4a
In theory, you might be able to bypass shader cache and this bug by running the project directly on command line, bypassing the project manager and editor. Adding this:
to your
should in theory bypass shader cache and this bug, but I haven't tested it. Important: use --verbose! It should also try to log more OpenGL errors. This will redirect output to The I'm a bit busy this weekend, but I'll try to put a special debug version build/PR out early next week with some extra logging and error handling, I'll report back here then. It might show something useful and makes it possible for other people to test things, too. Everyone else is free to report their experiences here, too. In fact, that could be extremely useful, so no need to hesitate. But don't forget to post your computer and GPU specs. |
Getting to disable cache in editor would have been a good workaround for us old hardware havers. Hm, I am trying to understand what you want me to do. You want us to disable shader cache and then run Godot on non-exported project, bypassing the editor, while logging everything? Wouldn't it be useless since we won't encounter shader cache driver bug due to it being disabled in non-editor? Just making sure that it's related to shader cache this way? |
Now that I think of it, you could do both. First, just run the project editor normally in a stock Godot editor using command line, but redirect the output to a file (note the added --editor argument here):
Then you can do the project.godot editing trick and run the project directly, bypassing the editor (without the --editor argument)
If you can add both logs (godoteditor.txt and godotplay.txt) to your post here, that could be useful. Note that there can be some directory names like your user/home folder in the logs, you can replace them with YYYY or something if you want to. |
Ok, played around, including looking at verbose console while doing things, so I have a good idea what error messages it prints when bug pops up... None! Still posting logs anyway tho. For editor log file (shaders are enabled!), I played around until I made the bug appear. From what my experience with console, my actual editing session started after For editor-less version, I actually had hard time making the bug appear even with shaders enabled, at least in my test project that doesn't push complex things. Just once and I missed it. I have run a normal stable 4.1 Godot. |
@Foxysen Could you test #79883? While taking a look at the shader caching code, I noticed that we never check if the cache location is available. But the check is required as we use it as a shorthand to check if the shader cache is even enabled. This might be enough to fix your issue. However, it may only be enough to fix the fact that you can't disable the shader cache. I would appreciate testing from someone who can reproduce the issue |
Ok, tried it. |
Took a bit longer to dig more into this, but I made a draft PR that might help or at least provide more logging info: #80680 Anyone who is affected by this issue is free to either build their own Godot using that PR or download a build artifact and test it. If you want to build Godot yourself, either fetch the PR using git or apply a patch version: https://patch-diff.githubusercontent.com/raw/godotengine/godot/pull/80680.patch If you can't build Godot yourself, you can download a build by logging in to Github and downloading an Godot editor build artifact corresponding to your operating system, they should be available in the Checks section https://github.com/godotengine/godot/pull/80680/checks, you should download the editor build, for example @Foxysen, can you test the PR either way and see if it helps or not? The PR also adds a lot more logging, so posting the log file here might reveal something more useful this time. As usual:
Everyone else if also free to report any useful information. |
Downloaded artifact for Windows 64-bit editor. Didn't help. godot_foxysen_log.txt (I am close to just running 3D Godot projects on Linux where I don't have any OpenGL driver bugs, but have like less FPS, probably picked too heavy Linux OS with Gnome, heh ow. But still going to assist on this rather annoying bug. If you can't figure it out, just add launch flag to disable shader cache for editor, put FAQ, I already have to run "--single-window" on Windows.) |
Thanks for testing @Foxysen. I just updated the PR with a new version with some small OpenGL changes (like using an OpenGL shader cache hint when creating shaders) and logging tweaks. If you can also test that new version and post the log, I would appreciate it. I doubt it will make much difference, but a there is always a chance. I also added a command line switch (
That command should hopefully work better as it should fully disable shader caching (but it does not forward that argument yet to the child process if you press play in editor). No need to post log for this one if it works. We might have to add a manual switch like this anyway, but it would be better if we could detect the situation programmatically if possible so that Godot users can target as many systems as possible without having to force disable cache by default for everyone. Unfortunately, it looks like some drivers are just too broken unless we want to manually create some kind of blacklist. |
Downloaded artifact for Windows 64-bit editor. It seemed to take a while to make the glitch manifest but it still did for me. Frankly, for some reason, I couldn't yet make glitch manifest with The launch switch |
But yes, I welcome other people with the shader cache impacted OpenGL driver bugs to check this artifact out. I think I might have exhausted the best out of my side. Maybe others will get a more specific error/log behavior. |
Godot version
v4.1.stable.official [9704596]
System information
Windows 10 x64 - Godot v4.1 - OpenGL (Compatibility) - dedicated. GPU: FirePro v4900. CPU: AMD Phenom II X6
Issue description
The viewport is constantly flickering between colors no matter the scene or project. Compatibility mode both in the editor and when running.
The issue does not seem to come into effect during runtime.
Steps to reproduce
Minimal reproduction project
N/A
Update:
It seems to be an issue with cached shaders from a previous version(?)
No idea honestly, it seems to be working fine so far.
The text was updated successfully, but these errors were encountered: