Search Unity

WebGL Roadmap

Discussion in 'WebGL' started by jonas-echterhoff, Jun 18, 2015.

  1. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    I believe this may have been an intentional change to match the behavior of the Unity Web Player, as people filed bugs against that. But, as @Schubkraft wrote, please don't use this thread for arbitrary discussions like that.
     
  2. sstephane

    sstephane

    Joined:
    Nov 5, 2009
    Posts:
    30
    @jonas echterhoff Given the recent Mozilla announcement, I know I already asked before but do you have any recent information on whether the webgl build will allow at some point to dynamically reallocate the memory heap total size.

    I don't see many people talking about this limitation so I guess it is not a big problem for most of them but it is really a big deal in my case as I am working on an app where users create 3D content, starting from nothing (few memory allocated) to a lot depending on what they do and their content complexity (hundreds MB to a GB). In this case, I can't pre-allocate the theorical maximum of memory for the heap as many users have very simple content and low end computers. BTW, how could we know what is the maximum ? How is it defined, so that we could prevent any 'out of memory' exception.

    It may be too early to answer this, but I would be grateful if you could share information later if there is any improvement in this area. Thanks!
     
  3. wbl1

    wbl1

    Joined:
    Apr 22, 2009
    Posts:
    156
    arumiat and AntiDanilevski like this.
  4. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    143
    soon will out Unity 5.3 and what benefit will we have on webGL - ? I look a roadmap, but have nothing.. what do I expect: fast start loading; working standard shaders; used low memory; low build size; quick project building;...
     
    kenshin likes this.
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Some things to expect in 5.3:
    -better quality standard shader.
    -better documentation.
    -in-memory compression of asset data for lower memory usage.
    -automatic handling of compression for built data when the server is not configured to serve compressed files (so you don't need to read server manuals not to have huge builds).
    -soft shadow support.
    -bug fixes.
     
    artzfx, arumiat, kenshin and 5 others like this.
  6. jonmalave_

    jonmalave_

    Joined:
    Aug 19, 2012
    Posts:
    1,669
    Update for automatic compression; in other words we don't need to configure our web servers to serve compress data folder anymore? We can now build a compress build of our project, upload, and it just works?
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Yes. You will take a minor hit if your server is not set up for compression, because the decompression will be done in JavaScript after the download is completed. But, gzip is fairly fast to decompress (even in JS), so this hit should be less then a second in most cases (actual time is printed to the console for you to know), which is much better then having to download ~3x the amount of data.
     
    jonmalave_ and kenshin like this.
  8. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,421
    @jonas echterhoff Out of interest, how easy will it be for pirates to download/reverse engineer WebGL games built with Unity, my understanding is they have access to all the Javascript source code now right?

    And will the move eventually to WebAssembly help mitigate this?
     
  9. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    The minified, generated JavaScript generated from (non-development) WebGL builds is no more readable then machine language programs on other platforms (or then WebAssembly would be). Actually, WebGL content is probably harder to reverse engineer then, say, Mac/Windows standalone players in Unity, as those contain the .NET managed dlls, which reverse compile quite will.

    That is not to say that Unity WebGL content cannot be reverse engineered - of course it can be. But it is certainly not inherently easier then anything else.
     
    jonmalave_ and Meltdown like this.
  10. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    143
    standard shaders doesn't work on 5.3.0f4 : img
    5.3(5.3.1) is worse than 5.2, out of memory in point when 5.2 worked
     
    Last edited: Dec 21, 2015
  11. Lockethane

    Lockethane

    Joined:
    Sep 15, 2013
    Posts:
    114
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,033
    A few webGL rendering bugs in 5.3:
    -all materials are reflective instead of matt - it's possible that reflection probes crap out the renderer 764325
    -lightmaps don't show up with realtime on and look horrible in static only 764316
    -point pixel sprites become mipmapped for no reason 764781
     
    Last edited: Jan 25, 2016
    atti, yuliyF and arumiat like this.
  13. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,653
    We have not looked at this (and probably won't). Though, we experimented with Shared Array Buffers to support proper multi-threading which would allow Unity to use the same threading model used on other platforms.
     
  14. StefanieJ

    StefanieJ

    Joined:
    Dec 29, 2015
    Posts:
    1
    Switch Platform for WegGl Build disabled.

    Has anyone an idea what I can do to enable the WebGl build? I work with Unity version 5.3.1 - 64-bit on a Windows10 PC.
    It is not only with one project I encounter this issue, but any I try to build for WebGl. (I also can only build for Windows, but not for Linux or Mac.)
     
  15. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    918
  16. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    968
    When was this bug introduced? I've been pulling my hair out working on this!
     
  17. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,033
    It's not a regression, webGL has never supported RT GI (QA dixit). Switch to static GI.
     
  18. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    968
    Oh, yeah, I read that wrong. I am not expecting realtime GI any time soon, ever possibly. The roadmap says they aren't even working on it.

    I'm having trouble with my static lightmaps disappearing when I introduce a realtime light in directional. It works in directional specular. I swear I used to work, but i'm beginning to even question that.

    http://forum.unity3d.com/threads/ba...hen-real-time-directional-light-added.386374/
     
  19. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    918
    The manual says "Unity WebGL only supports baked GI. Realtime GI is not currently supported in WebGL. Furthermore, only Non-Directional lightmaps are supported." so you directional light will not work. You also have to untick Precomputed Realtime GI.
     
  20. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    968
    Yea, I got all of that except the part about the directional light. I'm getting the same results in the editor and standaI misunderstood the post by @laurentlavigne and didn't mean to hijack this thread. But your input on either of the two threads below would be very welcome. Thank you.

    http://forum.unity3d.com/threads/ba...hen-real-time-directional-light-added.386374/

    http://forum.unity3d.com/threads/5-4-0b6-baked-lightmaps-and-a-realtime-light.386550/
     
  21. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,736
    @topofsteel you have to distinguish between a "directional light" and "directional lightmapping". It sounds similar but is different.

    A directional light is an infite lightsource with parralel light rays. a very bright far away light sourcelike the sun. This sort of light illuzminates the whole scene from the same angle in every place.

    Directional lightmaps refers to a secondary texture set in the lightmaps. This secondary set is sort of like a normal map in the way that it defines a vector from which baked light hits the surface in this exact area. With directional lightmapping you can bake light into your scene but still retain the details from normalmaps (because the normalmap in that place can read the secondary texture which tells it from where the light hits in that place).

    A directional lightsource does not need to have a directional lightmap to be baked into the scene. A dircetional lightmap helps to gain more detail but needs more ressources.

    Please refer to the documentation for more in depth explanations

    (edit) - also: have you made sure to select a shader that actually supports Lightmaps?
    When not using the standard shader but Mobile shaders not everyone of them sctually supports lightmapping.
     
    Last edited: Feb 19, 2016
  22. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Quick question; is there any rough ETA on when we're likely to see Linear lighting supported in WebGL?
     
  23. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,653
    We are working on implementing Linear Color Space support for WebGL2.0 (gles3.0), but it won't be in 5.4 and, as it stands right now, most likely not in 5.5 either.
     
    Last edited: Feb 24, 2016
    AFrisby likes this.
  24. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Thanks Marco - I guess a related question (I google'd already), any idea when WebGL2 is likely to hit commercial browsers?
     
  25. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,653
    well...again I don't have any exact dates but WebGL2.0 support is currently available in both Nightly and Canary, and it's considered mature so I would expect Firefox and Chrome to have it really soon :)
     
    yuliyF and AFrisby like this.
  26. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Thanks! :) I have to say, Unity's WebGL implementation has matured a lot in the last 3-6 months - it's really gone from being totally unusable for us, to something that's reasonably stable (still not quite perfect, but it's getting there). Big kudos.
     
    yuliyF, sirrus, Dantus and 1 other person like this.
  27. Lockethane

    Lockethane

    Joined:
    Sep 15, 2013
    Posts:
    114
    arumiat, NomadKing and sirrus like this.
  28. sreejit_730

    sreejit_730

    Joined:
    Jun 2, 2015
    Posts:
    5
    Hello All,

    I am working on a multiplayer game for WebGL platform and i am using (http://lockstep.io/ - SocketIo & node.js server ) for handling the game.

    I am facing these issues as shown in the attached image.

    I have no idea about what these errors state?

    I don't think that the issue is from my coding side as my multiplayer game runs perfectly in standalone builds with more than 4 instances of the standalone build.

    But it does not even open in my WebGL build.


    Does WebGL does not support threading??

    Please guide.
    What are these errors all about?
    Can these issues be solved??
    or
    Do i have to change my whole project implementation?

    Thank you!
     

    Attached Files:

  29. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    918
    WebGL doesn't support threading.

    Better make a new topic with your questions then start this specific discussion in a roadmap post.

     
  30. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Annoying question I know - but would it be possible to get this post updated now we're past 5.0/5.1? It'd be useful to know what is on the horizon over the next 3-6-9 months.
     
    Aurigan, arumiat and sirrus like this.
  31. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    172
    yuliyF likes this.
  32. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,147
    I'd like to know when WebGL is passing the 'preview' state and should build most code or at least report a good error if you try to do something unsupported. Right now I just see [mainly] unreadable errors trying to build some projects.
     
  33. arumiat

    arumiat

    Joined:
    Apr 26, 2014
    Posts:
    315
    Is there much in 5.3.5 webGL wise that makes it worth upgrading from 5.3.4f1?
     
  34. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    918
    Well, there are no new features in it but some of the bug fixes might help you out. Just check the release notes.
     
  35. JakeOfSpades

    JakeOfSpades

    Joined:
    Aug 22, 2015
    Posts:
    44
    What about UNET, more specifically the MatchMaker and Relay Server? What are my alternatives for the time being if anyone knows?

    Thanks
     
  36. Wusakko

    Wusakko

    Joined:
    Nov 27, 2013
    Posts:
    4
    I think this subject has been many times on the table, but becauce post is over half year old I would like get updated answer. Is mobilebrowser support coming soon or not at all? I know it depends heavily on mobilebrowsers and their workflow and developement. But I would like to get your thoughts about what direction this is going? Are you using your stakes more on WebGL 2 than WebGL 1?
     
  37. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    I suspect mobile performance for WebGL will continue to suck for the near future (i.e. until 2020+). Unless what you're doing is ridiculously simple; native is going to be far superior.
     
  38. arumiat

    arumiat

    Joined:
    Apr 26, 2014
    Posts:
    315
    We're not targeting mobile but have seen noticeable improvements in mobile browser performance over the past few months without doing anything on our end. Things seem to be moving along fast.
     
  39. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    143
    When does WebAssembly be work in real? We want to make a cool games)
     
  40. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,775
    Since it requires browser vendors to progress on that area I would not expect anything or wide spread thing this year
     
  41. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Both Chrome and Mozilla have implementations of WebAssembly in their Nightly builds these days. However, these are disabled before, and not yet at a final spec. Once the spec is finalized, I expect that they will switch them on by default in their nightly builds, so from there it should take ~3 month to show up enabled by default in release builds. I currently expect that we will see the spec finalized by the end of this year, and implementations enabled by default in release builds early next year.
     
    yuliyF likes this.
  42. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    621
    I see release chrome build already have WebAssembly and WebGL 2 options under chrome://flags/ but of course they are disabled by default
     
  43. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    28
    Any updates on substances in WebGL? Will they be available at any time?
     
  44. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    571
    Substances are available in Fire Fox

    webglff.jpg
     
  45. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    28
    yes but not procedural right?
     
  46. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    571
    That Substance was set as "Build on Load", so procedural in the Inspector. Not sure if the WebGL build bakes sbsar's by default however.

    Here's another I just built with 15 x sbsar's at 1024x1024 res and "Build on Load". Takes 6 secs to load up in FireFox. It's only a simple scene of cubes though with a single directional light and a 1st person controller to run around. Scene size is 25mb instead of the 10mb from the 512x512 res version.

    webglff3.jpg
     
    Last edited: Jun 20, 2016
  47. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    This is not currently being worked on. I don't believe Allegorithmic offers builds of substance for WebGL.
     
  48. arumiat

    arumiat

    Joined:
    Apr 26, 2014
    Posts:
    315
    Apparently these are just baked at runtime
     
  49. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    28
    So its Allegorithmic who should make it?:)
     
  50. albn

    albn

    Joined:
    Jun 27, 2016
    Posts:
    2
    You can already publish Substances to WebGL via Sketchfab, there is even a built-in exporter. Here are some examples:

     
    ponx and yuliyF like this.