Search Unity

Official New for WebGL in Unity 2022.1 beta

Discussion in 'Web' started by anthony_b_, Feb 3, 2022.

  1. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    New Features for 2022.1
    • Added a WebGL template for Progressive Web Apps.
    • Added mobile keyboard support for WebGL to enter text in UI input fields.
    • Added texture compression format setting to WebGL's player settings.
    • Added options in the player settings to control WASM memory heap size and growth.
    • Improved caching of data files, addressables and asset bundles in WebGL builds
    • Removed mobile browser warning from WebGL builds. While we have removed the warning at this point, we have not yet added mobile browsers to a formal list of supported browsers. See our published Roadmap (click Web tab) for more details.
    For the full list of bug fixes, see the beta release notes
     
  2. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Great improvements and features!

    Any tips on which texture compression formats should be used and when?
     
  3. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    More information about the different texture formats can be found here.

    If targeting desktop web browsers, choose a DXT format as all desktop GPUs support DXT compressed textures.
    If targeting mobile devices, start with the ASTC texture format. Most modern mobile devices support ASTC.

    If the browser/device doesn't support a particular compressed texture format, the texture will be decompressed before being uploaded to the GPU. The uncompressed texture can use a lot of video memory. So, if targeting both mobile and desktop users with your WebGL content, either choose a mobile texture (and assume that desktop users will have enough video memory to use the decompressed texture), or create two builds and have your WebGL template choose which is the right resource to load based on the device's texture capabilities. A document describing how to make two builds in this way is currently being written, and we'll post here when it's available.

    Within each texture format, different block sizes can be chosen. Adjusting the block size is a trade-off between quality and texture size in memory.
     
    GDevTeam, DevDunk, blueivy and 6 others like this.
  4. GeeekyBoy

    GeeekyBoy

    Joined:
    Feb 8, 2016
    Posts:
    4
    I would like to inform you that games exported with Unity 2022 (and may be 2021) can't be played on Unity Play due to a problem with the JavaScript file that loads the player. I have posted a tutorial about how to fix this problem temporary at: https://forum.unity.com/threads/patch-v2021-webgl-player-stuck-loading-fix.1238950/
    Please consider applying my patch on the official codebase if possible or fixing it in any other way you find it better.

     
  5. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    GeeekyBoy likes this.
  6. Ravrav

    Ravrav

    Joined:
    Aug 10, 2013
    Posts:
    5
    From the roadmap:

    "However, support may not include lower-end mobile devices with less available RAM"

    So what does "lower-end mobile devices with less available RAM" mean exactly? I guess this might be hard to pin down at the moment, but maybe you could give us some kind of ballpark numbers, especially for the size of the RAM.
     
    Last edited: Feb 15, 2022
  7. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    Hi @Ravrav. This level of detail is something we want to provide in the timeframe of the Unity 2022.2 release. As always, the RAM required will depend on the particular Unity project that you'd like to bring to mobile web browsers.
     
  8. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,163
    Are there any progress in microphone? Especially for enable voice chat for using in WebRTC and photon server
     
    MadeFromPolygons likes this.
  9. vb2s360

    vb2s360

    Joined:
    Oct 7, 2015
    Posts:
    34
    Hello @anthony_b_
    Great news !
    Can you tell us more about what you envision for PWA ?
     
  10. LeFx_Tom

    LeFx_Tom

    Joined:
    Jan 18, 2013
    Posts:
    88
    Any ETA on the document? I would really love to see that.
     
  11. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,940
    Hi there,
    Whats the advantage of using progressive template?
    Thanks
     
  12. VirtualMaestro

    VirtualMaestro

    Joined:
    Jul 2, 2014
    Posts:
    22
    I haven't found any info about the profiling.
    Will we be able to connect the Unity editor to a standalone build in the browser?

    We can take the profiler from Firefox, but it doesn't give info about memory (snapshots and other cool features that gives Unity's Memory profiler).

    E.g., in a big project, we have a massive memory leak, and this behavior can't be reproduced in the Editor, so we have to find out running in a browser (in the best case in release mode).
    (I know about such flags for Emscripten: "--profiling-funcs", "--memoryprofiler")
     
  13. fwalkerLL

    fwalkerLL

    Joined:
    Apr 19, 2022
    Posts:
    2
    Hello everyone. We are trying to run our not too complicated scene which works fine on editor/standalone builds 2022.1.3f1 and 2022.1.4f1 URP. But on WebGL the materials are "pink"/missing.broken... What could I possibly look at to try to fix this?
    Downgrading and trying on 2021 does not seem to be an option because the materials have to be recreated anyways.
    I also notice something. When loading the project with 2021 and allowing it to rebuild, it is popping a message saying that the URP package needs to be reimported because it comes from an earlier version??? Is that possible? That 2022 is using an earlier URP package than 2021? and if so can I install a later version on 2022?

    Update:
    I was able to get it working on 2021.3.0f1 after recreating things from scratch but not sure I am comparing Apples to Apples since things had to be recreated.

    I can see now that 2021.3.0f1 is running URP 12.1.6 and 2022.1.3f1 is running 13.1.8

    Any thoughts on how to fix this issue.?
     
    Last edited: Jun 14, 2022
  14. fwalkerLL

    fwalkerLL

    Joined:
    Apr 19, 2022
    Posts:
    2
    Ok I bit more information on this. So it's a problem with using ANY of the URP shaders. Has anyone else encountered this? Again this is only on WebGL it works fine on Editor and on Stand alone.
     
  15. thekesslereffect

    thekesslereffect

    Joined:
    Nov 30, 2020
    Posts:
    1
    I duplicated my project and opened it with the latest 2022.1.7f but WebGL mobile inputfields still arent bringing up the keyboard for some reason.
     
  16. cr3am

    cr3am

    Joined:
    Jul 6, 2022
    Posts:
    2
    Please keep WebGL a top priority :):):):):)
     
  17. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Awesome update. Does Substance 3.0 on webgl?
     
  18. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    44
    Exactly my case as well
     
  19. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    Hello Anthony,

    With 2022.2 having entered Beta status, can you share some details on what WebGL improvements we can expect?

    I found the summary changelog you did for this release quite helpful.

    Thank you.
     
    fxlange likes this.
  20. DudoTheStampede

    DudoTheStampede

    Joined:
    Mar 16, 2015
    Posts:
    81
    Hi! We heavily use assetbundles on one of our project so I'm pretty interested in this.
    What do you mean with "Improved"? Better first time loading time, when they are cached? Or better next loading times?

    We are still trying to decide to switch to the new version (we are in production state with 2021 LTS so maybe it's too risky) but if it is worth it we would give it a try!
     
  21. LorenzoNuvoletta

    LorenzoNuvoletta

    Joined:
    Apr 28, 2014
    Posts:
    54
    Is the "Added mobile keyboard support for WebGL to enter text in UI input fields." only for legacy UI text or also for TextMesh Pro Input text? Doesn't look like it is working in Unity 2022.1.7, testing on Safari iOS.
     
  22. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    The mobile keyboard on WebGL should also work with text fields with TextMesh Pro package 3.2.0-Preview.3 or later.
     
    LorenzoNuvoletta likes this.
  23. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    43
    Being in the same situation, I would also like to know what has changed concerning the cache
     
  24. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    DudoTheStampede likes this.
  25. LorenzoNuvoletta

    LorenzoNuvoletta

    Joined:
    Apr 28, 2014
    Posts:
    54
    I know the 3.2 has been a long time in the making. Is there any ETA when it might be market as ready for production?
     
  26. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I created a new project using the Third Person (Core) template that comes in Unity Hub using Unity 2021 LTS. The input manager doesn't work at all in WebGL builds. The 3rd person controller doesn't move the player at all.

    I am just wondering if this has changed at all with Unity 2022 WebGL? If so I will move to 2022. If not I will continue to see if the 3rd person controller or input manager devs will fix it there.
     
  27. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    271
    @Hotshot10101 it's concerning that you say that the input manager doesn't work in WebGL builds :confused: We've been fixing input bugs recently including in the input manager and we didn't notice it breaking. Do you have a sample project that shows the issues you're seeing?
     
  28. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
  29. K_Kuriyama

    K_Kuriyama

    Joined:
    Jul 4, 2020
    Posts:
    66
    The "Maximum Memory Size" item has been restored in the public settings of the player settings, but is the limit still 2048? Is the limit still 2048, or does setting it to 4096 have an effect?
    We are hoping that it is 4096, as some current browsers support 4096.
     
  30. Diego-Ras

    Diego-Ras

    Joined:
    Aug 11, 2015
    Posts:
    1
    Hi there! That's a feature I was waiting for so long! Thanks for that.
    I just want to report that when the application (webgl) is running in fullscren mode on mobile browser (unityInstance.SetFulscreen(1)), the keyboard isn't showing anymore.
    Is it an intentional behaviour or a bug?
     
  31. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    @Diego-Ras It sounds like a bug, can you report it?
     
  32. Wim-Wouters

    Wim-Wouters

    Joined:
    Sep 26, 2012
    Posts:
    36
    Loving the PWA template, but cache does not seem to update. Is there a way to force cache update?
     
  33. alexq4p3

    alexq4p3

    Joined:
    Sep 26, 2020
    Posts:
    3
    what would be the problems of using Unity as a website builder?

    I am not speaking about any fancy 3D websites, I am speaking about standard websites, without any 3D, only the UI elements of unity.


    Creating UI interfaces is really easy and friendly in unity.
     
  34. sandstedt

    sandstedt

    Joined:
    May 24, 2015
    Posts:
    67
    @anthony_b_ I have tried this a bit for a client, and looks promising! (Even though I look forward to an updated project Tiny with a smaller engine size) I have two questions for you that I would love to get an answer to:

    I tried to find any tech demo to try out on a mobile browser, but didn't find any that actually works. Are there any deployed examples of games/tech demos out there that is running on the latest 2022.2 tech stream release, targeting mobile browsers? According to your roadmap, mobile WebGL support i still "in progress", but made some quick prototypes with 2D graphics and inputs using the PWA template output, and seems to work fine on (at least latest versions of) both Safari iOS and Android Chrome (and also Firefox).

    Looking at stats, 92% of the worlds browsers would theoretically support WebGL 2 that your are building on top. So for a simple 2D game with well optimized assets and memory management, do you think that's a realistic compatibility number?
     
    Wokou-Dev likes this.
  35. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    67
    i hope it will be multi threading and gpu support. cos now unity is more laggy in browsers then some engines (construct. godot/ playcanvas)/ plus we cant use dots as i understand cos its based on multitreading too

    upd/ i checked roadmap and was happy to see that multi treads are in 2022 allready /
    but where turn it on in 2022.2.7

    Released : Web: C/C++ (native only) Multithreading


    i run webgl build on Opera and plugin Graphy showes that it is 1 core in job hm/

    where can be problem? in asset / browser/ settings/not released yet ?

     

    Attached Files:

    Last edited: Feb 20, 2023
    leobilck and Kreshi like this.
  36. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Hi,

    Can how do the copy and paste from external to TMP Input Field on mobile? I'm using Unity 2022.1.23f1.
    Thanks