"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Video background in VR

Hi all,

I'm trying to get a video background in a VR app. To accomplish this I tried to use the ARVR sample app and modified it a bit so that the texture in the VR activity would be the video camera background like in the AR activity. Unfortunately, this doesn't work as aspected. The sample app crashes in the renderVideoBackground method at

GLES20.glVertexAttribPointer(vbVertexHandle, 3, GLES20.GL_FLOAT, false, 0, vbMesh.getPositions().asFloatBuffer()); 
GLES20.glVertexAttribPointer(vbTexCoordHandle, 2, GLES20.GL_FLOAT, false, 0, vbMesh.getUVs().asFloatBuffer());

because the vbMesh positions and uv's are empty. The same code does work however when the app uses an AR activity. I made sure that the matrices are correct, the GLTextureUnit is set and passed to Renderer.getInstance().updateVideoBackgroundTexture(tex) and that the correct viewId is passed to the renderVideoBackground method.

Anyone encountered this as well or is this what I'm trying to do not possible? 

ronaldvanduren

Tue, 06/28/2016 - 15:07

I solved it myself. It turned out I forgot to change the videomode variable to  Device.MODE.MODE_AR when in VR