OpenXR's XR_FB_display_refresh_rate extension only returns 60Hz and 72Hz for Quest 2
Built OpenXR SDK 1.1.38 from source, using that for a native Android application using a custom engine. xrEnumerateDisplayRefreshRatesFB only returns 60 and 72 Hz, and trying to request 90Hz using xrRequestDisplayRefreshRateFB returns XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FBSolved1.1KViews1like2CommentsUE5 (.2.1) Had some problems building to Quest (3) and VR Preview: Solved!
Besides the documentation, this is my config which works finally: Download via Android Studio (Tools - SDK-Manager) SDK Platforms (check "Show Package Details"): Android 12L -> Android SDK Platform 32, Sources for Android 32, ARM 64 v8a Android 10 -> Android SDK Platform 29, Sources for Android 29, ARM 64 v8a SDK Tools (check "Show Package Details"): Android SDK Build-Tools 34 -> 32.1.0-rc1, 32.0.0, 29.0.3 NDK -> 25.1.8937393 Android SDK Command-line Tools -> Android SDK Command-line Tools 11.0, 10.0 Android Emulator Android Emulator Hypervisor Driver Android SDK Platform Tools Unreal Engine Project Settings: Android SDK: Min SDK: 29 Target SDK: 32 NDK: 25.1.8937393 (26.x doesnt work) JAVA: JAVA SE 8 (https://www.oracle.com/de/java/technologies/javase/javase8-archive-downloads.html) SDK API Level: android-32 NDK API Level: android-29 SDK Paths: Location Android SDK: C:/Users/[Username]/AppData/Local/Android/Sdk Location Android NDK: C:/Users/[Username]/AppData/Local/Android/Sdk/ndk/25.1.8937393 Location JAVA: C:/Program Files/Java/jdk1.8.0_202 Settet these Paths also in the environment variables ANDROID_HOME, NDKROOT, JAVA_HOME VR Preview: I had problems getting the VR Preview to work. While trying the XR Simulartor, i settet the Environment-Variable "XR_RUNTIME_JSON". Had to remove that, because the path doesnt exist anymore (deleted the MetaXRSimulator-Folder and did not remove this variable) This tool https://github.com/maluoi/openxr-explorer should show the active runtime (oculus). With the wrong environment-variable, openxr-explorer shows "no runtime settet" or something like that. This tool shows errors, if something is wrong Start Oculus Link before Unreal Editor3.7KViews2likes4CommentsHow to correctly use SRGB on Oculus Mobile Native (C++)?
This is a Go+Quest question. I have a Oculus Mobile C++ app forked from the VRCubeWorld_NativeActivity example in the Oculus Mobile native SDK. I hooked in my own code in `ovrRenderer_RenderFrame`, so right after the framebuffer and the eye matrices are set up I call my own rendering code. This rendering code is shared with desktop, it enables `GL_FRAMEBUFFER_SRGB` and it exclusively draws the SRGB color space. I am trying to figure out how to convert VRCubeWorld_NativeActivity from RGB to SRGB. I want the SRGB drawn by my rendering code to be correctly treated by the NativeActivity.cpp's framebuffer and EGL surface. I have found a way that "works" (I see the colors I expect) but I do not know if it is correct. You can see my exact NativeActivity code here (it is open source). What I did: Pass `GL_SRGB8_ALPHA8` instead of `GL_RGBA8` in ovrFramebuffer_Create Set `VRAPI_MODE_FLAG_FRONT_BUFFER_SRGB` in `parms.flags` when we call `vrapi_EnterVrMode`() What I did NOT do— because I tried these things and they had no effect: Call `setEGLattrib(EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR);` after calling `eglCreateContext()` (I think we do this in our glfw version, and it is recommended in a long comment in VrApi_Types.h). Comment out the many `VRAPI_FRAME_LAYER_FLAG_INHIBIT_SRGB_FRAMEBUFFER` lines left over from the sample code. What I need to know: Am I doing something wrong or unsafe, or incurring any penalty (like unnecessary conversions RGB->SRGB and back again) by failing to explicitly set the EGL_GL_COLORSPACE_SRGB_KHR egl attrib? What do the various VRAPI_FRAME_LAYER_FLAG_INHIBIT_SRGB_FRAMEBUFFER flags do? What does this "layer" code (the "black layer" and "loading icon layer") do, and can I safely remove it? (I have removed a lot of the code from the NativeActivity example because I was sure I did not need it, but there are other parts I did not understand so I have left it in. Because there is not really any comments/documentation on the sample code it is hard to tell what is necessary and what Oculus merely left for us as a convenience.)1.9KViews1like2CommentsWhy it seems it's not possible to use CPP in the NDK sources ?
Hi, I am still messing up with code and trying to get my things work. My stuff is entirely done in CPP however I noticed all sources in the NDK samples are plain C-99 .. If I take the VrCubeWorld_Vulkan sample and I try to add to the project a simple "Banana.cpp" file that contains as simple as : #include <stdio.h> #include <stdbool.h> bool InitWorld (void *p) { return true; } Then I modify the Android.mk file as : LOCAL_MODULE := vrcubeworldvk #LOCAL_CFLAGS := -std=c99 -Werror LOCAL_SRC_FILES := ../../../Src/VrCubeWorld_Vulkan.c \ ../../../Src/Banana.cpp \ ../../../Src/Framework_Vulkan.c And then from within I call : extern bool InitWorld (void *p); void android_main( struct android_app * app ) { ALOGV( "----------------------------------------------------------------" ); ALOGV( "android_app_entry()" ); ALOGV( " android_main()" ); InitWorld("Pappinone"); When I try to compile it spews those sort of errors : Build command failed. Error while executing process /home/gilesgoat/Android/Sdk/ndk/20.1.5948944/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/jni/Android.mk NDK_APPLICATION_MK=/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/jni/Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/build/intermediates/ndkBuild/debug/lib V=0 -j4 -C/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android APP_PLATFORM=android-21 NDK_TOOLCHAIN_VERSION=clang APP_STL=c++_static NDK_DEBUG=1 OVR_DEBUG=1 USE_ASAN=1 /home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libvrcubeworldvk.so} make: Entering directory `/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android' [arm64-v8a] Compile : vrcubeworldvk <= VrCubeWorld_Vulkan.c [arm64-v8a] Compile++ : vrcubeworldvk <= Banana.cpp [arm64-v8a] Compile : vrcubeworldvk <= Framework_Vulkan.c [arm64-v8a] Prebuilt : libvrapi.so <= /home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/jni/../../../../../VrApi/Projects/AndroidPrebuilt/jni/../../../Libs/Android/arm64-v8a/Debug/ [arm64-v8a] StaticLibrary : libandroid_native_app_glue.a [arm64-v8a] SharedLibrary : libvrcubeworldvk.so /home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/objs-debug/vrcubeworldvk/__/__/__/Src/VrCubeWorld_Vulkan.o: In function `android_main': /home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/jni/../../../Src/VrCubeWorld_Vulkan.c:1429: undefined reference to `InitWorld' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libvrcubeworldvk.so] Error 1 make: Leaving directory `/home/gilesgoat/OVR-SDK-Mobile/VrSamples/VrCubeWorld_Vulkan/Projects/Android' If I "transform" all in .cpp gets even worse, it cannot find all the ovrVK... functions. Is any way to "properly MIX" cpp and C in the VRAPI samples or the only solution would be to "confine" all the CPP code into a precompiled lib and call the few needed functions via some C wrapper ? Why the examples do not support CPP ? If that Banana.cpp is renamed in Banana.c all works ( but you can't use CPP stuff in ). Cheers.783Views0likes1CommentAny project template for Android Studio for NDK ?
Hi, I am still not sure how all that works but could be in a future a request for a "Project Template" where you go like "New project -> Oculus NDK" and gives you a "base" to start with ? Clearly Android Studio appears to have support for something like that. Thanks in advance.424Views0likes0Comments