Hi everyone,
I’m trying to achieve a transparent window in Unity on Linux, where the background is fully transparent but GameObjects (e.g. 3D characters or UI elements) remain visible — similar to how it works with Allow Transparency on Windows.
I’m running Unity under XWayland on KDE (KWin), and I’ve tried various combinations:
• Set camera background to color with alpha = 0
• Tried using URP and Built-in RP
• Disabled post-processing, anti-aliasing, and used minimal setup
• Built with borderless window and no decorations
No matter what I do, the result is always the same:
GameObjects render correctly
Background is rendered as solid black, not transparent
It seems like Unity’s Linux build does not request an alpha-capable framebuffer, or the X11 window is created without any transparency flags (like using ARGB visuals or _NET_WM_WINDOW_OPACITY). Other engines like Godot are able to display true transparent windows under the same environment, so it doesn’t seem to be a platform (X11/Wayland) limitation.
Is there any supported way in Unity to create a transparent window on Linux with visible scene content (GameObjects), under XWayland/KWin?
If not, are there any workarounds (e.g. native plugins, low-level hacks, flags)?
OS: EndeavorOS / Wayland(X11) / KDE Plasma
I tried 2022 LTS and 6.0
Curiously, these “transparent background” questions have come up several times in recent weeks. It does make me wonder where these come from, is this a new hype thing? What’s the use-case for this?
I can’t recall anyone getting any response. Just setting Camera background won’t achieve this because this doesn’t affect the window’s rendering which is still opaque. On Windows, you have to mingle with the Win32 API in some way and I suppose for Linux it’s just the same. You have to make the Window transparent, and Unity doesn’t expose any methods to do so so you have to resort to hacking this through the OS APIs.
It probably does not relate to the issue but worth mentioning that Unity is supported only on Ubuntu 22 and 24. All other Linuses are “use at your own risk” and may or may not work properly.
Not sure this is possible but I know Unity build use libSDL and SDL has a function to set the window opacity. So, in theory, it should be possible to make a C/C++ plugin that recover the main window handle and use SDL to set its opacity. This would not work in the editor though, only on builds.
I didn’t try it though, this is all hypothetical.
I’ve found a working solution for achieving per-pixel transparent window background on Linux (X11/XWayland, KWin) — with visible GameObjects rendered correctly on top.
The issue was that Unity does not request an ARGB visual (32-bit depth with alpha) by default, so the alpha channel gets ignored unless explicitly forced.
⸻
How to make it work:
1. Find an ARGB visual (32-bit) using glxinfo or xdpyinfo.
Search for a visual ID that supports 8-bit alpha.
For example: a line like Visual ID: 0x21 with depth 32.
2. Launch your Unity build with this environment variable set:
SDL_VIDEO_X11_VISUALID=0x21 ./YourUnityApp
(Replace 0x21 with the visual ID found in step 1.)
4. In Unity:
– Set the Camera Clear Flags to “Solid Color”
– Set the Camera Background color alpha to 0 (fully transparent)
That’s it — no plugins, native code, or special rendering tricks required.
⸻
Confirmed working on:
• Unity 2022 LTS / 6.0
• Linux under XWayland with KWin compos
Wow. Neat trick. You should mark the thread as Resolved.
May I ask what you’re trying to do with this?
My personal widget game on desktop, if i can name it like this.
Unfortunately, I don’t have the option to test this on other distributions. I hope that if this is useful to someone else and this method doesn’t work for them, they’ll do some digging and implement the solution on other distros. At least I’ve pointed them in the right direction.
( in case you never got an answer) I think a lot of people are switching to linux, seeing the death of win 10 coming in quick. and games that sit on the bottom of your desktop have boomed in popularity recently, think games like “Rustys retirement” or “ropukas island” etc ( a link to some examples on steam here Save 1% on Bottom-Of-Your-Screen on Steam) i am missing my bottomofyourscreen games so much since switching you have no idea! helps me stay focused while programming.