Public access to WebGPU (experimental) in Unity 6.1

Greeting from the Graphics team,

We are happy to announce that Unity 6000.1 introduces public access for the WebGPU graphics API, in experimental state. To learn more about WebGPU, we recommend you check the initial announcement: Early access to the new WebGPU backend.

You can experiment by fetching the URP 3D Sample project from the Unity Hub, which now works with the WebGPU API. To do this, we recommend you follow these steps:

  1. Open the Build Profiles menu, and switch to the “Web” platform. Disable all scenes except “OasisScene”.
  2. Navigate to Project Settings-> Player and disable “Auto Graphics API”. Add WebGPU (experimental) and move it to the top of the graphics API list.
  3. Navigate to Project Settings-> Quality and set the quality level to either “Mobile High” or “PC Low”.

You can now build a Web Player for the Oasis demo, using WebGPU:


Getting started with WebGPU:

Before getting started with WebGPU, please check the new documentation pages, which cover the various limitations and best practices: Unity - Manual: WebGPU (Experimental)

Following this change, you can now find WebGPU in the Player Settings for the Web Player, alongside the older WebGL API:

  1. Open the project’s Build Profiles panel:

“File”->“Build Profiles”

  1. In the Platforms list, select “Web” and then click “Switch Platform”.
  2. Navigate to the Player Settings panel:

“Edit”->“Project Settings”->“Player”

  1. Under the “Other Settings” section, disable the “Auto Graphics API” checkbox.
  2. Add “WebGPU” to the Graphics API list, and set it as the first priority above WebGL:


Platform Support

WebGPU browser support is still in development, and your mileage my vary. As of December 2024, the following browsers are known to provide WebGPU support, in their latest versions:

  • Windows: Chrome, Microsoft Edge
  • macOS: Chrome
  • Android: Chrome

Additional browsers provide experimental support for WebGPU, using an optional feature flag. We recommend you track WebGPU browser support here: https://caniuse.com/webgpu


We will continue to improve WebGPU stability and performance, working towards production readiness as soon as possible. One key improvement in Unity 6, is support for the SRP Batcher to ensure optimal CPU performance during rendering.

To test these improvements, we collaborated with Stratton Games to develop “Project Pristamic”. This case-study takes advantage of the unique benefits of WebGPU, with an emphasis on Compute, to parallelize heavy calculations on the GPU and improve both performance and fidelity. VFX Graph was utilized to render complex visual effects, while conserving memory by reducing the need for pre-rendered assets:

webgpu-projectprismatic
Project Prismatic - Unite 2024 Demo

We recommend you check the latest WebGPU session from Unite 2024, presented by @brendanduncan_u3d and our friends from Stratton Games: Better in a browser: Big advances for gaming with Unity Web | Unite 2024


Please give this a try in Unity 6.1, and let us know what you think :slight_smile:

As always, 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.

31 Likes

This is HUGE for Web Games!

1 Like

Hats off to the Unity team for this great achievement :raised_hands:

@dnach Did you host the build somewhere to test it out on browsers?

1 Like

Hello Unity 6.1 WebGPU Team…
I have been looking forward to the new WebGPU system for a long long time…
You guys rock!!!
I have run through the “Oasis” WebGPU tutorial after running through the previous Unity 6 version "CockPit"WebGL tutorial (Great Documentation!) and found it very easy to set up and build and run! But I did then need to crunch the original “Oasis” 6.1 build from 449 meg down to 59 meg. Then, I was able to add the build to unity.play…|
She looks great and runs well through unity.play
Thanks sooooo much!!!

1 Like

My scene is a 3D scene. When I use version 6000.0.30f1 to build the WebGPU version, the frame rate is not much different from WebGL(40-50fps)Are there any rendering settings that need to be adjusted? I am using the default mobile_renderer and have changed the render path to Forward instead of Forward+ .
Additional explanation:
It might be that the use of volumetric lighting caused the performance drop. However, doesn’t WebGPU accelerate the computation of volumetric lighting?

1 Like

Will Unity support WebGPU subgroup operations? (Chrome Platform Status)

Ping @brendanduncan_u3d ?

1 Like

@Zarbuz That’s the plan, it’s on the todo list. They were only just recently added to the spec.

2 Likes

Hi everyone,

With Unity 6.1 and official WebGPU support just around the corner, I’ve been going through the documentation and the list of current limitations:
:backhand_index_pointing_right: Unity - Manual: Limitations of the WebGPU graphics API

While it’s a great starting point, I noticed that a few features I’m particularly interested in are not explicitly mentioned as supported or unsupported. I’d really appreciate any clarification from the devs or anyone who has already experimented with the beta builds.

Specifically, does Unity 6.1 with WebGPU support the following:

  1. Graphics.DrawMeshInstancedIndirect – Is it available and functional with WebGPU?
  2. Adaptive Probe Volumes (APV) in URP – Are APVs supported under WebGPU in URP?
  3. Forward+ rendering path – Is Forward+ supported on WebGPU? And by extension:
  4. GPU Resident Drawer – Can it be used when targeting WebGPU?

Thanks in advance for any insights or confirmations! It would help a lot in planning our rendering strategy moving forward.

Cheers!

May I ask if playing VideoClips without URL workaround is/will be/can be supported in WebGPU?

Safari 26 will enable by default WebGPU :partying_face: (on all devices)

5 Likes

Hello, I across this HDRI Dome Rig on github and I’m trying to get to run on webGPU with Unity 6.1.
codewings/Unity-HDRIBackdrop: HDRIBackdrop in Unity

