Description
For smartphone-based AR, the underlying device may support a choice of focus modes. For example, ARCore has a selectable focus mode with a choice of FIXED
or AUTO
.
Currently, WebXR doesn't have a way to express such a preference, and this can lead to problems in specific use cases, for example:
google/model-viewer#2470
If I'm understanding it right, ARCore's default is a fixed-focus mode since that allows more accurate tracking, for example many camera lenses have a "focus breathing" effect where the field of view changes slightly as focus is being adjusted. However, this isn't a good fit for some scenarios such as marker tracking close to the camera.
Would it make sense to add a way for apps to express their preferred focus mode, and/or making it configurable at runtime? This also seems applicable for AR headsets or other use cases that may be using a camera view with a choice of focus modes.
There's a few options here:
-
let devices make their own choice with no user override, for example always enabling autofocus even if that degrades some use cases, or vice versa for fixed focus
-
add XRSessionInit features with "fixed-focus" and "auto-focus" options
-
add a XRSession
setCameraFocusMode(x)
method, with enum valuesfixed-far
,fixed-near
,auto
or similar? This would be a hint to the runtime where it would choose the most appropriate corresponding supported value. -
use the
depthNear
anddepthFar
attribute to infer at which range the app expects to be doing interactions? This seems a bit too magical since applications typically just pick fairly arbitrary values for these. -
automatically turn on autofocus if features are in use that are likely to benefit from it, for example
marker-tracking
? This could have the unintended side effect that people may turn on a feature just to change the focus mode if this appeared to help in their specific use case. -
more complicated options such as a per-camera setting for devices with multiple cameras?
Do people have preferences in this area, and would it also apply to non-AR use cases involving cameras?