GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
90 stars 19 forks source link

Add meta scene capture api support #53

Closed m4gr3d closed 9 months ago

m4gr3d commented 10 months ago

Follow-up to the discussion in https://github.com/GodotVR/godot_openxr_loaders/pull/40#issuecomment-1764112489 about migrating Migeran's implementation of the Meta Scene capture API to the Godot OpenXR Loaders (subject to rename) plugin.

This PR also updates the project to include a godot-cpp and openxr dependencies for use when implementing the OpenXR gdextension.

m4gr3d commented 10 months ago

@kisg @konczg Feedback welcomed!

If this looks good to you, I'll move the PR out of draft state.

kisg commented 10 months ago

@m4gr3d We will check it out, but this weekend is a long weekend in Hungary, we will be back at work on Tuesday.

BastiaanOlij commented 10 months ago

I ran into a problem compiling this:

> Task :godotopenxrmeta:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: error: '../../../../../thirdparty/godot-cpp/bin/libgodot-cpp.android.template_debug.arm64.a', needed by '../../../../build/intermediates/cxx/Debug/4n23k6j1/obj/arm64-v8a/libgodotopenxrmeta.so', missing and no known rule to make it

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':godotopenxrmeta:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\Projects\godot-assets\godot_openxr_vendors\godotopenxrmeta\.cxx\Debug\4n23k6j1\arm64-v8a'

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\mux21\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\Projects\\godot-assets\\godot_openxr_vendors\\godotopenxrmeta\\.cxx\\Debug\\4n23k6j1\\arm64-v8a" ^
        godotopenxrmeta
    from C:\Projects\godot-assets\godot_openxr_vendors\godotopenxrmeta
  ninja: error: '../../../../../thirdparty/godot-cpp/bin/libgodot-cpp.android.template_debug.arm64.a', needed by '../../../../build/intermediates/cxx/Debug/4n23k6j1/obj/arm64-v8a/libgodotopenxrmeta.so', missing and no known rule to make it
BastiaanOlij commented 10 months ago

oh my bad, forgot to initialise submodules, not used to those not being there yet :)

okay, spoke to soon, having issues compiling godot-cpp for Android:

PS C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp> scons platform=android target=template_debug
scons: Reading SConscript files ...
Auto-detected 16 CPU cores available for build parallelism. Using 15 cores by default. You can override it with the -j argument.
Building for architecture arm64 on platform android
ValueError: Required toolchain not found for platform android:
  File "C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp\SConstruct", line 53:
    cpp_tool.generate(env)
  File "C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp\tools\godotcpp.py", line 248:
    raise ValueError("Required toolchain not found for platform " + env["platform"])

Not sure whats going on here as I have no problems compiling Godot for Android, is godot-cpp looking for a specific environment variable or could this be an issue that I upgrade to java 17?

m4gr3d commented 10 months ago

oh my bad, forgot to initialise submodules, not used to those not being there yet :)

okay, spoke to soon, having issues compiling godot-cpp for Android:

PS C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp> scons platform=android target=template_debug
scons: Reading SConscript files ...
Auto-detected 16 CPU cores available for build parallelism. Using 15 cores by default. You can override it with the -j argument.
Building for architecture arm64 on platform android
ValueError: Required toolchain not found for platform android:
  File "C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp\SConstruct", line 53:
    cpp_tool.generate(env)
  File "C:\Projects\godot-assets\godot_openxr_vendors\thirdparty\godot-cpp\tools\godotcpp.py", line 248:
    raise ValueError("Required toolchain not found for platform " + env["platform"])

Not sure whats going on here as I have no problems compiling Godot for Android, is godot-cpp looking for a specific environment variable or could this be an issue that I upgrade to java 17?

@BastiaanOlij This happens when the ANDROID_NDK_ROOT env variable is not defined.

We've moved away from this variable in Godot core, I'll send a PR to godot-cpp to update the logic.

BastiaanOlij commented 9 months ago

Ok, got it all to compile and works, will be playing with it some more

m4gr3d commented 9 months ago

I think we should just merge this, if anything comes up that needs to be perfected that will come out of people playing around with it.

Sounds good to me! I need to update the demo so it doesn't kick-in automatically every time the app launches, and then start a draft for the documentation.

@kisg Any additional feedback?

kisg commented 9 months ago

@m4gr3d

Just would like to add a copyright notice for the source files that we contributed will send a PR on top of this one in a few minutes.

kisg commented 9 months ago

@m4gr3d Opened PR with copyright headers: https://github.com/m4gr3d/godot_openxr_vendors/pull/1

BastiaanOlij commented 9 months ago

Just noticed that we need to improve the .gitignore file, it's including compiled binaries now that we are compiling sourcecode :) On windows it's just excluding .obj but I assume we need more for the other platforms.