godotengine / godotengine/godot
Black Background when trying to use pixel perfect transparency
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
I am using, and encountered the recurring issue on the official Godot 4.3.stable build, on compatibility mode.
### System information
Godot v4.3.stable - Windows Version 10.0.22631 Build 22631 - NVIDIA GeForce RTX 3070 Laptop GPU
### Issue description
My native resolution is 1920x1080, and when I set this as the window resolution in project settings, my transparent background turns black. Attempting to screenshot with PrtSc reverts it back to a transparent state, but returns to black afterwards, so I can't attach any screenshots. Changing the resolution to 1920x1079 fixes the issue, but I'm not sure how sustainable it'll be in the long run when adapting to other resolutions since the one pixel gap might become more noticeable.
The project setting window mode is set to Windowed, with Borderless enabled, since fullscreen seems to make the transparent background black.
### Steps to reproduce
In Project Settings > Display > Window > Size, set the Viewport Width and height to 1920 and 1080 respectively, then turn on Borderless, and set the Mode to Windowed. In the same area, enable Transparent, as well as check "Allowed" under Per Pixel Transparency. Then enable Transparent Background in Rendering > Viewport.
Running the main scene shows a black background in place of the intended transparent background.
Reducing the resolution to 1280x720, or comically 1920x1079, restores the intended transparent background.
I assume the fact that my native resolution is 1920x1080 plays an important role in finding the solution.
I'm relatively new to Godot, and using game engines in general, but I hope I provided enough information.
### Minimal reproduction project (MRP)
[planner-project2.zip](https://github.com/user-attachments/files/17969954/planner-project2.zip)
Contributor guide
Research direction
Start with the attached planner-project2.zip minimal reproduction and reproduce the issue in Godot 4.3.stable using Compatibility mode, Windows, a 1920x1080 borderless window, and per-pixel transparency. Compare the 1920x1080 behavior with 1920x1079 or 1280x720; done means the intended transparent background remains visible at the native resolution without relying on a one-pixel adjustment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100