Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

how about WebGPU

Discussion in 'WebGL' started by Handsome-Wisely, May 6, 2022.

  1. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @icauroboros HDRP will not be supported initially, WebGPU is still missing some needed features. I haven't tested AVPs yet, I can't give you an answer on that one yet. But I'll check it out.
     
    icauroboros and LooperVFX like this.
  2. ARealiti

    ARealiti

    Joined:
    Oct 4, 2013
    Posts:
    132
    Will Unity support Progressive Web Apps (https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/) with WebGPU support? I.e. things like installation and storage are very important, WebGL suffered from a cache clear re-download no install scenario that made it impossible to support on commercial/corporate apps along with local storage issues, I was doing some Unity work for the Mining Industry for pit management (lifetime voxelization of pit areas) as a government department contractor and it was one of the big issues along with threading and the speed (solved with WebGPU) that we had to remain desktop bound. The mining company really wanted a browser based solution.

    If Unity doesn't directly support PWA it would be great if the WebGPU builds were componentized and not monolithic so they can be used as REACT/Angular components in a SPA PWA.

    Seems the 4GB per tab limit has been solved so that is good, years since I worked commercially on it with Unity, 16GB is probably enough, it would be nice to have more with some commercial applications in Mining I worked in the models were extreme and some are in other industries.

    Please note this though still applies as of '22 it seems, hope Unity are not just relying on the heap assume Google would have warned about this

    "There are different memory limitations for different kinds of memory. The 4G limit is on heap. There is 16G available for fixed arrays (recently improved from 8G), and there is 16G available for the new "web assembly language". The 4G heap limitation is here to stay, apparently. It has to do with making Chrome more efficient for "ordinary" browsing. Google "pointer compression" for a full discussion. If you are running into a 4G limit, then you are running out of heap, and you either have to re-architect your application (as we did) or give up on Chrome."

    https://bugs.chromium.org/p/chromium/issues/detail?id=416284#c5

    Thanks!
     
    Last edited: Sep 9, 2023
    LooperVFX likes this.
  3. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    LooperVFX likes this.
  4. ARealiti

    ARealiti

    Joined:
    Oct 4, 2013
    Posts:
    132
    I think we did, but I remember the biggest problem was that Unity embedded WebGL could not interact with the web page natively in Javascript, you had to use these Unity player calls and it was really a bit of a bad experience, web developers are really against it and it was very heavy with no ability to do components, this along with other storage issues made it a no starter for commercial/corporates. I hope Unity will understand that there is limited use just embedding a monolithic application in the browser compared to something that interacts directly with Javascript / HTML on an SPA in a PWA fairly natively like a REACT/Angular component.
     
  5. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @ARealiti WPAs and everything else you're talking about have nothing to do with WebGPU, which is just a graphics API that can be used by the web player. Having a separate thread talking about these general web platform issues you're having would be more appropriate.
     
    LooperVFX and De-Panther like this.
  6. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    32
    Organizational question: are these changes planned for Unity 2023.3 or is there still hope that this could happen with Unity 2023.2 despite the fact that the beta is well advanced?
     
  7. AlenPiktiv

    AlenPiktiv

    Joined:
    Jul 12, 2023
    Posts:
    1
     
  8. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    32
    Any news about this series of updates ? :)
     
  9. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @Zarbuz Been fighting getting a mega WebGPU update PR merged into the main branch for quite a while, and it's finally looking like it will be merged today (knock on wood). The updates will get into the 2023.3 branch, unfortunately I don't think we will be able to get them put into 2023.2. We'll have more updates since this mega PR was put together too, and continue getting them put into 2023.3, hopefully with much less hassle going forward.
     
  10. keepingitneil

    keepingitneil

    Joined:
    Dec 7, 2014
    Posts:
    1
    Would WebGPU after these changes work with the unity graphics for entities package (relies on compute shaders)?
     
    Last edited: Oct 3, 2023
  11. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @keepingitneil I have not tested that yet, I'll add it to my list. What I've found to be a frequent problem is that WebGPU still has some limits and format restrictions that are considerably lower than other platforms, and these cause a number of issues for a lot of Unity's systems. We are pushing on the spec and browsers to relax these limits to allow more things in Unity to work.

    For example, internally we recently got VFX Graph working on WebGPU (yay!). But the limit on the number of storage buffers allowed in a compute shader in WebGPU severely cripples it. We're pushing on the spec to increase that limit, and that would enable more things that currently fail to run on WebGPU.
     
    Thaina, keepingitneil and Zarbuz like this.
  12. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    32
    This is a very exciting news ! Thank you for all your hard work ! Can’t wait to try it !
     
  13. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,049
    As VFXGraph are in preview for mobile anyway. In the same sense I wish unity would just release VFXGraph for webgpu as is. And we can face any limitation in the meantime
     
  14. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @Thaina The changes we made for VFX Graph will be pushed out in the near future. Because I'm pushing this stuff out under the radar, it won't be in release notes, but I'm all for people having access to experiment and play with it.
     
    Thaina likes this.
  15. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
  16. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @KamilCSPS I can't make any promises, but I hope so at some point.
     
    KamilCSPS and Zarbuz like this.
  17. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,049
    Thank you very much
     
  18. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    I don't have to say it to you but for the sake of anyone in this thread; generally speaking, alleviating CPU-bottlenecks on thWeb platforms is basically the holy grail of performance improvements due to the single-threaded limitation of it.
     
  19. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    32
    Does this mega branch got merged ? :)

    Also, do you know if a Unity blog post is planned about the development progress of the integration of WebGPU into Unity ? I’m very interested of the different challenges you have encountered.
     
  20. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @Zarbuz The last mega PR was merged; it has a bunch of updates, but certainly won't fix everything, and I have another one in the works. I don't follow the release schedule of 2023.3 builds, so I don't know when things roll out to the public builds. We've been working in a development branch and pushing things into the main branch, to make development easier and faster. Unfortunately there is no public way of tracking what is fixed or still broken for now, or when things are pushed out, anything pushed into 2023.3 is as-is with no guarantees. But I still think it's beneficial to make the development available to everyone, and I've purposefully been as open and honest as possible answering questions here, while trying my best not to promise things we won't be able to deliver. It's much easier to ship something after it's production ready than while it's in development. There are plenty of challenges, both for Unity features to get working and limitations of the WebGPU spec. We are working on a blog post.
     
    Blarp, ivank, Thaina and 4 others like this.