It’s running on shader 4.5 so it can’t run on webgl. I was hopeful it would work on WebGPU, but to avail it shows grey. The hdri was set to AST HDR 8x8 at 1024.


We are triggering some low level crashes in Chrome on Mac.

When they happen the tab crashes with “Aw, snap! Error 5”.

Only on Mac, not on every machine but on the ones it does happen on it is frequent. Latest Chrome. We don’t have reproducible steps, they seem to happen randomly. The only thing we noticed is they often trigger when spawning and destroying a bunch of sprite renderers (for emoji). But they happen independently of that as well.

Using Chrome debug symbols and the crash dump, we got the error and the stack trace of the crash, and it seems it’s a Chrome thing.

@brendanduncan_u3d are you still able to forward this to someone at Chrome working on WebGPU? I remember in the old WebGPU thread you said you could. That would be great!

I have attached the crash dump to the post. Exact Chrome version of it is: v137.0.7151.104

Unmagled stacktrace:

* thread #1, stop reason = EXC_BREAKPOINT (code=1, subcode=0x1249b153c)
  * frame #0: 0x00000001249b153c Google Chrome Framework`blink::ExternalTextureCache::ReferenceUntilGPUIsFinished(scoped_refptr<blink::WebGPUMailboxTexture>) + 280
    frame #1: 0x00000001249b11c0 Google Chrome Framework`blink::GPUExternalTexture::Destroy() + 112
    frame #2: 0x000000011af709a8 Google Chrome Framework`non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() + 1452
    frame #3: 0x000000011ce47ae0 Google Chrome Framework`base::MessagePumpDefault::Run(base::MessagePump::Delegate*) + 160
    frame #4: 0x000000011cd286d8 Google Chrome Framework`base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) + 452
    frame #5: 0x000000011cd27ea0 Google Chrome Framework`base::RunLoop::Run(base::Location const&) + 336
    frame #6: 0x000000011c9f4c24 Google Chrome Framework`content::RendererMain(content::MainFunctionParams) + 1164
    frame #7: 0x000000011d035a68 Google Chrome Framework`content::ContentMainRunnerImpl::Run() + 672
    frame #8: 0x000000011c59d7a4 Google Chrome Framework`content::ContentMain(content::ContentMainParams) + 1092
    frame #9: 0x000000011ae358d8 Google Chrome Framework`ChromeMain + 564
    frame #10: 0x0000000100cc89bc Google Chrome Helper (Renderer)`main(argc=15, argv=0x000000016f137708) at chrome_exe_main_mac.cc:212:8 [opt]
    frame #11: 0x000000019270c274 dyld

The code that crashes. Apparently CHECK fails on mailbox_texure being zero:

void ExternalTextureCache::ReferenceUntilGPUIsFinished(
    scoped_refptr<WebGPUMailboxTexture> mailbox_texture) {
  CHECK(mailbox_texture);
  ExecutionContext* execution_context = device()->GetExecutionContext();
  // If device has no valid execution context. Release
  // the mailbox immediately.
  if (!execution_context) {
    return;
  }
  // Keep mailbox texture alive until callback returns.
  auto* callback = BindWGPUOnceCallback(
      [](scoped_refptr<WebGPUMailboxTexture> mailbox_texture,
         wgpu::QueueWorkDoneStatus) {},
      std::move(mailbox_texture));
  device()->queue()->GetHandle().OnSubmittedWorkDone(
      wgpu::CallbackMode::AllowSpontaneous, callback->UnboundCallback(),
      callback->AsUserdata());
  // Ensure commands are flushed.
  device()->EnsureFlush(ToEventLoop(execution_context));
}

40619f33-4d60-48e5-92b2-02a8a9bf2d82.zip (81.1 KB)

1 Like

@zloph ASTC is a mobile or mac only compressed texture format. Windows doesn’t support it.

Cross platform (mobile v desktop) compressed textures is equally a pain with WebGPU as with WebGL. If you’re testing on Windows, you can use “RGB HDR Compressed BC6H” as an HDR compressed format. For public release, you’ll need to come up with a plan to use either ASTC or BC textures depending on the runtime platform, which unfortunately is still a pain point for web compressed textures (regardless of webgpu or webgl). Here is some docs on it, Unity - Manual: Texture compression in Web, though in my personal opinion it’s overly complicated to manage as a developer and something like Basis compression would be a simpler solution, and is something on our radar.

1 Like

@zhare86 I have direct and frequent conversations with the Chrome team and will bring this up with them. Thanks for the detective work so far!

@zhare86 if you have a repro I can get to Google, that will be helpful for them.

@zhare86 Chrome team said they’ve been getting some low frequency crash reports from this function for a while, and looking at it now that you brought it up it looks pretty straightforward how it could get in that state and they’ll get it fixed. They created a ticket for it here, Chromium, and said “thanks for the report”.

1 Like

OH, that might explain why I had problems with the textures way earlier, I was getting huge black volumes overtaking the screen. The error help I got was to change it to an ASTC setting that is divisible to your resolution so I thought I fixed it by setting it to AST HDR 8x8 at something like 1024 which worked by showing no more visual errors. Thank you for the advice, I updated everything to BC and saved a lot of build storage.

I also managed to fixed the HDRI Backdrop by converting it in shader graph and tweaking it to my needs.

You can see the game here. Running on WebGPU
Unity Play | Shoot Them Bugs game

Great. Since they have it in their tracker now, I will give them more info there. Thanks for forwarding it!

@zloph That is really fun, thanks for sharing!

1 Like