Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

WebGL and WebVR

Discussion in 'WebGL' started by MaT227, Mar 8, 2016.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    607
    Hi there,

    I am wondering if Unity currently supports Oculus, Vive or some VR device using WebGL or if there's a way to do VR using Unity and WebGL.

    Thank you !
     
    unity_surviver and linojon like this.
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,516
    Not at the moment. We have done some initial investigation and we will likely implement it at some point in the future, but this is not on our short term roadmap.
     
    Blarp likes this.
  3. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    607
  4. arapps3d

    arapps3d

    Joined:
    Jan 13, 2015
    Posts:
    15
    Hello Unity team, can you specify when this would be approximately implemented?
    I'm searching for a solution to build a Cardboard VR project from Unity (WebGL Target).......Or maybe there is already a Web GL / WebVR Cardboard solution that I just did not find yet? Thanks in advance.
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,483
    Today, it is possible to use WebVR in Unity using this plugin: https://github.com/gtk2k/Unity-WebVR-Assets

    In the future, we will have WebVR support integrated into Unity WebGL, so that Unity VR projects will work without modifications. We have a working prototype of this, I expect this to ship in Unity 5.6, or maybe 5.5.

    That said, since you mentioned Cardboard, I assume you want to target mobile phones. Due to performance and memory constraints in Unity WebGL, this is currently not recommended or supported. You can still try it, but expect results to be unsatisfactory.
     
    ilmario, Dalmazo and JairoGLoz like this.
  6. arapps3d

    arapps3d

    Joined:
    Jan 13, 2015
    Posts:
    15
    Hi Jonas, thanks for the fast reply! I will check the github solution.
     
  7. BadSeedProductions

    BadSeedProductions

    Joined:
    Dec 26, 2014
    Posts:
    119
    Any updates? Is there anywhere I can go to follow the development of this?
     
  8. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,483
    No updates yet. This will not be in 5.5, possibly 5.6.

    That said, I think this feature will stay in an "experimental" state for a while to come. Not because WebVR doesn't work by itself (it does), but because the tech stack of the WebGL platform is, IMO, not ready to drive VR content yet (outside the realm of simple demos). VR requires consistently high frame rates with no hick-ups - but on a platform without threads, it is not possible to achieve that during the load of scenes for instance. So we will need other problems solved first before being able to use this for real production content. That said, I think there is value in having the feature available to experiment with before that.
     
    BadSeedProductions likes this.
  9. diegopit

    diegopit

    Joined:
    Aug 29, 2015
    Posts:
    4
    Hi Jonas, just wanted to ask if you have any updates on WebVR with WebGL. I have a lot of projects that are pending on this and some colleagues are considering to migrate to PlayCanvas (such a waste of time and resources).

    Thanks,
    Diego
     
  10. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    Unfortunately this will not ship in 5.6. Chances are it will be part of Unity 5.7 as an experimental feature.

    But the limitations of WebVR in general still apply as laid out above.
     
  11. mhazani

    mhazani

    Joined:
    Jun 18, 2014
    Posts:
    1
    Great thread here, thanks for the clarifications and the link to the repo.

    Does anyone know how good the controller support is with the current third party solution? Can I expect Vive compatibility? I tinkered with it a while back and I remember the (old DK2) headset worked incredibly well.
    Thanks!
     
  12. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,483
    I don't think it has controller support - but it would be possible to implement that in JavaScript yourself.
     
    mhazani likes this.
  13. AbhimanyuAryan

    AbhimanyuAryan

    Joined:
    Apr 22, 2015
    Posts:
    21
    Looks like the future of web is also in Unity. Unity is more than gaming engine now...powering businesses
     
  14. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    351
    Im trying to understand whats the difference between VR and 3D, they both seems to be the same to me, except VR wants to you spend money buying goggles and controllers, memory and CPU, to get the same thing we had before using 3D.
     
  15. AbhimanyuAryan

    AbhimanyuAryan

    Joined:
    Apr 22, 2015
    Posts:
    21
    try AR if you don't want to spend money
     
  16. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    351
    Whats the difference between VR and 3D?
     
  17. JairoGLoz

    JairoGLoz

    Joined:
    Mar 9, 2017
    Posts:
    3
    Hi Jonas, any updates on this?

    WebVR support was not included in 5.6 u.u is it in 2017.1? or is it going to be in 2017.2?

    I'm currently working on a project in which building for WebVR is almost mandatory. I'm about to test with the project you suggested (https://github.com/gtk2k/Unity-WebVR-Assets), but nothing like having a Unity integrated tool for doing it.

    I really think WebVR is going to have a key role in game development in the years to come so I hope (and I'm almost sure) building for WebVR natively from Unity is going to be possible very soon.

    Thank you in advance.
     
  18. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    It will not be in 2017.1 and probably also not in 2017.2.
     
  19. JairoGLoz

    JairoGLoz

    Joined:
    Mar 9, 2017
    Posts:
    3
    But it will be fur sure, right? next year maybe?
     
  20. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    It is probable but usual disclaimer: predicting the future is tricky business.
     
    Last edited: May 12, 2017
  21. DNArt

    DNArt

    Joined:
    Jan 16, 2014
    Posts:
    17
    O wow Schubkraft thanks for your response but that is a bit disappointing and also worrying. I also noticed there are no new WebGL related improvements on the road map of 2017.1 and most is now labeled as in research. Does this mean the current state of the WebGl implementation is at good as it gets for us in the coming year?
     
  22. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    Well, sorry if that is disheartening to not get WebVR soon. But we are still committed to WebGL as a platform and are actively working on it.

    We have some items on our internal roadmap that are in our hands to make and fix. We'll let you know once we know our scheduling.

    The items on the public roadmap are things were we are dependent on the browser vendors. We and they are currently working on fixing and improving WASM. Once people are happy with that the next step is probably going to be JS threading, after that threads for WASM and after that we'll see.

    There are also many things being worked on at Unity that will benefit WebGL a lot (better stripping, better asset bundle handling, ...) but are not part of the WebGL team.

    What WebGL specific features would you like to see? What is stopping you from making a WebGL game now?
     
  23. DNArt

    DNArt

    Joined:
    Jan 16, 2014
    Posts:
    17
    :) Hy Schubkraft Happy to read your response! I was afraid WEBGL was loosing attention slowly but this sounds very lively. I'm compiling to WEBGL at the moment with the template from Github. Using that seems easy so hopefully it works to. WebVR Its not so much for me as for my students at an art school that really love to get there hands on VR and WebVR particular. Me, I would be very happy with texture arrays for WEBGL. If i'm informed correctly the texture arrays could already be implemented i would love to use them for a custom shader and it could bring assets like mega splat potentially to others. from there forum "
    Q: Would this work on WebGL 2? If it is supposed to be functionally equivalent to openGL 3.0.
    A: In theory yes, but I don't think Unity has added Texture Array support to their implementation yet.."
    The threading would be a mega jump for sure. Thanks for the upbeat notice Web based 3D applications wil grow big so good to know Unity is still pushing hard for helping that happen.
     
  24. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    368
    Hello and thank you for the information.

    I think that nothing stop us to release a game in WebGL exepting few bug but as exemple : https://issuetracker.unity3d.com/issues/wasm-runtime-error-integer-overflow-slash-unrepresentable , it has been reported a month ago and we still not have a fixe.

    I have found again a bug today with the camera using depth and MSAA (i will make a report tomorrow), and for me, it look that i spend all my time on making report for you, google ,firefox...

    I have reported a bug on google report 2 month ago (https://bugs.chromium.org/p/chromium/issues/detail?id=701970), and it's still not fixed ... , it's crazy... how we can move forward with some lazy guy like that ..

    I know that you (unity) try your best with the WebGL and i'm angry against the web browser vendors who have dropped the support for the unity web player before a perfect replacement solution.

    I have lose a lot of players because the performances for a 3d game using WebGL are not acceptable at the moment. I know that one day we will have similar performances WebGL/Unity Web Player but the process is soo long .... A lot of game are dying because of that.

    Have a good day.
     
  25. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    We've got the WASM bug fixed internally and it will hit the 2017.1 beta soon (together with all other wasm bugs we know of). And it is labeled it as an experimental feature to indicate it is to be used with caution and that the ride might not be smooth.

    We know the pain of the death of the Unity plugin and we are in regular meetings with most of the browser vendors to coordinate and pass on your and our feedback. However the plugin was a very different platform. It was just a standalone build running in a browser window.
     
  26. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    368
    Thank you for your answer.
     
  27. GDevTeam

    GDevTeam

    Joined:
    Feb 14, 2014
    Posts:
    8
    Status as of July 1, 2017?

    WebGL / WebVR
     
  28. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    The same.
     
  29. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,516
    WebVR support will not be included in 2017.1 or 2017.2
     
  30. unity_8TklywcUTjN2sg

    unity_8TklywcUTjN2sg

    Joined:
    Nov 15, 2017
    Posts:
    1
    Hello,
    I have followed step by step in the following link, but it did not work. I got an error of “Unity_WEBGL_LOADER_GLUE” and used VIVE headset. Did anyone face this problem?
    https://github.com/gtk2k/Unity-WebVR-Assets

    If anyone has a solution to this, please kindly help me. Thank you in advance.
     
  31. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
  32. ooaka

    ooaka

    Joined:
    Nov 22, 2017
    Posts:
    4
    Can I use webgl to implement web VR?
     
  33. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
  34. ooaka

    ooaka

    Joined:
    Nov 22, 2017
    Posts:
    4
    I followed the URL you provided, but did not succeed
     
  35. ooaka

    ooaka

    Joined:
    Nov 22, 2017
    Posts:
    4
    When I followed the URL, I got this error message. QQ图片20171123093242.png
     
  36. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
    Like I said above we changed the embedding of our content into pages and the project is likely still using the old way.
    See the manual on how we do it now and change it accordingly.
     
  37. ooaka

    ooaka

    Joined:
    Nov 22, 2017
    Posts:
    4
    Can you send me the address of the manual of the latest project so that I can achieve it?
    Can you send me the address of the manual of the latest project so that I can achieve it?
     
  38. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
  39. whoyee

    whoyee

    Joined:
    Sep 2, 2017
    Posts:
    4
    Hey there,
    I have been working on a new set of assets that work with the latest Unity 2017.3:

    Github:
    https://github.com/caseyyee/unity-webvr-export

    You can play with the experience using Firefox by going to:
    https://caseyyee.github.io/unity-webvr-export/

    There's still some work to get this running really well, but it's mostly all there and looks great in headset using Firefox @ 90fps.

    Also have been working on porting a game to work with WebVR that you can try here:
    https://caseyyee.github.io/secvrity/

    Please feel free to file and issues or report back with any questions you might have!

    I would love to get some Unity content to test with, and would love if anyone wants to offer up VR content for porting to WebVR as a test. Please contact me if so :)

    Thanks!

    edit: Added more details
     
    Last edited: Nov 27, 2017
    solidearthvr and MRCalderon3D like this.
  40. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    614
    Can work with gearVR?
     
  41. Xeli999

    Xeli999

    Joined:
    Jan 17, 2018
    Posts:
    1
    I have tried it,most of the webVR demo are OK,but when I link the VR glasses,the web page will be half of black and white,scene of VR glasses is normal.I want know whether it's just like this?

    Thanks!
     
  42. debcat

    debcat

    Joined:
    Oct 17, 2017
    Posts:
    1
    What would it take to get this to work on an iphone? Seems to work via Firefox Nightly, but hangs on mobile.
     
  43. unity_surviver

    unity_surviver

    Joined:
    May 15, 2017
    Posts:
    4
    we will more then happy if unity will add proper web vr support in near future
    it will help us to develop apps that will not require deployment on stores
     
  44. mrcreightond

    mrcreightond

    Joined:
    Nov 1, 2017
    Posts:
    1
    Anyone been able to get this working with ray casting and single button press input? I've been able to build scenes out in Unity and get them working on my phone in Google Cardboard but so far haven't been able to figure out interaction with objects besides the included Touch functionality.


     
  45. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    815
  46. unity_MQLqtcTpRoxe6Q

    unity_MQLqtcTpRoxe6Q

    Joined:
    Feb 22, 2018
    Posts:
    2
    which version of unity support webVR?
     
  47. unity_MQLqtcTpRoxe6Q

    unity_MQLqtcTpRoxe6Q

    Joined:
    Feb 22, 2018
    Posts:
    2
    I have upgraded unity 5.6 app in unity 2017.3.0.3f webvr app, but its build is not opening in broswer( firefox)... may i know the raeson ... any help?,I have upgrade unity 5.6 app in unity 2017.3.0.3f webvr app, but its build is not working in broswer?

    Error m getting:
    An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: uncaught exception: abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking") at jsStackTrace (Build.asm.framework.unityweb:2:27460) stackTrace (Build.asm.framework.unityweb:2:27631) abort (Build.asm.framework.unityweb:4:36399) _dlopen (Build.asm.framework.unityweb:2:164396) _6s (blob:29:1) Z6s (blob:29:1) tjt (blob:29:1) d_s (blob:29:1) Sms (blob:8:1) Rms (blob:8:1) NAt (blob:34:1) invoke_iiiiiii (Build.asm.framework.unityweb:2:335378) C7l (blob:26:1) iCt (blob:34:1) invoke_viiiiii (Build.asm.framework.unityweb:2:350799) wcm (blob:26:1) Ngi (blob:5:1) _Cr (blob:8:1) ZCr (blob:8:1) Drh (blob:20:1) CBt (blob:34:1) invoke_iiiii (Build.asm.framework.unityweb:2:343679) mIs (blob:29:1) BTs (blob:29:1) Lja (blob:13:1) SKb (blob:18:1) l4b (blob:18:1) e4b (blob:18:1) z3a (blob:15:1) N3b (blob:18:1) gia (blob:17:1) fia (blob:17:1) IIb (blob:18:1) KIb (blob:18:1) DIb (blob:18:1) P7b (blob:14:1) O7b (blob:14:1) M7b (blob:14:1) I7b (blob:14:1) z6b (blob:14:1) $5b (blob:14:1) callMain (Build.asm.framework.unityweb:4:34764) doRun (Build.asm.framework.unityweb:4:35467) run (Build.asm.framework.unityweb:4:35653) runCaller (Build.asm.framework.unityweb:4:34281) removeRunDependency (Build.asm.framework.unityweb:2:34426) processDataJob@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:3549 schedule/a.callback@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:17079 setTimeout handler*schedule/a.complete@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:17446 downloadJob/r.onload/<@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:3894 decompress/r.worker.onmessage@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:4:9191 EventHandlerNonNull*decompress@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:4:9111 downloadJob/r.onload@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:3820 EventHandlerNonNull*downloadJob@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:3800 schedule/a.callback@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:17079 setTimeout handler*schedule@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:17659 scheduleBuildDownloadJob@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:4143 loadModule@file:///C:/Users/Rajni.Mehla/Desktop/HS300025_AL_W/Build/Build/UnityLoader.js:1:5255 n/
     
  48. whoyee

    whoyee

    Joined:
    Sep 2, 2017
    Posts:
    4
    Do you have a link with this hosted anywhere? We've been testing here with 2017.3

    How about the sample off of the repo page here:
    https://github.com/mozilla/unity-webvr-export

    Click on the "Try it now" link and report back and let me know if your encountering the same issue!
     
  49. whoyee

    whoyee

    Joined:
    Sep 2, 2017
    Posts:
    4
    We haven't had any luck getting Unity WebGL player to work with IOS.
     
  50. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,011
    This project is really interesting. I've been experimenting this week with A-Frame, because I really love the zero-installation nature of web deployment, but I've been getting frustrated with how hard that code is to write.

    Unfortunately when I try the sample off the repo page on my Oculus Go, it loads, but when I then click on the cardboard icon to view in VR, I get stuck at a black screen with a spinning progress indicator that never goes away. I can hear sound effects continuing to play, but the 3D view never appears.

    Any idea what it would take to make this work on the Go?