Skip to content
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

Vulkan: transparent_bg property in SubViewport has no effect (not reimplemented yet) #40651

Closed
flomar opened this issue Jul 24, 2020 · 16 comments · Fixed by #61109
Closed

Vulkan: transparent_bg property in SubViewport has no effect (not reimplemented yet) #40651

flomar opened this issue Jul 24, 2020 · 16 comments · Fixed by #61109

Comments

@flomar
Copy link
Contributor

flomar commented Jul 24, 2020


Note: This issue has been confirmed several times already. No need to confirm it further.


Godot version: v4.0.dev.custom_build.3811fb919

OS/device including version: Arch Linux, GeForce GTX 1070Q, Vulkan

Issue description: Enabling the "transparent_bg" property in SubViewport seems to have no effect. The 3D content within the viewport is rendered fine, but the underlying 2D content (ColorRect, TextureRect, etc.) is hidden below a black background. The expected outcome is to have the 3D content rendered on top of the 2D content.

Note: I'm aware 4.0 is anything but stable, so I'm wondering if this really is a bug or some problem with my machine. If anybody could test this, maybe on Windows, I'd highly appreciate it.

Steps to reproduce:

- Node
-- CanvasLayer
--- ColorRect
--- SubViewportContainer
---- SubViewport
----- Node3D
------ Camera3D
------ DirectionalLight
------ MeshInstance [Sphere]
@fire
Copy link
Member

fire commented Jul 24, 2020

@akien-mga akien-mga changed the title [4.0] The transparent_bg property in SubViewport seems to have no effect. The transparent_bg property in SubViewport seems to have no effect. Sep 8, 2020
@lupoDharkael
Copy link
Contributor

The material preview appears with a black background as described here, still reproducible as of 706c38a
image

@MrJoshBowman
Copy link

I'm getting the same issue on MacOS and Godot v4.0, transparent background option does nothing but set the background to black.
image

@Calinou Calinou changed the title The transparent_bg property in SubViewport seems to have no effect. Vulkan: transparent_bg property in SubViewport seems to have no effect (not reimplemented yet) Apr 14, 2021
@Calinou Calinou changed the title Vulkan: transparent_bg property in SubViewport seems to have no effect (not reimplemented yet) Vulkan: transparent_bg property in SubViewport has no effect (not reimplemented yet) Jun 11, 2021
@BenjaminNavarro
Copy link
Contributor

I confirm the bug is still there 92a2380, would be nice if someone could take a look at it

@kalysti
Copy link
Contributor

kalysti commented Nov 8, 2021

Same bug in windows. Just to notice. Transparent BG Option -> Black Background.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 19, 2021

The option does actually work (at least as of 8485d0c), but only if you use 2D. As soon as there is 3D node on scene (or in viewport?), the background is no longer transparent.

@joeyeroq
Copy link

Godot 4.0 alpha 1 and still not resolved, transparent background is a much needed feature.

@CrezyDud
Copy link
Contributor

if there's an environment, the sky is also still rendered (instead of black).

also needs to be done

@SaveToTheADrive
Copy link

SaveToTheADrive commented Jan 25, 2022

Until this is fixed, as a really janky workaround, you can assign a CanvasItemMaterial to the SubViewportContainer, and set its blend mode to "Add". Whatever you're rendering to this viewport will probably look a bit transparent, but it allows you to keep working while using the viewport and also being able to see everything else.

@CrezyDud
Copy link
Contributor

Until this is fixed, as a really janky workaround, you can assign a CanvasItemMaterial to the SubViewportContainer, and set its blend mode to "Add". Whatever you're rendering to this viewport will probably look a bit transparent, but it allows you to keep working while using the viewport and also being able to see everything else.

thanks

@joeyeroq
Copy link

joeyeroq commented Jan 26, 2022

Not a workaround at all. As CrezyDud said, the environment needs to be factored in as well as in part of the alpha when "Transparent Bg" is checked on.
transparent_bg_001
Godot 3 displays correctly.
transparent_bg_002

@djmaesen
Copy link

djmaesen commented Feb 6, 2022

post processing works in my project with a subviewport and a second camera for first person weapon rendering
transparent background doesnt work however
screen

@golddotasksquestions
Copy link

golddotasksquestions commented Feb 18, 2022

transparent_bg kinda works for me (Win, dedicated Nvidea 765M), but SubViewport is also completely broken, so it's really of no use:

subviewport01.mp4

@djmaesen
Copy link

djmaesen commented Mar 1, 2022

just checked it in godot alpha 3
transparent background still doesnt work, post processing does
please fix this in alpha 4

@Calinou
Copy link
Member

Calinou commented Mar 1, 2022

just checked it in godot alpha 3 transparent background still doesnt work, post processing does please fix this in alpha 4

Contributors work on a best-effort basis. As per Godot's MIT license, there is no warranty provided for anything 🙂

@joeyeroq
Copy link

I did a quick test of Chaosus's pr, looks good. Hopefully it will pass all reviews and checks and will be in master and this issue will finally be resolved.
subviewport_transparency_test
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.