13. ARCore Connect API

ARCore can be connected and used with ARGear. Once connected with ARGear, you can use both ARCore and ARGear functions such as items, beauty, and bulge.

For the details of ARCore, please refer to “https://developers.google.com/ar/develop".

13.1 Configuration Settings

Additional settings are required after "1. Configuration Settings" step as below.

In order to connect with ARCore, argear-renderer.aar instead of argear.aar needs to be used.

<build.gradle settings>
defaultConfig {

    minSdkVersion 24
}

dependencies {
   implementation "com.google.ar:core:1.17.0"
   implementation "de.javagl:obj:0.2.1"
   implementation (name: 'argear-renderer', ext: 'aar')

}
<AndroidManifest.xml settings>
<application>
   ...
    <meta-data
        android:name="com.google.ar.core"
        android:value="required" />

</application>

13.2 Session Creation and Execution

Both the ARGSession and ARCore Session need to be created and executed together. For the ARGSession, please refer to chapter 3. ARGSession.

Sample code for Session creation and execution is written below.

13.3 Rendering

In order to draw a resulting frame, ARCore session update must be called in advance and the texture ID used for the update should be fed to ARGear. Moreover, mesh vertices and matrix obtained from ARCore session should be fed to ARGear.

Once ARGSession.drawFrame is called, rendering starts with fed information from ARCore. If Item, Filter, or Beauty is set (Reference: 8. Set Contents), the effect will be rendered together with the ARCore frame and ARGFrame will be returned as the result.

The ARGFrame contains the final rendered texture ID and you can draw the frame on screen using this texture ID.

Below is a sample rendering code.

13.4 Set Contents

Please refer to the chapter 8. Set Contents.

Last updated

Was this helpful?