Search Unity

Official New for WebGL in Unity 2021.2

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

  1. anthony_b_

    anthony_b_

    Unity Technologies

    Joined:
    Oct 27, 2020
    Posts:
    24
    Build Improvements
    • WebGL now uses the incremental Player build pipeline.
    • Updated WebGL compiler to Emscripten 2.0.19 and removed support for the obsolete asm.js linker target.
    New Features
    • Added support for compressed audio in WebGL.
    • Added support for mobile compressed texture formats both on individual textures and through the texture subtarget build setting.
    • Added the Debug Symbols player setting to create release builds with embedded function symbols for improved profiling and error stack traces.
    • Enabled the URP feature SRP Batcher for WebGL 2.
    • Groundwork features to enable us to consider adding Mobile support to the WebGL platform:
      • Provide gyroscope, accelerometer, gravity sensor and attitude sensor values (iOS and Android browsers). See manual for details.
      • Forward and rear facing web cameras.
      • Allow full-screen projects to lock screen orientation (Android browsers).
    For the full list of fixes, see the release notes
     
    Rallix, Thaina, xucian and 17 others like this.
  2. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    How can I do this? How do I set a project to fullscreen and to lock the screen orientation on Android browsers?
     
  3. JeffreyBennett

    JeffreyBennett

    Joined:
    May 18, 2017
    Posts:
    25
    I'm glad to see this new thread for WebGL Roadmap / WebGPU support implementation in Unity. Thanks for opening it!
     
  4. Nishan2030

    Nishan2030

    Joined:
    Nov 3, 2020
    Posts:
    5
    I cannot build any file in WebGL in unity 2021.2. It is stuck in this scene for hours.
    upload_2022-3-20_18-1-48.png
    I have tried changing many building settings, but not working. Even the sample scene also cannot be build.
     
  5. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    This is not the thread for reporting bugs. Please do it in the appropriate place and not divert the conversation about the 2021.2 webgl features / roadmap.
     
  6. LogicFlow

    LogicFlow

    Joined:
    Aug 18, 2018
    Posts:
    33
    Is Unity in the midst of shifting this featureset over to WebGPU, or are we still sitting with pure WebGL with its high overheads on multiple GL calls?
     
    Last edited: May 9, 2022
  7. theVirtunaut

    theVirtunaut

    Joined:
    Sep 28, 2013
    Posts:
    10
    I'm getting these errors when I try building for WebGL on the latest build. Havent found any solutions yet.
     

    Attached Files:

  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Does anyone know how to get unity video player to play a Base64 video ?
     
  9. JCIPL

    JCIPL

    Joined:
    Jul 13, 2018
    Posts:
    14
    Hi ,
    We are using unity 2021.3 for making WebGL build, However after playing the index file it is stuck at loading (90%).
    Could you please help us, we've tried by changing all the publishing setting like compression format disabled but doesn't work for us.
     

    Attached Files:

  10. OneManArmy3D

    OneManArmy3D

    Joined:
    Jun 2, 2011
    Posts:
    191
    Do you see any errors in browser console?
     
  11. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Please make Task and UniTask work in WebGL, otherwise it's unusable with most bigger projects which require several libraries that only expose async APIs.
    I had no luck with any version after 2021, and I've tried many.
    Also tried this hack but it requires PlayerSettings.WebGL.threadsSupport which, once enabled, fails the build in Unity >=2021
     
  12. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    How is it that microphone on webGL is still not being provided?
     
  13. yty

    yty

    Joined:
    Aug 10, 2009
    Posts:
    82
    Can 2021.x support this feature?
    • Added mobile keyboard support for WebGL to enter text in UI input fields.
     
    K_Kuriyama and xucian like this.
  14. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Update for anyone interested. This was solved by a brilliant guy.

    That's a big one for us as well! Please do
     
    K_Kuriyama likes this.
  15. tinyant

    tinyant

    Joined:
    Aug 28, 2015
    Posts:
    127
    do you fixed this?
     
  16. Programmer_1V1

    Programmer_1V1

    Joined:
    May 8, 2021
    Posts:
    3
    Hello, let me first say thank you for offering any help; please let me know what additional info would be helpful.
    I am working on an application that I have built for WebGL. It is a large project (~240MB) and after updating it recently, I can not get it to run in an iFrame. The previous version worked perfectly (2020.x.x LTS's) but after upgrading the project to URP/2021.x.x LTS, I can not play it from an iFrame.

    After uploading the build to WordPress, I can locate and click the index.html file and open up the build successfully with no issues at all. However, if I create a page and use custom HTML to create an iFrame, and set the source as the index.html, I get errors. Please note, that the build opens successfully if I directly clicked and ran the index.html file directly as it cached the files on my browser. But if I clear the cache and navigate to the page with the iFrame, I again see errors. The build just stops loading between 20-60%, and sometimes has an Abort modal pop-up. I have tried different builds as well related to compression (gzip, gzip with decompression fallback, brotli, brotli with DF, not compressed at all, etc).

    In Network, the GET request is returning with a 206, but shows (failed)
    upload_2023-1-25_17-22-43.png

    Any help would be VERY much appreciated, thank you.