GodotVR / godot-xr-template

Godot XR Template project containing needed plugins, XR Tools and a very simple demo game
MIT License
130 stars 15 forks source link

Swapchain issues #23

Open ClonedPuppy opened 11 months ago

ClonedPuppy commented 11 months ago

Hi, wanted to check this out to see how things are wired up for working in XR. Unfortunately I arbitrarily get a black viewport, more often that not. Looks like it's an issue of setting up the swapchain?

Here's what's in the log:

OpenXR: XR started (focused_state) OpenXR: failed to release swapchain image! [ XR_ERROR_CALL_ORDER_INVALID ] OpenXR: failed to release swapchain image! [ XR_ERROR_CALL_ORDER_INVALID ] OpenXR: failed to acquire swapchain image [ XR_ERROR_CALL_ORDER_INVALID ] OpenXR: No viewport was marked with use_xr, there is no rendered output! OpenXR: failed to acquire swapchain image [ XR_ERROR_CALL_ORDER_INVALID ] OpenXR: No viewport was marked with use_xr, there is no rendered output! OpenXR: failed to acquire swapchain image [ XR_ERROR_CALL_ORDER_INVALID ] OpenXR: No viewport was marked with use_xr, there is no rendered output! ---- cut. Continues until XR Ended, about 4000+ lines of above spam.

Running on a Quest Pro (57.0.0), cloned the xr-template as is without any modifications in the code. Builds successfully. Works as expected about 1 out of 10, or somewhere in that region.. hard to pin down.

Grateful for any feedback, perhaps just the state of XR on godot 4.1.1 Stable?

BastiaanOlij commented 11 months ago

Hmm, it's running fine on my Quest Pro but I've had issues running on Godot 4.2 but haven't been able to investigate it as the logging system is broken. May be the same issue.

I'm assuming this is running under Vulkan Mobile, not the compatibility renderer?

ClonedPuppy commented 11 months ago

Yes, sorry for not being clear about that. Mobile renderer, that's correct. I wish I could give more details, but as I'm quite new on Godot, I'm still trying to wrap my head around things and how they work. In any case, I will keep an eye on the issue. I'm developing on .net so I'll be using desktop XR until there is support for Android export, so it's not of vital importance for me. Just thought I'd log it in case someone else has the same issue.

BastiaanOlij commented 11 months ago

Someone pointed out to me that it's also logging:

OpenXR: No viewport was marked with use_xr, there is no rendered output!

Did you add the startup code that enable the XR mode on the main viewport? Without that it wont be sending images to OpenXR and that might be causing it to trip up, see also: https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html#setting-up-the-xr-scene

ClonedPuppy commented 11 months ago

No I did not.. I asumed(wrongly?) the template had all that covered, so I basically just installed the android export template and the openXR plugins. and pressed build/export. But as I mentioned, it does work sometime, especially when starting the template build from the editor. Seems a installed apk works less reliably.

adammikulis commented 10 months ago

I have been having that issue as well with 4.2 dev builds, the template apk ran just fine on my Quest Pro before that but now it just launches a small black rectangle. It really shouldn't take any manual work from you, it's all setup already (from what I remember I didn't have to make any script changes). I haven't tested any of the more recent builds (I think it was dev1/dev2) so this may be resolved but it's definitely not just you.

ClonedPuppy commented 10 months ago

I recently watched a VR prototyping video from Snopek, and he kept running into the same issue that I do. It seems it's a known issue though(?), so hope they get it fixed before 4.2 stable.

Here's the link to the timecode of the video.

fisher2470 commented 2 months ago

I was running into the same issue, but adding the initialization script from the tutorial as a plugin in autoload, rather than attaching it to the root node of the scene resolves the error:

image