Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Early access to the new WebGPU backend in Unity 2023.3

Discussion in 'General Graphics' started by dnach, Nov 14, 2023.

  1. dnach

    dnach

    Unity Technologies

    Joined:
    Mar 9, 2022
    Posts:
    89
    Greetings from the Unity Graphics team.

    We’re excited to announce that starting with Unity 2023.3, the Unity Web Player now provides experimental support for the new WebGPU graphics API.

    The introduction of support for the new WebGPU API marks a significant milestone for web-based graphics acceleration, and paves the way for unprecedented leaps in graphics rendering fidelity for Unity web applications.

    In this post, we share some useful information on how to enable WebGPU, along with various guidelines and limitations that should be taken into account.

    WebGPU: The future of graphics and compute on the Web

    Widely adopted and supported by all major browsers, the WebGL 2.0 API is the industry standard for web-based real-time graphics applications. However, as WebGL shares much of the feature set of OpenGL ES 3.0, it isn’t able to leverage all of the capabilities present in modern GPUs.

    WebGL 2.0’s most notable limitation is lack of support for Compute Shaders, which are crucial for the mass parallelization and acceleration of general computations on the GPU. This shortcoming manifests as lack of support for newer (compute based) Unity features such as GPU Skinning, VFX Graph and more advanced GPU-driven rendering techniques currently in development. In turn, this significantly limits the scope and fidelity of Web-based Unity applications.

    Furthermore, WebGL is based on the stateful "bind-and-draw" design of the OpenGL API. Modern graphics APIs all provide a lower-level interface that exposes greater control over the graphics context, and reveals new opportunities for the acceleration of CPU and GPU performance.

    In order to address the limitations of WebGL, and enable the future of Web-based graphics acceleration, the W3 Consortium (with collaboration from industry leaders such as Google, Apple, Mozilla, Microsoft and Unity) recently published the specifications of the new WebGPU standard.

    WebGPU was designed with the goal of harnessing and exposing modern GPU capabilities to the Web. This new web API achieves this by providing a modern graphics acceleration interface that is implemented internally via native GPU APIs, such as DirectX12/Vulkan/Metal. The native implementation in use will depend on the browser’s platform and available graphics drivers.



    The new capabilities exposed by the WebGPU backend will unlock support for new and exciting rendering features, and enable a level of graphics fidelity previously unseen on the Web. Similarly to other modern graphics APIs, lower level control over the rendering setup and GPU execution unlocks new optimization opportunities, which could lead to reduced CPU and GPU overhead and improved throughput and latency.

    A good example is the case of Compute Skinning support (previously unavailable on Web platforms) which can significantly improve the rendering performance of complex and detailed skinned mesh renderers, by offloading vertex transformations to the GPU. In the following test scenario, the WebGPU backend was observed to run significantly faster compared to the WebGL backend, when rendering a large amount of animated character models::


    Compute Skinning in WebGPU (Click here to open a Web Player)

    Note:
    WebGPU support is currently limited to compatible desktop browsers. See the "Platform Support" section below for more information.


    WebGPU vs WebGL - Skinned Mesh Rendering Comparison​

    Another example is the introduction of Indirect Drawing support, which allows to procedurally generate geometry and drawing parameter data, directly within compute shaders. This technique can be used in order to massively-parallelize the transformation, culling, and rendering of complex geometries. This technique is often used when implementing advanced particle systems such as Unity’s own VFX graph. The following demo utilizes VFX Graph in order to efficiently simulate and render over a million particles:


    VFX Graph on WebGPU (Click here to open a Web Player) - Development in progress​

    Enabling the new WebGPU graphics backend

    Unity’s new WebGPU backend is in early access, and can be enabled by launching the Editor using the following Project Settings flag “webGLEnableWebGPU”:
    1. Navigate to an existing Unity project and open the ProjectSettings.asset file (located at <project folder>/ProjectSettings/ProjectSettings.asset) using a text editor.
    2. Search for a setting titled “webGLEnableWebGPU”:
    3. If found, change the line to “webGLEnableWebGPU: 1”.
    4. If not found, add a line “webGLEnableWebGPU: 1”. (This line can be added anywhere in the file, preferably next to other web-related settings.
    5. Open the project in the Unity Editor, using the latest 2023.3 release.
    The WebGPU backend should now be exposed in the Editor’s Player Settings. Follow the next steps for setting WebGPU as the target graphics API in use:
    1. Open the project’s Build Settings panel (“File”->”Build Settings”).
    2. In the Platforms list, select “Web” and then click “Switch Platform”.
    3. Open the project’s Player Settings panel (“File->”Project Settings”->”Player”)
    4. Under the “Other Settings” section, disable the “Auto Graphics API” checkbox.
    5. Add “WebGPU” to the Graphics API list, and set it as the first priority above WebGL.
    You can now build the web project as usual. The WebGPU graphics API will be utilized when running the build on a compatible device and browser.

    Platform support

    WebGPU’s specification has recently reached version 1.0, and active development is still ongoing. WebGPU is enabled by default today in Google Chrome on ChromeOS, Mac and Windows, and in Chrome Canary on Android.

    Browser support is still in development, and we only recommend using WebGPU with Chromium versions 119+ and later, on supported desktop platforms. Driver related issues were identified on older browser releases.

    Additional browsers (Firefox, Safari) may enable WebGPU via a developer flag. Please refer to the relevant browser’s documentation in order to determine support for the new graphics API.

    Guidelines and limitations

    Unity’s WebGPU graphics backend is still in development, and we do not recommend using it for production use cases. Support is currently limited to the Universal Render Pipeline:


    URP BoatAttack in WebGPU (Click here to open a Web Player)​

    When experimenting with the new backend, please bear in mind that the following key packages and features are not yet supported:
    • VFX Graph (In development)
    • Forward+ Rendering Path
    • Graphics Jobs
    • Dynamic Resolution
    • Entities and Entities Graphics
    • High Definition Render Pipeline (and it’s various features)
    • Async Compute API
    Additional features (not listed above) may be unsupported or unstable. Moving forward, we are working to stabilize and improve the performance of the new graphics backend. We eventually aim to provide compatibility for all features that could be supported by the new (and evolving) WebGPU standard.

    You can follow our progress via the public roadmap. If you cannot find the feature you are looking for, feel free to submit a feature request, or contact the team directly in the graphics forum.

    Please give the new WebGPU backend a try and let us know what you think!
     
    Last edited: Nov 15, 2023
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395
    I dont seem to get the option
    1. Add “WebGPU” to the Graphics API list, and set it as the first priority above WebGL.
    i followed all the previous steps and indeed it changes webgl to web, but i dont have this option, perhaps rather than "latest" 2023.3, it needs a more specific number as I have a13 which is the latest available to me?

    upload_2023-11-14_18-11-50.png

    upload_2023-11-14_18-12-29.png
     
  3. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @bugfinders After the project upgrades to 2023.3, edit the text file ProjectSettings/ProjectSettings.asset. Search for webGLEnableWebGPU. If it's there, change the value to 1. If it's not there, add the line webGLEnableWebGPU: 1, in the section with the other WebGL* settings. With that setting being set to 1, WebGPU should be available to you in the Graphics APIs list. It's a hassle, but a temporary hurdle while the WebGPU driver is in active development. The recommendation to use the latest builds of 2023.3 possible is because we're frequently pushing fixes and improvements.
     
  4. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395

    As i said I did that.. and NO it does not give me that option hence posting.
     
  5. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @bugfinders, sorry, didn't mean to imply you didn't, just trying to clarify what should be needed. I'm guessing things got into a weird state during the upgrade.

    To verify, can you do this with a new project? a13 is the latest public alpha, it will have WebGPU in it, and a14 will also be out soon. You can DM me to iterate on figuring out how to get you going.
     
  6. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    425
    Just tried it on 2023.3.0a13, following your instructions and was able to enable WebGPU without a hitch. Even changed an existing project to use WebGPU (rebuilt addressable + shaders) and it was plug & play.

    Bold comment is not required as the settings file will be automatically re-created and the line will be placed next to the other web settings... so it's moot.

    Overall, good job team!
     
    dnach and brendanduncan_u3d like this.
  7. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395

    thanks for the offer, coming your way cos this hates me.. (its ok i am used to it but im keen to see it work)
     
  8. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    Thanks for verifying, @KamilCSPS! And you're right about the moot point for the placement of the setting, I'm just paranoid ;)
     
  9. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Initial feedback - first, ProjectSettings/ProjectSettings.asset looked like this..
    ProjectSettings.asset.png
    ..i realized it was probably Project Settings->Asset Serialization->Mode set to Force Binary, so I changed that to Mixed, but didn't fix it. Then I switched to Force Text, let it reserialize everything and reimport, then I was able to edit the settings. Changed the property to 1, reopened editor, the WebGPU option was then available. Switched back to Force Binary and waited for everything to reserialize and reimport. Reopened editor, added WebGPU, removed WebGL 2, did a build (this being an 11.8 GB project - not including size of library - with 5 games to test). Opened the build in Chrome and... remarkably, only a few minor issues.

    Games are all playable, but,
    1) when going full screen, some textures that are smooth in WebGL are more pixelated in WebGPU.
    2) some textures that are read from and written to others using NativeArray end up grey instead of textured.
    3) renderScale doesn't seem to work properly when adjusted at runtime (shimmers pixels a bit while using an in-game slider between values of 0.5 and 2.0, but resolution doesn't look like it's changing).
    4) loading times are longer, some occasional hitching with new content coming into view that doesn't happen in WebGL (appears related to shader compilation, based on previous experience with similar problems). but performance overall seems similar.

    No exceptions in console, but a few interesting warnings, which might be connected to the above issues (this was just a quick initial test to see how things would go - not planning to distribute anything supporting WebGPU for another couple of years or looking into the issues further for now, mostly because i'm not doing anything that would benefit from WebGPU features at the moment).
    warnings.png

    Anyway, amazing that it's functional and all 5 games i test my primary framework with are actually playable! Great to see this so far along! :)
     
    rdjadu and Aarc like this.
  10. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    Thanks for the feedback, @adamgolden!

    1) Getting all of the texture filtering settings right is still something we're working through. Also, some texture formats that are filterable in WebGL aren't in WebGPU yet (via the spec). These things will improve.
    2) I'm not sure what you mean by read from, but if it's GPU readback to CPU memory, like Texture2D.ReadPixels, then the WebGPU spec does not support synchronous readback and you have to use AsyncGPUReadback. I'm still trying to figure out the best way to make using regular readback functions produce an error or warning rather than silently doing nothing.
    3) I'll make a note to look into renderScale.
    4) Google is working on optimizing the WebGPU shader compiler inside of chrome. These runtime hitches will magically get better over time as Chrome updates. We've been working very closely with Google on optimizing pipeline creations for content the size of Unity assets. Unity shaders are quite large compared to hand written WebGPU shaders.
     
    adamgolden likes this.
  11. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    For example, I allocate rectangles within an empty "texA", later populating those rects from other rectangles within "texB", "texC" etc., using NativeArrays like this,
    Code (CSharp):
    1. NativeArray<Color32> dataA = texA.GetRawTextureData<Color32>()
    2. NativeArray<Color32> dataB = texB.GetRawTextureData<Color32>()
    3.  
    ..then iterating through pixels within a given rect and setting corresponding pixel in the other texture's rect while doing that. In WebGL it works perfectly, but for some reason in WebGPU it's either not writing the pixels to the rect as expected, or [more likely] not reading the pixels from the rect in another texture, and I say more likely the issue is with reading because in one of my games i'm only writing pixels through the same process and it does work in WebGPU. so, somewhere is an issue, could dig and maybe figure out what - but i will just wait a while and see if it's better in the future, again not urgent / just wanted to take a quick run at this and see how everything went :)

    The texture filtering being at different levels of completion depending on format explains why the appearance of some textures was different between WebGPU/WebGL when in full screen. Also thanks for the other info and looking into renderScale.. and I say "that's all the testing I'm going to do!" ..but actually I will try again on occasion to see how it's going. Long term this is all very important stuff, but at the moment / in early days of WebGPU it's still mostly a curiosity (to me anyway).
     
  12. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    I just created a minimal repro for that, but it's actually working fine - not sure why it doesn't in my own projects (must be some combination of settings, or the texture filtering thing threw me off). so don't bother, thanks anyway though!
     
  13. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,133
    I would like to ask, is the VFX graph on the web will only work with webgpu right?

    Or would it also work with webgl mode?
     
  14. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @adamgolden If you can DM me a repo with your use of GetRawTextureData not working, I can look into it. I just did a quick test, copied the example from the GetRawTextureData docs, and it worked for me.

    WebGPU is still in the early days, but it will have a very important role in the future of graphics and computation on the web, so pushing its buttons and finding its quirks is useful.
     
    adamgolden likes this.
  15. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @Thaina VFX Graph will require WebGPU because it requires compute shaders. WebGL doesn't support compute shaders, so VFX Graph can't run on it.
     
    Thaina likes this.
  16. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Actually working on a repro for that right now :) the images I read are generated from base64 encoded strings, so may be somewhere else leading up to the point it's actually reading the pixels where it's different in WebGL vs. WebGPU. I'm in the process of taking minimum code into a fresh project and will post again when I work it out (or if I can't and the repro works fine through every step).

    So far I'm at the point in the repro where I am able to decode the image and assign it to a RawImage in WebGPU without issue. The next step is reading then writing to a new texture - if that works too, I think maybe what I will need to do is delete the Library folder of my project, reimport and rebuild and hope it just works lol ..wouldn't be the first time I was tracking down bugs that turned out to just be something wrong in Library after changing an engine version or whatever other significant things :p
     
  17. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Repro was fine but I found the cause while putting it together - as you originally mentioned it's a ReadPixels call at the root of this issue! I have a
    #if UNITY_WEBGL && !UNITY_EDITOR
    block used with WebGL only - I wasn't doing things the same way for other platforms, which I hadn't noticed earlier. I can do the same thing without using ReadPixels though (just NativeArray like the other platforms). I'll try unifying this part of my framework, hopefully no surprises (because I must have had a reason to do that platform-specific approach originally).
     
    bugfinders likes this.
  18. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Yes!! Okay, so everything is working now in WebGPU, at least they're not grey rectangles anymore - the reason I had switched to ReadPixels from only doing a NativeArray copy was a texture format issue, where I could avoid what looks like ARGB32->RGBA32 issue (texture channels mismatch). That's unrelated and something I will just have to solve properly.

    Also, it turns out [embarrassingly, given my previous post] I had also made the same change in the non-WebGL part and my assumption that it had something to do with reading then writing texture was just me not remembering what I had done :(

    So, thank you for all the responses and help @brendanduncan_u3d - this is a huge achievement for you guys, I can't believe it's actually all working, this is really impressive to see. Congrats and thanks again!

    Edit: Also solved format of source images thing:
    rgba32.SetPixels(argb32.GetPixels())
    :D
     
    Last edited: Nov 15, 2023
    dnach and brendanduncan_u3d like this.
  19. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395
    Thanks @brendanduncan_u3d who helped me with a couple of sticking problems..

    So on my dungeons game i got a mixed result - it loaded, but, while it said fps was about the same as webgl the movements etc were like it was really unhappy and like really lows fps feel.. i then wandered over to see my skele in a cage and the screen went black and well that was the end of that, it stayed black.. I will have to check but as far as i know it only uses simple shaders, so not sure whats going on... ah - had to turn some batching on, ok now it randomly goes black but you can move and get it often get it back.. so something odd but.. i wouldnt say the fps is higher.. but then im using the built in renderer due to some issues with urp light leaking..

    ok so when it goes black i get 80 bajillion messages of
    Validation: [Invalid BindGroup] is invalid.
    - While encoding [ComputePassEncoder].SetBindGroup(0, [Invalid BindGroup], 0, ...).

    for my next game (which is a gems game) - wont compile the shader is a shadergraph one, very basic.

    Shader error in 'Shader Graphs/graduating': error: struct member hlslcc_mtx4x4unity_ObjectToWorldArray not found (on webgpu)
    Compiling Subshader: 0, Pass: MotionVectors, Vertex program with INSTANCING_ON
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_MOTIONVECTORS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DOTS_INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING

    (see, Im cursed!)

    so having removed my graduating background, it compiled, but first swipe.. nope - hung... nope not hung, just not updating the tiles on the grid... oooh its like solving a rubics cube without sight only you dont know what the new gems are... awesome

    poke poke
    Error building Player: Shader error in 'Universal Render Pipeline/Lit': error: struct member hlslcc_mtx4x4unity_ObjectToWorldArray not found (on webgpu)
    Compiling Subshader: 0, Pass: MotionVectors, Vertex program with INSTANCING_ON
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_MOTIONVECTORS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DOTS_INSTANCING_ON LOD_FADE_CROSSFADE SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADD_PRECOMPUTED_VELOCITY _ALPHATEST_ON

    perhaps not...

    cant say i have had a lot of succes.. but i do look forward to seeing how it does

    PS - loaded the URP version of dungeons 100% same behavior (curious)
     
    Last edited: Nov 15, 2023
  20. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,992
    I expect Safari will have WebGPU enabled without the developer flag for the very first time no earler than the release of iOS 22 (~5 years from now). :rolleyes:

    Apart from that the next five years are going to be exciting for web developers! :)
     
    KamilCSPS and bugfinders like this.
  21. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @CodeSmile Apple is actively working on WebGPU, but good luck predicting which version they'll ship with! At least we'll be ready for when they do.

    Android WebGPU can be tested now, using Chrome Canary and enabling WebGPU in the flags, and will ship in the release version of Android Chrome in January or so.
     
    CodeSmile, adamgolden and bugfinders like this.
  22. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,992
    I bet they'll hurry up now thanks to my sarcastic remark! :D
     
  23. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    269
  24. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    This is super exciting :D

    I've managed to do all the steps but I also get the same error @bugfinders get:

    Code (CSharp):
    1. Error building Player: Shader error in 'Universal Render Pipeline/Lit': error: struct member hlslcc_mtx4x4unity_ObjectToWorldArray not found (on webgpu)
    2.  
    3. Compiling Subshader: 0, Pass: MotionVectors, Vertex program with INSTANCING_ON
    4. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_MOTIONVECTORS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    5. Disabled keywords: DOTS_INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADD_PRECOMPUTED_VELOCITY _ALPHATEST_ON
    I'm using URP 17.0.0, Unity 2023.3.0a3, and here are URP's dependencies:
    upload_2023-11-16_6-50-24.png

    EDIT: This error only appears when I try to "Build and Run", when I tried only to Build it will build the game, but it will only run a black screen, the following errors will appear on the console:
    Code (CSharp):
    1. ERROR: Shader
    2. Web GPU.framework.js.br:4294 Hidden/Universal Render Pipeline/Edge Adaptive Spatial Upsampling shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    3.  
    4. Web GPU.framework.js.br:4294 ERROR: Shader
    5. Web GPU.framework.js.br:4294 Hidden/Universal/HDRDebugView shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    6.  
    7. Web GPU.framework.js.br:4294 ERROR: Shader
    8. Web GPU.framework.js.br:4294 Hidden/Core/ProbeVolumeDebug shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    9.  
    10. Web GPU.framework.js.br:4294 ERROR: Shader
    11. Web GPU.framework.js.br:4294 Hidden/HDRP/ProbeVolumeOffsetDebug shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    12.  
    13. Web GPU.framework.js.br:4294 ERROR: Shader
    14. Web GPU.framework.js.br:4294 Hidden/HDRP/ProbeVolumeSamplingDebug shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    15.  
    16. Web GPU.framework.js.br:4294 Input Manager initialize...
     
    Last edited: Nov 16, 2023
    bugfinders likes this.
  25. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,133
    Apple is the enemy of open web standard. The evidence in webxr un-development is clear. I bet they will try to stall webgpu on ios as long as possible
     
    Todd2014 likes this.
  26. fbeaufort

    fbeaufort

    Joined:
    Nov 16, 2023
    Posts:
    1
    Blarp likes this.
  27. nostalgicbear

    nostalgicbear

    Joined:
    Mar 21, 2013
    Posts:
    99
    WebGL is not supported on mobile devices in Unity. Will WebGPU be supported on mobile?
     
    Gamemakers3D likes this.
  28. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    425
    That's not true. It is. Officially too.
     
  29. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    269
    The boats demo works on safari on the iphone right now actually.
    IMG_6542.jpg
     
  30. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @Blarp It works on Safari / iPhone because that Boat Attack build is a hybrid build, with both WebGPU and WebGL. If the browser does not support WebGPU, it will fall back to WebGL.
     
    Blarp and Thaina like this.
  31. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @nostalgicbear
    Android has WebGPU available in beta right now. You can download Chrome Canary for Android, and enable WebGPU in chrome://flags. It is scheduled for public release in Chrome 121 (if I remember correctly), around January. iPhone support is pending Apple, who is actively working on WebGPU but as usual has no release schedule.

    WebGL is supported for mobile in current versions of Unity, i don't remember from which version right now.
     
    Thaina likes this.
  32. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,133
  33. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    Shader errors related to hlslcc_mtx4x4unity_ObjectToWorldArray have been fixed in an upcoming 2023.3 update (not sure which one will have it).
     
  34. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    Thanks for the reply. Can you please let us know when this comes out?
     
  35. adwood53

    adwood53

    Joined:
    Nov 11, 2017
    Posts:
    2
    Is there any plan to enable WebXR support using WebGPU?
     
  36. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,133
    There is request in webgpu itself and I think it should be supported in that first

    https://github.com/immersive-web/WebXR-WebGPU-Binding/blob/main/explainer.md

    But as far as I can see, unity did not officially support webxr in itself from its own XR package was the first blockade

    Fortunately we have great indy package here https://github.com/De-Panther/unity-webxr-export which is usable in the meantime. And I think this repo's owner will update this package to support webGPU if webxr binding itself finished
     
    Last edited: Nov 18, 2023
    De-Panther likes this.
  37. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @De-Panther has been doing a heroic and amazing job championing WebXR for Unity with his WebXR Export package, and we'll be more than happy to help get WebGPU running in it, once browsers themselves can support using WebGPU with WebXR (which they do not currently).
     
    Marks4, Blarp, Kabinet13 and 2 others like this.
  38. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395
    I found the problem had gone in a14
     
    brendanduncan_u3d and adamgolden like this.
  39. adwood53

    adwood53

    Joined:
    Nov 11, 2017
    Posts:
    2
    What is the reason for the Unity XR Interaction system being a 'Blockade' as @Thaina so put it? I believe WebXR should be supported by the XR Providers for WebGL and be updated for WebGPU in the future, instead of third-party tools like the one from @De-Panther . I'm sure I misunderstand the complications of this, but could you answer why Unity does not have WebXR Providers for the XR System?
     
    Thaina likes this.
  40. Landa-100

    Landa-100

    Joined:
    Sep 9, 2018
    Posts:
    72
    upload_2023-11-18_1-17-31.png
    It works
     
    brendanduncan_u3d likes this.
  41. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    @adwood53 The XR team is responsible for the XR Interaction system, and whether that works or not for WebXR is a completely separate issue from the topic of WebGL / WebGPU. I know most people at Unity want it all to work, but it's always a matter of picking battles with each teams limited resources. None of it is for lack of want. Personally, I really hope Apple gets in the WebXR game because that would be a huge incentive for department leads to want to invest in that instead of something else. It's easy to come up with theories, or conspiracies, about what Apple is doing or not doing, but all any of us can do is just continue to push on them to do it (for general web and not just Vision Pro).
     
    De-Panther likes this.
  42. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    406
    For historical interest, here is the very first triangle rendered with Unity WebGPU! As they say, the first triangle is always the hardest. It has come a long way since then, and I'm looking forward to the continued work to improve it!
     

    Attached Files:

  43. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395
    only a developer can understand the joy that 1 triangle brought..
     
  44. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    587
    Hey,
    I'm back from Unite2023 and I see people here mentioned me and WebXR in a WebGPU post.

    So first, I want to say kudos to the Unity Web team for the efforts of enabling WebGPU. I follow this forum, and got to see the works of the team and Brendan on other sites as well, and it's very impressive.

    The move from "Unity WebGL" to "Unity Web" is great. It will help to explain that WebGL is just one Web API, same as WebGPU, Web Audio, WebXR and others.

    As commented before, Unity Web depends on the availability of related Web APIs.
    So WebXR+WebGPU support depends on the specs of such an option, and the implementation in browsers.

    It seems like Unity make lots of efforts in web, and the team got more members now. Which is great news IMO. The session about the web platform at Unite2023 was full, and I hope it'll give Unity more insentive to invest in the web platform.

    Regarding official support of Unity in WebXR, it's something that I would also want to see, but if there's a choice between improving Unity Web performance (both load times and runtime) vs adding more features like WebXR, I prefer they'll focus on performance.

    I got to talk with some XR developers from Unity, and it seems like most of the XR APIs are now open to use by 3rd parties, so input handling in WebXR using Unity's Input System similar to other supported XR platforms is something achievable (and I'm working on it for the next version of WebXR Export, video at https://twitter.com/DePanther/status/1723549798786126038 test build at https://de-panther.github.io/unity-webxr-export/XRInteractionToolkitDemo/ and guide at https://github.com/De-Panther/unity...Documentation/Using-XR-Interaction-Toolkit.md ).
    Only thing which requires better collaboration would be the rendering.

    WebXR is different from other XR platforms in some core parts, so it does require some extra work over the similar implementation of the OpenXR package.
    But the OpenXR package, and recent changes in XR Interaction Toolkit and AR Foundation to generalize AR/MR input on both flat screens and headsets make some of the difficult parts more on par with WebXR capabilities and use cases.

    All in all I think the Unity Web platform is in a good direction. And I'm really excited about the WebGPU implementation
     
  45. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    42
    With this announcement, does it means we will have soon the list of improvements/fix about WebGPU in the changelogs of future alpha/beta or it's too soon ?
    In any case, I wanted to thank the entire Unity team for the immense efforts for this port. The first tests are really impressive.
     
  46. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,948
    Great news, would love to know if a webXR and an AR app can now be done from WebGPU project - one project one web deployment, run everywehere (mobile phone, XR, AR etc)


    As always your posts and assessments are spot on @De-Panther and you are a very welcomed part of the WebGL, Web and XR community here on the forums mate
     
    De-Panther likes this.
  47. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    587
    As mentioned on previous comments, no. Not right now, as there are still works on the specs and no implementation in browsers yet.

    Thanks❤
     
    MadeFromPolygons likes this.
  48. JamesA24

    JamesA24

    Joined:
    Sep 6, 2018
    Posts:
    28
    Hey! I saw a post on Linkedin about the new WebGPU features coming to a later version of Unity. (Later than the version I'm currently using).

    I'm curious about the state of "Web" in general. I work at a studio that previously made games for WebGL and released them on Facebook. Having access to a platform like Facebook made it easy to build up an audience for that platform. However, Facebook stopped accepting new submissions as of the end of 2020. There are alternatives like hosting a web game on your own website. But building an audience that will go to your website regularly to play is much harder than just continuing to support the same products on mobile.

    In general, I'm not all that aware of the state of web gaming, or web development. So hearing about this news caught me by surprise. So not to repeat myself, but what is 'web' looking like these days? What are the goals with new updates to enhance graphics for web purposes? And how does it stand against this other push to turn most things into an application you access instead of a website?
     
  49. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,395

    well you surely advertise your games in the games you did on fb, and on your fb games paage, so they go to your site and play?
     
  50. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    Thanks, that indeed works. The game builds correctly, but when it runs it is only a black screen with the same errors I mentioned on my previous message...
    Everything runs fine in the editor.