Hi everyone,

I am writing an XRInterfaceExtension to support various types of 3D displays.
With Godot3, I was able to retrieve the texture Id from a render_target in the function "godot_arvr_commit_for_eye" using the code uint32_t texid = godot::arvr_api->godot_arvr_get_texid(p_render_target); .
I can then use the texture in a separate OpenGL context.

In Godot4, I want to do the same thing in _post_draw_viewport but I can not find the equivalent function.
I could not find an example in existing XRInterfaceExtensions (WebXR does something similar but relies on classes that do not exist in the godot-cpp API).

Does anyone know how to do that ?

Thanks in advance,

Florent

I'm trying to do the same thing for the Leia Lume Pad (glasses free 3D tablet).

I was told to start looking at the OpenXR plugin, as that seems to have all the hooks for the stereo render. But I haven't figured it out yet.

https://github.com/GodotVR/godot_openxr

Thanks for the answer.

The OpenXR plugin seems to be for Godot 3.x as OpenXR is now in the core with Godot 4, and the API has changed quite a bit between the versions ...

The plug-in might be older, but the idea is the same. The ARVRInterface allows display to stereo devices.

Oh, I see what you're asking now. You have the RID of p_render_target but you want the OpenGL id. That I don't know.

Yes, exactly !

There is a get_render_target_texture(p_render_target) function in XrInterfaceExtension that returns a RID, but this call leads to a "TextureStorage" error at runtime.