godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.17k stars 21.2k forks source link

[XR][GODOT4.3] godot4.3 openxr doesn't run properly on steamvr, it doesn't render, but the camera can be controlled! #98817

Open RubyKiss opened 1 week ago

RubyKiss commented 1 week ago

Tested versions

v4.3.stable.mono.official [77dcf97d8]

System information

Windows 11 Godot v4.3.stable.mono.official [77dcf97d8] Vulkan Forward+, PICO VR NEO3, INTEL ARC A770 GRPHICS CARD

Issue description

c# code

using Godot;
using System;

public partial class Main : Node3D
{
    private XRInterface _xrInterface;

    public void OnStart(){
        GD.Print("SESSION START");
    }

    public override void _Ready()
    {
        base._Ready();
        _xrInterface = (OpenXRInterface)XRServer.FindInterface("OpenXR");
        if(_xrInterface != null && _xrInterface.IsInitialized())
        {
            _xrInterface.Connect("session_begun",new Callable(this,"OnStart"));

            GD.Print("OpenXR initialized successfully");

            // Turn off v-sync!
            DisplayServer.WindowSetVsyncMode(DisplayServer.VSyncMode.Disabled);

            var vp = GetViewport();
            // Change our main viewport to output to the HMD
            vp.UseXR = true;

            var camera = GetNode<XRCamera3D>("World/XRPlayer/XRCamera3D");

            if (RenderingServer.GetRenderingDevice() != null){
                GD.Print("render "+vp.UseXR.ToString());
                // vp.VrsMode = Viewport.VrsModeEnum.XR;

            }
            else if ((int)ProjectSettings.GetSetting("xr/openxr/foveation_level") == 0)
                GD.PushWarning("OpenXR: Recommend setting Foveation level to High in Project Settings");

        }
        else
        {
            GD.Print("OpenXR not initialized, please check if your headset is connected");
        }
    }
}

I would like to ask after creating a basic openxr environment in godot4 and opening it in steamvr, it stays on the waiting screen, then I find an error on steamvr , it goes like this

Failed to create sync texture. Ensure application was built using DXGI 1.1 or later (i.e. Call CreateDXGIFactory1).!!!! ComposeLayerProjection: failed to submit view 0: VRCompositorError_SharedTexturesNotSupported

What should I do to fix this?

Steps to reproduce

the code is from offical docs: https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html

Minimal reproduction project (MRP)

xrtest.zip

output:

Godot Engine v4.3.stable.mono.official.77dcf97d8 - https://godotengine.org
OpenXR: Running on OpenXR runtime:  SteamVR/OpenXR   2.8.6
OpenXR: XrGraphicsRequirementsVulkan2KHR:
 - minApiVersionSupported:  1.0.0
 - maxApiVersionSupported:  1.2.0
Vulkan 1.3.289 - Forward+ - Using Device #0: Intel - Intel(R) Arc(TM) A770 Graphics

OpenXR initialized successfully
BastiaanOlij commented 4 days ago

I think you mentioned this one on Discord before. I'm still stumped by it. I suspect it's either a problem with PICOs desktop streaming (though I know others use it on PICO 4) or a problem with the Intel drivers for the Arc graphics card not supporting required features.

If I recall correctly you tried compatibility as well but ran into the issue that the Arcs OpenGL drivers do not support the multiview extension.

The error itself is coming from deep inside the XR runtime, not from Godot.

I'll see if I can get some information from some of my contacts at Pico/Intel but I'm not sure if I'll get an answer quick.