It seems that the issue with the black screen instead of capturing a screenshot from the AR session might be related to missing XR feature requirements in your Needle Engine setup. To properly capture a screenshot in an AR session in Needle Engine, it is essential to request the camera access XR feature. You can achieve this by ensuring the following:
WebARCameraBackground Component: Add the WebARCameraBackground component to your scene or specify camera permissions in your session request setup (see the documentation).
Ensure XR Session Configuration: Verify that your XR session is properly initialized with the necessary permissions, including camera access. This can typically be done in the NeedleXRSession.onSessionRequestStart event hook (see the documentation).
Correct Usage of screenshot2: Your code calls the screenshot2 with options, which is appropriate, but ensure that the rendering setup allows for XR images to be captured correctly. If screenshot2 is delayed until the correct rendering frame is captured, then it should work correctly (see the documentation) (see the documentation).
To better troubleshoot this issue, make sure you have configured the Needle Engine settings to allow camera access during XR sessions. If you already have this setup, please check if there are any console warnings or errors when running your project. These can give more insights into what might be going wrong.
If you are still having issues, please provide additional details on how your AR session is set up, or consider checking the logs for any XR session-specific errors.
For more details and the latest API references, you may also explore the Needle Engine documentation and WebXR specifications.
If you need further assistance or details, feel free to reach out!
24 replies left thread_Wg5hCZR2E4J6NHmhIcuVyt3I Reply to this message to continue the conversation
Are those UI Image components? And does this happen right away or just after taking a screenshot?
Could you send this as a bugreport?
We noticed some strange behaviour in three.js once camera-access is requested elsewhere (even without ever using it at all) but are still investigating - so it might also be an issue in three. I haven’t seen something like this yet tho so it would be great to get your scene for testing.
It happens as soon I open WebXR, but not on all textures, as you can see the screenshot button is not affected.
Do you want me to share a project with you or just a scene file?
One more question, when I share the screen, my Canvas items are not shared, so if I want to add some watermark or logo it is not shared, is there a way to share canvas items also?
Ah I see, I’ll double check that, if it’s screenspace UI it may indeed not be part of the screenshot right now since that is rendered in a separate render pass. Will get back to you.