Closed daudix closed 1 year ago
Hey there! Thanks for the report, it seems to be indeed the same issue as #199. As I cannot reproduce this on my end, we would have to try to fix this on your end. Do you feel confident editing some GLSL shaders? Then I could give you a step-by-step guide on how to proceed :smile:
I can try )
Alright, I have looked at the shaders and I can do nothing with them, sadly
The only simple way you can reproduce this on your end is a VM with 3D acceleration, GNOME Boxes and Fedora work nice together and it have 3D acceleration option
I cannot reproduce this. It neither happens in a virtual machine (with and without hardware acceleration) nor in the continuous integration jobs which test all the effects on various Fedora versions on every commit. Hence, I would guess that it is quite closely related to the involved hardware...
But maybe we can test this on your end anyways. I'll send you some instructions later today!
Thanks!
Alright, will add some debugging output to the shaders and see if we can deduce something. Here are the required steps (if you need a more detailed explanation at some point, feel free to ask!):
Clone the Burn-My-Windows repository. To do this, open a terminal, change to a directory where you want the source code of the extension and execute these commands:
git clone https://github.com/Schneegans/Burn-My-Windows.git
cd Burn-My-Windows
Now you will have to install the extension. This command compiles the locales, schemas and resources, creates a zip file of the extension and finally installs it with the gnome-extensions
tool:
make install
<Burn-My-Windows directory>/resources/shaders/common.glsl
with a text editor.Replace this line with this code:
bool isnan(float val) {
return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;
}
bvec4 isnan(vec4 val) {
return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));
}
void setOutputColor(vec4 outColor) {
// Return red if any RGBA component is NaN.
if (any(isnan(outColor))) {
cogl_color_out = vec4(1.0, 0.0, 0.0, 1.0);
return;
}
// Return yellow if any RGBA component greater than 1.0.
if (any(greaterThan(outColor, vec4(1.0)))) {
cogl_color_out = vec4(1.0, 1.0, 0.0, 1.0);
return;
}
// Return green if all RGBA components are zero.
if (all(equal(outColor, vec4(0.0)))) {
cogl_color_out = vec4(0.0, 1.0, 0.0, 1.0);
return;
}
// Return blue if alpha component is zero.
if (outColor.a == 0.0) {
cogl_color_out = vec4(0.0, 0.0, 1.0, 1.0);
return;
}
cogl_color_out = outColor;
}
make install
If you want to revert the changes, simply execute this commands for now:
cd <Burn-My-Windows directory>
git checkout resources/shaders/common.glsl
make install
And finally restart GNOME Shell with Alt + F2, r + Enter if you are on X11 or logout / login if you are on Wayland.
I hope that we can figure this out... thanks for your support!
Thank you for detailed guide, I really appreciate it!
Yep, colors have changed, black rectangle is now blue in most effects ("Incinerate" have additional yellow color)
Interesting :smile:.
Could you please replace the original line with this code:
void setOutputColor(vec4 outColor) {
if (outColor.a == 0.0) {
cogl_color_out = mix(outColor, vec4(0.0, 0.0, 1.0, 1.0), 0.99);
return;
}
cogl_color_out = outColor;
}
Is it still blue? Remember to always do a make install
followed by a Alt + F2, r + Enter (or logout / login if you are on Wayland) after each change.
If this is still blue, you could also try this variant:
void setOutputColor(vec4 outColor) {
outColor.a = max(outColor.a, 0.00001);
cogl_color_out = outColor;
}
What happens now?
Using first snippet effects that had black rectangle have black rectangle, and effects such as hexagons have blue background
Using second snippet effects that had black rectangle have black rectangle, and other effects look like normal
Ahh, I feared that. It seems that there is some issue in the shader code. In the first version, we have simply overridden the output color with blue. This allowed the GLSL compiler to remove basically all other code as it would not affect the final color. Hence, the buggy part was optimized out. In the second variant, we did not override the color with blue, but mixed it with 99% blue. Hence, the compiler could not remove the rest of the code and now it crashes again, resulting in black color.
Could you please list all effects which exhibit the black issues? Maybe I can spot something which all these effects have in common...
Of course! here is it
Thanks! I think that I found something. Could you try to replace the alphaOver
function in line 123 with this version (and undo all other changes you did)?
vec4 alphaOver(vec4 under, vec4 over) {
if (under.a == 0.0 && over.a == 0.0) {
return vec4(0.0);
}
float alpha = mix(under.a, 1.0, over.a);
return vec4(mix(under.rgb * under.a, over.rgb, over.a) / alpha, alpha);
}
This catches a case which potentially divides by zero. Maybe your hardware does not like this :stuck_out_tongue:
line 123 - 126, right?
Yes!
Awesome! Thanks a lot for your time. This fix will be included in the next version, until then you can keep using the version from git. Once Burn-My-Windows 24 is released, you can simply remove the extension an install it again from extensions.gnome.org! The settings will not be lost.
Thank you so much for rapid response and fix! :heart:
Describe the Bug
Some effects have a black rectangle around the effect, it looks like it's missing alpha, does not happen for maximized windows, happens in both Wayland and Xorg
Effects affected:
This does not happen in virtual machine (GNOME Boxes) with disabled 3D acceleration
I don't have NVIDIA or any other dedicated GPU
Seems to be similar to #199
Kooha-2023-01-07-15-45-15.webm
Steps to reproduce the behavior:
Some logs (opening/closing nautilus)
System
Hardware