Search Unity

Feature Request Deploying AR to WebGL

Discussion in 'AR' started by eco_bach, Mar 1, 2019.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi
    I am being tasked with building an AR portal application that will work on both iPads and the web via a url.

    I was wondering if it might be possible to build using the new AR Foundation framework (which I believe uses both ARCore and ARKit under the hood) to deploy to iOS

    and then export to WebGL for viewing on the web.

    Has anyone tried exporting a AR app to WebGL.
    A search turns up this thread
    https://forum.unity.com/threads/ar-foundation-and-webgl-i-know-its-not-support-just-read.626374/
    but unclear whether AR features are actually retained when exporting to WebGL.

    Can anyone offer feedback?
     
    Last edited: Mar 1, 2019
    makaka-org likes this.
  2. mhartz

    mhartz

    Joined:
    Nov 7, 2014
    Posts:
    1
    Short answer is that you can't. You can use ARJS, where you will need to write the code by hand in threejs or aframe. Another (not free) option would be to use PlayCanvas, which is a web-based tool like Unity. The problem is that tracking is weak and requires a marker. The last option would be to use another framework like 8th Wall, but that costs at least $1350 a month to host but works well and is markerless, however you will still need to program the code in some way whether it is threejs, aframe, PlayCanvas, Sumerian, etc.
     
  3. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    This is something I have wanted to do for a while, I wish it could be done now! ugh
     
  4. Utarastas

    Utarastas

    Joined:
    Jul 27, 2017
    Posts:
    11
    Does anybody know if Unity is working on a solution for WebAR?
     
  5. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Unity supports WebGL on most major browsers on desktops, however it is not supported on mobile devices as there are significant performance constraints. Deploying AR on the web has been a request we've heard from customers wanting to target a larger audience, and many have mentioned WebXR. But the same performance constraints mentioned above apply to AR as well. Further to that, WebXR does not have support for iOS so it's fairly limited at the moment. You may have heard about Project Tiny, a new modular runtime powered by DOTS to deliver small, light, and fast experiences. There may be opportunities to enable AR using that runtime, but there's still a lot of ground to cover before we could make that a reality. So, the notion of deploying AR experiences on the web is something we'll continue exploring, but at this point we don't have any plans to deliver a solution in the near term.
     
    makaka-org, Blarp and ROBYER1 like this.
  6. Mathef

    Mathef

    Joined:
    Jul 3, 2018
    Posts:
    3
    Hopefully, it will be sooner than later :) Using AR content without the need for installing, or downloading anything is crucial for ad campaigns, etc.
     
  7. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    We are working on a WebXR Export package, and we started to implement Unity's XR Management system support.
    But unfortunately Unity's XR SDK doesn't have implementation for WebGL.
    So for now we support the subsystems, there's no way to implement single pass rendering, and for the poses and other feature's the developers need to use custom components.

    More info here https://github.com/De-Panther/unity-webxr-export
    And "How To" video
     
  8. mmuller

    mmuller

    Joined:
    Nov 23, 2010
    Posts:
    92
    Is there somewhere we can signup to be notified of changes regarding web ar and unity webgl/project tiny builds? I have some experience with webgl builds and the wasm exports work well on most modern devices - AR would be a really nice addition too.
     
    newguy123 likes this.
  9. tonialatalo

    tonialatalo

    Joined:
    Apr 23, 2015
    Posts:
    60
    Did you try that WebXR export / integration by Mozilla, in the post above?
     
  10. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Mozilla exporter doesn't support AR and it wasn't update for almost a year.

    But this WebXR Export does support WebXR AR session https://github.com/De-Panther/unity-webxr-export
    but not all the AR related modules at the moment, as some of them are still only experimental and require the user to set flags on the browser.
     
    tonialatalo likes this.
  11. tonialatalo

    tonialatalo

    Joined:
    Apr 23, 2015
    Posts:
    60
    Right - I was referring to this exactly, your version, but got a bit confused that it was from Mozilla, or at least a fork from what they started.

    I'm actually curious if could hook your browser side things to work with Tiny to do mobile web AR like that, but from our tests we are not sure yet whether will go with Unity Big WebGL builds or Tiny or what. Will need something done in a month now for a test, then more in june, release candidate in August and release in September.
     
  12. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    The code of Tiny has too much differences than the code in the general Unity WebGL.
    Tiny is also still in preview as far as I know, and constantly changing.

    I guess that it's possible to add WebXR support for Tiny, but I think that on the C# side of things it'll be too different, and there'll also be some changes to the JS code...
    Maybe in the future I'll try to add Tiny support as well, but it might be in a new package.
     
    ROBYER1 likes this.
  13. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    270
    webxr isnt really going to be a reality for mobile safari for a long time, so this is a long standing issue and will probably continue to be.

    Just having a camera background and basic positional tracking would probably be enough for the meantime, so people can at least view a gameobject in meatspace at the very least.
     
    ROBYER1 likes this.
  14. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    270
  15. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
  16. AnkitRitz007

    AnkitRitz007

    Joined:
    Oct 1, 2022
    Posts:
    1
    Is there any update regarding webAR in webGL platform ?
     
  17. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    I just use Needle Tools for WebAR/VR from Unity. If the users (unfortunately) own an iPhone or Apple device, just tell them to use Mozilla WebXR Viewer too.
     
    Last edited: Oct 17, 2022
    De-Panther likes this.
  18. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
  19. iMagesBlues

    iMagesBlues

    Joined:
    Mar 18, 2013
    Posts:
    76
    newguy123 likes this.
  20. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026
    Here I try to systemize Unity Assets that allow to run AR in WebGL:
    https://forum.unity.com/threads/ar-for-webgl-with-unity.1412541/


    Current list of Assets:
     
    Last edited: Jun 9, 2023