You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproducible in v4.2.2.stable.official [15073af] and v4.3 -dev6 beta
System information
Mac OS Sonoma 14.4.1 (23E224)
Issue description
When using a screen-shader in a SubViewPort there is a double image. The SubViewPort will draw the original texture (pre-shader) and then draw AGAIN with the shader effect on top.
If you select "Transparent Background" the original texture (pre-shader) no longer shows. But now the background is no longer transparent. I can work around this by setting the grey colour alpha to 0 within a shader, but this isn't ideal solution for me.
Thank you for your report. I have tested locally and confirmed that this is the expected behaviour for what you are doing.
Screen reading textures simply copy the screen below them. When you use them to draw, they are just drawing over top the thing they just copied. Godot doesn't clear the area underneath.
When you use an opaque viewport with this shader you can obscure the old texture with the background color. But when using a transparent background, it is more obvious that the second sprite is simply drawing over the first sprite.
If you change your background to something other than flat gray, you would notice this same problem even using an opaque viewport.
Based on your description, it sounds like what you actually need is a second Viewport. Instead of using a screen reading shader you can pass the results of the Viewport to a custom shader using a ViewportTexture.
Tested versions
Reproducible in v4.2.2.stable.official [15073af] and v4.3 -dev6 beta
System information
Mac OS Sonoma 14.4.1 (23E224)
Issue description
When using a screen-shader in a SubViewPort there is a double image. The SubViewPort will draw the original texture (pre-shader) and then draw AGAIN with the shader effect on top.
If you select "Transparent Background" the original texture (pre-shader) no longer shows. But now the background is no longer transparent. I can work around this by setting the grey colour alpha to 0 within a shader, but this isn't ideal solution for me.
Steps to reproduce
Shader code:
Create a Noise Texture for the shader:
Minimal reproduction project (MRP)
DuplicationBug for Github.zip
The text was updated successfully, but these errors were encountered: