Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why was asm.js removed?

Discussion in 'Web' started by MindBuild, May 21, 2019.

  1. MindBuild

    MindBuild

    Joined:
    Oct 7, 2018
    Posts:
    22
    Hello all,

    I have recently upgraded to 2018.3, which is awesome a lot of new features and improvements.

    I build both asm.js and webasm builds. Asm.js loads very fast in Safari and compatible with all iPads and iPhones. While, webasm only works with devices with iOS 11+

    Why was it removed as compiler option in Unity? And is there a way to get it back?

    Thanks.
     
  2. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
  3. JakeJollimore

    JakeJollimore

    Joined:
    Jul 5, 2018
    Posts:
    4
  4. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    You probably don't want to set it unless if you are using asm.js (not supported) or threads (experimental). I believe it is now set to 32MB (or some low number) with automatic memory growth enabled.
     
  5. JakeJollimore

    JakeJollimore

    Joined:
    Jul 5, 2018
    Posts:
    4
    I want to set it to asm.js. I'm building specifically for IE, which doesn't support web assembly. And I know IE doesn't fully support WebGL, and runs like crap, but I have no choice.
     
  6. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    Code (CSharp):
    1. PlayerSettings.WebGL.memorySize = 256;
     
  7. AtomR

    AtomR

    Joined:
    May 22, 2012
    Posts:
    40
    I am having a problem with webassembly and wanted to compile in asm.js. Where exactly do I add the code?

    Code (CSharp):
    1. PlayerSettings.WebGL.linkerTarget= WebGLLinkerTarget.Asm
     
    iLyxa3D likes this.
  8. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Check this if you want to set as default (project settings): https://forum.unity.com/threads/2019-1.597238/#post-4443697
     
    Hassaan-XD likes this.
  9. MindBuild

    MindBuild

    Joined:
    Oct 7, 2018
    Posts:
    22
    You're a legend thanks De-Panther!

    I didn't know asm.js worked on explorer. I had a client call me up wondering why it was so buggy he told me the browser he was using was Explorer. I was so excited to hear that it was working I didnt even worry about the bugs lol.
     
    De-Panther likes this.
  10. Hassaan-XD

    Hassaan-XD

    Joined:
    Jul 18, 2015
    Posts:
    14
    Bump, even after setting the linkerTarget, unity does not build asm.js and still builds to wasm.
     
  11. Hassaan-XD

    Hassaan-XD

    Joined:
    Jul 18, 2015
    Posts:
    14
    Marco-Trivellato can you help us in this? We really need to try asm.js because wasm build is not working on iPhone 6. It throws an abort exception when trying to start unity instance (the webgl loader completes loading and then the exception abort is thrown).
     
  12. Hassaan-XD

    Hassaan-XD

    Joined:
    Jul 18, 2015
    Posts:
    14
    nvm, wasm is better. My iPhone 6 was crashing due to memory usage, 1st problem is wasm file size, reduce it by removing some packages, 2nd problem is gameplay memory usage, reduce it by compressing textures natively and using no unity compression