Closed swantmon closed 6 years ago
Moreover, I have to say that I'm using ARCore within a native activity.
I have created a little example project extending the provided native activity example. It's a fork with a new branch for the native activity using ArCore. If anyone is interested: https://github.com/SchwandtTobias/android-ndk/tree/native-activity-arcore
We're a little confused on this one. At the very least this sounds like a docs bug. Thanks for the repro case - that'll make tracking it down easy.
No problem. Maybe I have missed something very simple. The permission code is crap, but it works for this example. The first time you start the application ArCore has to fail. So, please test the application for granted permissions. Hope to hear from you very soon. Do you have the same result? I'm using a Pixel 2 XL.
Is the texture still showing black after your application is minimized and then maximized again? If it indeed fixes the texture, try to pausing and resuming the AR Session before start drawing.
Btw, do you use AR Core from playstore or from preview from this repo? IIRC it has different version, so maybe it's related with your problem.
Pausing and resuming doesn't help. I have already tried. But I didn't have tested the ArCore lib from the play store (I have used the one from this repo). As soon as I am in the office I will test it.
Okay. I found the bug or my mistake. After resetting my android device I forgot to install the "arcore-preview2.apk". The strange thing is that the provided ArCore example 'hello_ar_c' works perfectly and I got no "AR_UNAVAILABLE_ARCORE_NOT_INSTALLED" error at all.
Thanks for that update. You're right, that is very odd.
I try to render the ArFrame into a render target using OpenGLES 3.2. The ArCore example shows the usage of GLES2 but inside GLES3 the extension is not available. Now I have found the extension GL_OES_EGL_image_external_essl3 to use samplerExternalOES. It seems to be that Unity3D uses the same GLES extension.
My includes and defines:
include "GLES3/gl3.h"
The creation of the texture is similar to the ArCore example:
Inside the rendering loop:
My shaders look like this:
Rendering only the in_UV with out_Output = vec4(in_UV, 0, 1);, the result is a perfectly looking UV texture on the screen. But using the texture, everything is black. The size of the the texture (using textureSize(in_ExtOESTexture, 0)) is zero for both dimensions. ArSession_update(...) is called by the way and the result is AR_SUCCESS. If I try to get image metadata the result is AR_ERROR_NOT_YET_AVAILABLE. ArCore seems to work because the log gives me some information about non-available RANSAC features if I put my finger in front of the camera.
Any idea how to solve this problem?