TheGameCreators / AGKRepo

New Home of AGK Source Code for 2024 and Beyond
18 stars 17 forks source link

OpenXR and AppGameKit #16

Open CounterParry opened 5 months ago

CounterParry commented 5 months ago

Is anyone interested in developing native VR or AR games for the Meta Quest using AppGameKit? I've started working on making this possible, especially since the older AGK2 VR plugin didn't support Android. And being a C++ programmer with access to this repo is like having superpowers. =)

I've been focusing on integrating OpenXR with AppGameKit. I used this repository and added a new command: "GetGraphicsConfig," which allows access to the pointers of the core of the OpenGLES renderer. Other then that, AGK appears to already have all the other features needed for OpenXR. Possibly due to the older VR plugin or the Google AR commands? (I don't think TheGameCreators should commit my new command yet, I am not sure how it would affect successful compile on other platforms then Android.)

By introducing just this single command, which just returns a few pointers, OpenXR can function with AGK without introducing any unnecessary bloat. So no need adding the OpenXR libraries into AGK.

So far, I have a mostly working Tier 2 template. It’s a converted OUYA template. It renders 3D objects correctly on my Meta Quest 2. I can move around and use the controllers. The only features not working are AGK's print command and the 2D components, though I’m not sure why you would use these in VR anyway. (I haven’t tested sound yet, but I see no reason it shouldn’t work.)

I've forked a repository where I've added the new command, and I plan to upload a Template_Android_OpenXR to it soon. It needs some cleanup since it currently contains a lot of extra and unnecessary code I used for debugging.

I believe OpenXR will be a significant addition to AGK. It's great for future-proofing AGK’s presence in VR/AR. Moreover, there are few options available for programmers looking to create VR games purely with code. OpenXR has become the standard across the VR industry, and Meta now requires all new apps to use it. Perhaps The Game Creators can eventually use this to market a new VR Plugin for AppGameKit Studio—potentially even supporting Apple’s new VR headset in the future.

Anyway posting this now incase The Game Creators see I forked off of their repo and added an odd command to the renderer.

Cheers, Parry

ghost commented 5 months ago

Hi, I don't use meta quest at the moment but the project sounds really interesting and I'm sure it will be of interest to other AGK users.

CounterParry commented 5 months ago

Added/Updated Template_Android_OpenXR to my branch of the repo. I will continue to update it. The SetPosition and Set Rotation commands not yet working. Commands for movementX/Y/Z and rotationX/Y/Z do work. AGK::Print command working by using render2image, and placing that image on plane. I assume 2d commands, like sprites, would work with the render2image too.