sceneform-android
sceneform-android copied to clipboard
config.setFocusMode
I am trying to get my google pixel 4a rear camera to auto focus on the marker.
I am not able to focus till i onPause and return to the app. The auto focus works perfectly well.
May i know why didn't it auto focus when i first initiate the camera?
Thanks in advance!
If possible, please attach the Video you showed me
Sure. Please see attached video. https://user-images.githubusercontent.com/69612872/137099811-644805a6-c64d-42e4-a026-6a4fc98affa3.MOV
I had the same issue. Try to call session.resume() in onSessionConfiguration. This works for me:
override fun onSessionConfiguration(session: Session?, config: Config?) {
if (session?.isDepthModeSupported(Config.DepthMode.AUTOMATIC) == true) {
config?.depthMode = Config.DepthMode.AUTOMATIC
}
config?.focusMode = Config.FocusMode.AUTO
session?.configure(config)
session?.resume()
}
In general the auto focus is not really reliable with sceneform. Somethimes you have to wait a few seconds and move your camera back and forth to get the focus on an object. Does anybody know optimizations to get a faster and more reliable focus?
This sounds more like an ARCore issue.
Can you create an issue on the ARCore repo to have more infos about how the autofocus should be configured ?
The FocusMode.AUTO
is already set by default before the session?.resume()
but there seems to have an issue when the 2 calls or done without waits.
Yes. This bug was there when we did ARCore samples, in several device models.
A dirty-hack we did was to start an empty activity and finish it immediately 😉
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.