How to access a RenderTarget Texture ID in an XRInterfaceExtension
Asked Answered
Z

5

0

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

Zimbabwe answered 4/5, 2023 at 17:27 Comment(0)
A
0

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

Abstention answered 4/5, 2023 at 19:38 Comment(0)
Z
0

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 ...

Zimbabwe answered 4/5, 2023 at 20:17 Comment(0)
A
0

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

Abstention answered 4/5, 2023 at 22:0 Comment(0)
A
0

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.

Abstention answered 4/5, 2023 at 22:55 Comment(0)
Z
0

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.

Zimbabwe answered 5/5, 2023 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.