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

Screen Artifacting when reading from hint_screen_texture in 3d with Vulkan Mobile Renderer #88786

Closed
JD-The-65th opened this issue Feb 24, 2024 · 10 comments · Fixed by #91480
Closed

Comments

@JD-The-65th
Copy link

JD-The-65th commented Feb 24, 2024

Tested versions

Reproducibility is weird.

In 4.0 all the way to 4.2 dev 1 (4.2 dev 2 untested because it crashed immediately on my pc), the issue can't be reproduced.

In 4.2 Dev 3 and later, the issue gets seen, but it's weird. It's like a config setting gets set because in one of the versions I tested, I swear I could see the issue reproduced in 4.1, but I can't reproduce it in 4.1 again.

System information

Godot v4.3.dev3 - SteamOS holo - X11 - Vulkan (Mobile) - integrated AMD Custom GPU 0405 (RADV VANGOGH) () - AMD Custom APU 0405 (8 Threads)

Issue description

When using the Mobile Renderer, a screen artifact can be observed when using a spatial shader that reads from hint_screen_texture. Moving the camera, it can be assumed that the screen artifact is clipping another part of the screen onto the artifacted part.

shader_type spatial;

render_mode unshaded;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap_anisotropic;
void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	// Called for every pixel the material is visible on.

	vec3 color_mix = texture(SCREEN_TEXTURE, SCREEN_UV, 1).rgb;
	ALBEDO = color_mix;

}
bug.mp4

Steps to reproduce

  1. Make a new 3d Project using the Vulkan Mobile renderer
  2. Make any spatial shader that uses hint_screen_texture
  3. Observe

Minimal reproduction project (MRP)

reproduction-project.zip

@clayjohn
Copy link
Member

I tested the MRP with 4.2.1 and 4.2-Dev4 and couldn't reproduce in either version.

Have you tested with 4.2.1 or any of the more recent 4.3-Dev builds?

@JD-The-65th
Copy link
Author

JD-The-65th commented Feb 27, 2024

I've tested it with 4.3 dev 2 and 3, and saw the same behavior. I've downloaded all the major builds of 4.* and only saw it occur in 4.2.* and greater. The video also shows the MRP running on Godot 4.2.

Make sure you're using Vulkan Mobile specifically. It isn't observable on Forward+ or Compatibility.

@clayjohn
Copy link
Member

Specs: Godot v4.2.1.stable - Pop!_OS 22.04 LTS - X11 - Vulkan (Mobile) - integrated Intel(R) Xe Graphics (TGL GT2) () - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)

image

Perhaps this issue is unique to your GPU, have you tried updating your drivers?

@JD-The-65th
Copy link
Author

JD-The-65th commented Feb 27, 2024

Change to the Camera3D node's perspective.

This happens on my Steam Deck, and on my Quest 2, so it doesn't seem to be a driver error.

@clayjohn
Copy link
Member

Change to the Camera3D node's perspective.

This happens on my Steam Deck, and on my Quest 2, so it doesn't seem to be a driver error.

image

@clayjohn
Copy link
Member

Could you try the other filter modes, particularly filter_linear_mipmap and filter_linear. I'm wondering if this is an issue with anisotropic filtering on the devices you have tested

@JD-The-65th
Copy link
Author

It dissapears when I use filter_linear on my steam deck. My Quest head strap broke, so I'm just gonna use my phone to test on a similar platform.

@JD-The-65th
Copy link
Author

Same on my Samsung S21;
Godot v4.2.1.stable - Android - Vulkan (Mobile) - integrated Adreno (TM) 660 - (8 Threads)

@JD-The-65th
Copy link
Author

Something interesting is that mipmaps also cause the same exact issue, at least on my steam deck and on my phone.

@clayjohn
Copy link
Member

clayjohn commented Feb 28, 2024

I think that this might be the same issue as #88585 I'll test that issue now too and see if I can reproduce it

Edit: I can't reproduce #88585 on this device either, so I bet its the same issue. I'll test on another device

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.

2 participants