Flashing Model with Face Anchor

Hello. I’m working on a project where on entry I would like for a user to be able to swap between a back camera view where they can manipulate a 3D object and a front camera view where that same 3D model is anchored to the top of their head.

To achieve this so far, I’ve made a project based on the Swap Camera Settings sample application. The application starts with an a-scene using xrweb and switches to xrface when a button is pressed. The application is mostly working except that when I am using the front camera, the face anchored model flashes rapidly giving a strange appearance.

Does anyone know what might be happening here? Below is the code I am using to add the face anchored model for the front camera view. I am happy to provide any more code if it would be helpful but didn’t want to make this initial post too big.

const faceanchor = document.createElement("xrextras-faceanchor")

const entity = document.createElement("a-entity")
entity.setAttribute("gltf-model", "#sandCastleModel")
entity.setAttribute('scale', '.5 .5 .5')
entity.setAttribute('position', "0 .8 0")

scene.appendChild(faceanchor)
faceanchor.appendChild(entity)

The same can be observed with the playground sample Three.js: Swap Camera | 8th Wall Playground | 8th Wall under version β€œ8th Wall XR Version: 26.0.6.150s”. The engine keeps generating consecutive found and lost events, hence the flicker.

Interesting observation - when running the sample with initializing the face controller pipeline first, then the glasses do not flicker.

1 Like

Hi @Dylan_null @Sven_Pleyer, thank you both for the report. The team is actively looking into this issue, I will update this thread with any updates.

1 Like

any updates on this issue?

Hi @Evan. Has there been any progress from the development team looking into this issue? In addition to how the Swap Camera Settings sample code handled the swap, we have also tried clearing all the modules using clearCameraPipelineModules in our app, and then re-adding all necessary pipeline modules before restarting XR8, but to no avail.

We also tried to β€œignore” lost events and only proceed to hide the object when a specified amount of time elapsed since the last update event. Unfortunately, the difference in time can be anywhere up to half a second and makes this route not really feasible.

Also, we really would like to know if there is a work-around should an actual fix not be available any time soon. The app experience with this behavior is cringy and shows a lack of professional polish. We have been holding off publishing our app because of this issue and we need to know what to tell our client.

Thanks.-