Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ARFoundation Preview 17 Published

Discussion in 'AR' started by tdmowrer, Aug 9, 2018.

  1. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Hi folks,

    We published ARFoundation 1.0.0-preview.17 earlier this week. See the changelog here. (Note the last public version was 1.0.0-preview.14.)

    Cheers,
    Tim
     
  2. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    48
    Still no in-editor emulation :(
     
    GoGoGadget, trakloz and rob_ice like this.
  3. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    208
    Hey @tdmowrer! I’m testing out the latest ARFoundation API / ARKit XR plugin. I have the Camera property on the ARSessionOrigin to be the same Camera I have assigned with a ‘screen space canvas’ for my various UI things, and Bad Things happen when the AR system moves the camera.

    The UI canvas jiggles a bit, and the rect region of the screen space canvas is cropped in a bit. Curious if you’ve seen this before…feels like the update order is out of whack since the 2D UI elements are subtly jiggling, but it might be something else because the UI is also cropped-in.

    My workaround right now is to use an entirely different camera for 2d UI than for my AR camera, which is probably less than ideal.
     
  4. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Using a different camera for the 2D UI isn't necessarily a bad idea. It's probably the way I would go. But here's why Bad Things happen in your current setup:

    The default option on the TrackedPoseDriver is to update "Update and Before Render":
    Screen Shot 2018-09-15 at 3.53.43 PM.png
    "Before Render" means it will sample the device pose and update the camera's transform at the last possible moment before rendering. This produces the lowest possible latency and provides the best visual result to make the virtual objects line up with the real world. However, if you draw things in an Update function, then they will lag by a frame. One option is to subscribe to Application.onBeforeRender and do your UI update there.

    But, as I mentioned, a second UI-only camera isn't a bad idea.
     
  5. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    208
    Thanks Tim, that's very interesting. Is the 'low latency rendering' something new to the XR API integration? (Does that not update the same/as efficiently in the ARKit plugin on bitbucket? )

    Also, how would I do an update in the way you mention on a UI Canvas? Is there something similar to Camera.Render() on a disabled camera that exists for a Canvas? I saw Canvas.ForceUpdateCanvases, but that's probably not the update loop I'm looking for.
     
  6. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    It's not really low latency rendering, it's just that the camera's position and orientation is updated at the last possible moment before rendering, providing low latency pose information.

    On rereading your question, I'm not sure I fully understand the problem, so I suggest you submit a bug with a small project that reproduces the issue. In the meantime, if using a second UI-only camera works for you, then I would go with that.
     
  7. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    208
    I'll use a second camera for now, but there are reasons why I might want to use the same camera as the AR Camera in the future. Submitted a super simple bug report, case # 1082782 , that uses ARFoundation's SampleScene.unity and just adds some canvas elements.
     
  8. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Just downloaded it to have a play around, same issue as on github - black screen issue. Tried rolling back ARCore and Foundation to 16, still just a black screen. Nokia 7+.
     
  10. trakloz

    trakloz

    Joined:
    Jul 23, 2017
    Posts:
    14
    Same here on Pixel... Has someone figured it out?