CameraTexture on WEBar

Hallo to everyone,
i have tested an experience with a CameraTexture script on the app and it works.
It does not work on WebAR.
Any advice on it?
Thanks
Luca

Hay @lucalilli I have a email in to the Zappar guys about this as well. They are looking in to it still.

1 Like

Ok thank you so much!
Regards
Luca

Hi Luca,

I’ve just replied to Steve directly but thought I’d post it here as well.

Camera Texture snapshots are working in the Zappar app and I believe this is because in the apps we have RGB data from the camera, so it’s easy to just upload that again to another texture. On the web it works a bit differently (browser does the upload to a texture in a more opaque way) so I don’t think we’ve exposed or implemented the necessary code take a snapshot of the camera texture in this case.

One workaround you could try is temporarily hiding all the content you don’t want to be shown on the camera texture snapshot and use:

const texture = Z.DataTexture();
Z.device.snapshotToTexture(texture, () => {
myPlane.skin(texture);
});

This will take a snapshot of all the elements in the scene at that time and assign it to a plane material, rather than just the camera feed, hence the need to hide some content first. You can hide / show the content with a Z.after().

Hope this helps.

George

2 Likes

Thank you George! I thought it was impossible in WebAr!
Great!
Marco