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

Incorrect transparency of ViewportTexture #49502

Closed
versenyi98 opened this issue Jun 11, 2021 · 1 comment
Closed

Incorrect transparency of ViewportTexture #49502

versenyi98 opened this issue Jun 11, 2021 · 1 comment

Comments

@versenyi98
Copy link

Godot version

4.0.dev (9539e4e)

System information

Ubuntu 18.04, Vulkan

Issue description

I'm trying to display a ViewportTexture to a MeshInstance. The viewport has transparent background enabled, and the MeshInstance material's transparency is set to Alpha.

Expected result:
The texture's background is transparent.
Actual result:
The texture's background is black.

Setting the blend mode to 'Add' sets the background to transparent, but the rest of the texture also gets slightly transparent. My assumption is that the ViewportTexture's alpha channel is not set correctly - even though the background is set to transparent - , which would explain why it the background is only transparent with additive blend mode.

image

Steps to reproduce

  1. Create a PlaneMesh
  2. Create a SubViewport
  3. Set transparent background to the viewport
  4. Add a 3D scene as child to the viewport
  5. Set the albedo texture of the plane's material override to the viewport's texture

Minimal reproduction project

minimal.zip

@Calinou
Copy link
Member

Calinou commented Jun 11, 2021

Duplicate of #40651.

Setting the blend mode to 'Add' sets the background to transparent, but the rest of the texture also gets slightly transparent.

This is because the Add blend mode does not require an alpha channel to look transparent. Black pixels will be fully transparent, and white pixels will be fully opaque.

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

2 participants