6. Rendering

When ARGSession.drawFrame is called, it starts to render video frames with various effects such as item, filter, and beauty. Which effects should be applied is determined by how the ARGear configuration is set.
ARGSession.drawFrame returns ARGFrame as a result, which contains texture id and configured information in ARGInferenceConfig.Feature.
From the application layer, you can draw the effects applied frames easily as the following sample code.
// Sample Renderer Code in Application Layer
ScreenRenderer mScreenRenderer = new ScreenRenderer();
GLView.GLViewListener glViewListener = new GLView.GLViewListener() {
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
mScreenRenderer.create(gl, config);
public void onDrawFrame(GL10 gl, int width, int height) {
ARGFrame frame = argsession.drawFrame(gl, width, height);
mScreenRenderer.draw(frame, ARGFrame.Ratio.RATIO_4_3, width, height);
var screenRenderer = ScreenRenderer()
private var glViewListener: GLView.GLViewListener = object : GLView.GLViewListener {
override fun onSurfaceCreated(
gl: GL10?,
config: EGLConfig?
) {
screenRenderer.create(gl, config)
override fun onDrawFrame(gl: GL10?, width: Int?, height: Int?) {
val localWidth = width ?: 0
val localHeight = height ?: 0
val frame = argSession.drawFrame(gl, ARGFrame.Ratio.RATIO_4_3, localWidth, localHeight)
frame?.let {
screenRenderer.draw(it, localWidth, localHeight)