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

Subviewport is duplicating itself when screen shader is used #92058

Open
starblinky opened this issue May 17, 2024 · 0 comments
Open

Subviewport is duplicating itself when screen shader is used #92058

starblinky opened this issue May 17, 2024 · 0 comments

Comments

@starblinky
Copy link

starblinky commented May 17, 2024

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.

Screenshot 2024-05-17 at 12 09 30 PM

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

Screenshot 2024-05-17 at 12 03 00 PM

Shader code:

shader_type canvas_item;

uniform sampler2D tex : repeat_enable;
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap;
void fragment() {

	vec4 noiseTex = texture(tex, UV + TIME * 0.2);
	vec4 mainTex = texture(SCREEN_TEXTURE, SCREEN_UV + noiseTex.r);

	COLOR = mainTex;
}

Create a Noise Texture for the shader:

Screenshot 2024-05-17 at 12 20 13 PM

Minimal reproduction project (MRP)

DuplicationBug for Github.zip

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

No branches or pull requests

1 participant