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

Vulkan Mobile: Mesh Flickering in VR on Quest 3 #89985

Closed
szybre opened this issue Mar 28, 2024 · 16 comments · Fixed by #94289
Closed

Vulkan Mobile: Mesh Flickering in VR on Quest 3 #89985

szybre opened this issue Mar 28, 2024 · 16 comments · Fixed by #94289

Comments

@szybre
Copy link

szybre commented Mar 28, 2024

Tested versions

Reproducible in Godot 4.2.1.stable

System information

Windows 10 / Oculus Quest 3 Android OS, XR2 Gen2 processor, Vulkan (Mobile) renderer

Issue description

After a couple of seconds of the game running natively on Meta Quest 3, all meshes and shadows start flickering. This issue wasn't happening before disabling glow in the WorldEnvimoement node, which increased FPS. Further performance optimizations, like baking the lights, seemed to have worsened the problem. I suspect the more FPS the game runs on, the faster and worse it glitches.

Com.Tribalrealms.Projectviolet-20240328-135541.mp4

Steps to reproduce

Download the demo included below and export it for your Quest device
The bug should occur on its own after a little bit of time

Minimal reproduction project (MRP)

The file is too big for GitHub, so I had to share it through Google Drive
https://drive.google.com/file/d/1C3jSADayxaEMJkqjGh7-FmBzPASskql_/view?usp=sharing

This is the most basic Godot VR project with the ability to export for the Quest family of devices. Inside you can find a lot of stacked cube meshes that demonstrate very well these artifacts.

@AThousandShips
Copy link
Member

Can you please try in 4.2.2.rc2?

@szybre
Copy link
Author

szybre commented Mar 28, 2024

The bug still appears after re-exporting the game using 4.2.2.rc2

com.TribalRealms.ProjectViolet-20240328-175818.mp4

@Psychophylaxis2
Copy link

I can confirm this issue. I get the same effect on Quest 3 in my application. It appears to get worse as more complex meshes are added to a scene.

@aloiscochard
Copy link

aloiscochard commented Apr 15, 2024

I can also confirm this issue. I tried different rendering pipeline without seeing any difference, also note that the flickering is getting worse (or it is simply more noticable?) when using passthrough.

@BStbck
Copy link

BStbck commented May 30, 2024

I have the same problem on Quest 3 with the mobile renderer using Godot 4.2.2. For me the problem completely disappears when switching to the compatibility renderer.

@Calinou Calinou changed the title Mesh Flickering in VR Vulkan Mobile: Mesh Flickering in VR May 30, 2024
@Calinou Calinou changed the title Vulkan Mobile: Mesh Flickering in VR Vulkan Mobile: Mesh Flickering in VR on Quest 3 May 30, 2024
@eelcor
Copy link

eelcor commented Jun 16, 2024

Any progress on this topic? It is also apparent in 4.3 beta 1. It seems to get worse when using large meshes. In the forums the flickering is also mentioned. https://forum.godotengine.org/t/grey-flickering-in-vr-on-quest-3/54447

Any thing I can do?

Kind regards,
Eelco

@Psychophylaxis2
Copy link

I can confirm the issue remains on Godot 4.3 Beta 2 with the 3.0.0 Beta2 vendor library and visible in the OpenXR Tools Demo scenes. Quest 3 firmware 67.0.0.458.356.614892285

@RevoluPowered
Copy link
Contributor

RevoluPowered commented Jul 3, 2024

Reported to meta as I am having the same issue, godotengine dev chat discussions have revealed the most likely cause is a driver issue.

https://communityforums.atmeta.com/t5/Quest-Development/Standalone-Vulkan-in-headset-not-working-correctly-Huge/m-p/1213491#M10147

The forum thread there contains an APK which I have uploaded which can be used for testing as it has debug enabled. I confirmed that the vulkan frame information is good by opening renderdoc and connecting it, the corruption is not present in the renderdoc frame, so likely its someone at facebook that needs to help us.

@szybre
Copy link
Author

szybre commented Jul 3, 2024

Great that this issue is known, but as long as it exists, making oculus games is impossible.

@RevoluPowered
Copy link
Contributor

RevoluPowered commented Jul 3, 2024

The driver issue is flagging a warning every time the flickering occurs, it looks like the same frequency

Android 19421 20:48:20 vk_core.cpp(4739) Warning [0] The following warning was triggered: VKDBGUTILWARN003. Please refer to the Adreno Game Developer Guide for more information: https://developer.qualcomm.com/sites/default/files/docs/adreno-gpu/snapdragon-game-toolkit/learn_guides.html

VKDBGUTILWARN003 | Renderpass is not qualified for multipass due to a given subpass

Taken from the meta quest render doc app.

I am working on solving this problem, I am installing the snapdragon tools as per the manual here it recommends this because I can find the sub pass specifically that is failing.

Relevant docs are here:

I am working on this for the mirror right now and hope I can find a fix for the problem if I can I'll submit a PR and a patch to unblock things.

@GaelFG-Anderon
Copy link

@clayjohn I just tried a an export based on your pull request on my 'true' full scale project and the improvement on quest3 is amazing even with the passthrought activated (where there was a lot of flickering, even more than with pure vr rendering) :

gifts_snowball_mr_quest3test_2024_07_15.mp4

Comparaison with nearly identical project state on godot 4.3.beta2 :

com.oculus.vrshell-20240712-222517.mp4

Thanks a lot and congrats to all of you by the way, I followed some conversations and this bug seems very obscure :p
I will made more extensive testing and will report if some glitches are still spotted.

@eelcor
Copy link

eelcor commented Jul 16, 2024 via email

@clayjohn
Copy link
Member

Does this mean the "fix" will be applied to the next beta/release candidate? It would be great!

That's the plan! We would like to include this fix in RC1

@akien-mga akien-mga added this to the 4.3 milestone Jul 17, 2024
@eelcor
Copy link

eelcor commented Jul 27, 2024 via email

@akien-mga
Copy link
Member

@eelcor It is, see https://godotengine.github.io/godot-interactive-changelog/#4.3-rc1

Use a spec constant to control whether the MultiMesh branch is used in the vertex shader (GH-94289).

@juntaosun
Copy link

juntaosun commented Sep 20, 2024

@clayjohn I just tried a an export based on your pull request on my 'true' full scale project and the improvement on quest3 is amazing even with the passthrought activated (where there was a lot of flickering, even more than with pure vr rendering) :

gifts_snowball_mr_quest3test_2024_07_15.mp4
Comparaison with nearly identical project state on godot 4.3.beta2 :

com.oculus.vrshell-20240712-222517.mp4
Thanks a lot and congrats to all of you by the way, I followed some conversations and this bug seems very obscure :p I will made more extensive testing and will report if some glitches are still spotted.

How did you implement AR blending in Quest3 ? For reference, but the array return is [0]

Quest3:

	var interface = XRServer.find_interface("OpenXR")
	if interface and interface.is_initialized():
		var modes = interface.get_supported_environment_blend_modes()
		print(modes)   # [0]   

I refer to the documentation code for 4.3: switch_to_ar ()
https://docs.godotengine.org/en/4.3/tutorials/xr/ar_passthrough.html

Can you provide some guidance and advice?

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