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

Viewport background transparency not working with environment sky in Compatibility renderer #72602

Open
Tracked by #66458
lostminds opened this issue Feb 2, 2023 · 3 comments

Comments

@lostminds
Copy link

Godot version

4.0.beta17

System information

macOS 13.2

Issue description

The Transparent BG setting on SubViewport makes the background portions transparent in the resulting ViewportTexture as you can see in this example using the Mobile renderer:

Screenshot 2023-02-02 at 14 50 57

However, if you switch to the Compatibility renderer it no longer makes the background transparent.

Screenshot 2023-02-02 at 14 52 24

The issue here seems to be related to the environment, and more specifically background sky rendering. While the background sky is ignored in the Mobile and Forward+ renderer, it seems the background sky is rendered as opaque in the Compatibility renderer. If you remove the WorldEnvironment in the SubViewport (or just remove the sky background) you can see that the viewport correctly renders the background transparent again.

Screenshot 2023-02-02 at 14 53 23

While I don't think it's related to the background transparency I'm also getting this error each time I run this minimum reproduction project, regardless or renderer:

E 0:00:00:0786   setup_local_to_scene: Condition "proxy.is_valid()" is true.
  <C++ Source>   scene/main/viewport.cpp:88 @ setup_local_to_scene()

Steps to reproduce

  • Set up a SubViewport with a camera, a default WorldEnvironment, some mesh (to render something)
  • Turn on Transparent BG on the SubViewport to make the background transparent
  • Set up a UI scene with a TextureRect to render the ViewportTexture of the SubViewport
  • Observe that the background is transparent on Mobile and Forward+ rendrerers
  • Switch to Compatibility renderer
  • Observe that the default sky is now rendered in the viewport background, and the background is not transparent.

Minimal reproduction project

viewport_background_test.zip

@snoopdouglas
Copy link
Contributor

snoopdouglas commented Apr 28, 2023

I'm also getting the "proxy.is_valid()" is true error when working with subviewports, though this is on Forward+.

^ this was fixed in #75751.

@LRFLEW
Copy link
Contributor

LRFLEW commented Jul 11, 2023

I encountered this bug in my project (luckily it was easily worked around), so I can confirm this still exists with Godot 4.1 (tested on Windows 10 22H2)

@RemotelyHuman
Copy link

I've encountered this bug in my project. Godot 4.2.2 on Windows 10 22H2.

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

No branches or pull requests

6 participants