the-future-of-web-gaming-unity-6-advancements Technologies

The Future of Web Gaming: Unity 6 Advancements and Web GPU Revolution

Unity’s latest advance in web gaming technology sees WebGL renamed to “Unity Web.” The firm wants to distance the WebGL technology and Unity Web but prepare for the future where rendering standards will not exist in singularity. With Unity 6, developers can create builds on WebGL, Web GPU, or both.

The new Unity 6 is an awesome enhancement to the web. The new functionalities comprise the addition of SIMD for faster CPU code, multi-threading via C++ for better usage of native code, and Next Gen WASM that doubles the RAM limit from 2GB to 4GB, bringing web runs closer to native mobile ones.

Maybe mobile web support is the most awaited feature. Unity 6 onwards, Unity projects work anywhere web view works on mobile, including iPhones running Safari. Developers have the option to run their games directly in the browser or embed them in web views inside native apps or use the Progressive Web App template for a more native app experience.

Optimizing Web Games for Success

When developing for the web, load time is critical. The platform presents challenges and opportunities, especially in user engagement. Study findings show that asking people to install apps significantly reduces user engagement. Thanks to the web we can bypass that hurdle and connect with the consumer directly.

Some games are better suited to the web environment than others. Casual and hyper-casual games with low file sizes do extremely well because they have faster loading times. A further great approach is taking a snippet of a bigger game, like a tutorial or first level, making a different web build to afford a frictionless first time user experience before converting them to the app stores or Steam.

To distribute a web game successfully, developers need to optimize the game specifically for the web. Furthermore, the developer should place the game where users are already spending their time. Web-based games can find a good home on platforms like Crazy Games, Facebook Instant, and Discord Activities.

Web GPU: The Next Generation of Web Graphics

Web GPU is a great development in the field of Graphics. WebGPU is a thin layer that sits above native modern graphics APIs like Metal, Vulkan, and Direct3D12, that exposes functionality not available in WebGL. Such enhancements can lead to improved performance and new game features.

Web GPU does not replace WebGL, rather they are being developed in parallel. WebGL’s established history ensures broad device compatibility while Web GPU opens up exciting possibilities as it matures.

Key Benefits of Web GPU:

1. Functions that can be dispatched to the GPU for massively parallel execution. As a result, tasks ordinarily assigned to the CPU can now be executed swiftly on the GPU with very little CPU overhead.  Particle systems particularly benefit from this technology.

2. An improved rendering system, specifically Forward+ rendering in URP which is primarily meant for the web now including other rendering systems it also has gotten rid of the restrictions on lights per object due to older forward rendering systems.

3. Web GPU is designed to grow in the future to have capabilities WebGL could never have like multi-threaded rendering.

Real-World Performance Improvements:

  • Skinning is done on the CPU with WebGL, whereas Web GPU moves the skinning computations to the GPU via compute shaders. When we put this to the test, 30 animated characters went from 7 FPS to 30 FPS.
  • The particle and effect system that uses compute shaders a lot is now web-enabled, allowing for millions of points that are animated in real-time at 120 FPS.
  • You can control the drawing operations of the GPU from a buffer and thus it helps in generating meshes procedurally without the involvement of the CPU device.

Web GPU Browser Support

Web GPU is quickly becoming compatible with browsers on different platforms.

  • Windows browsers like Chrome and Microsoft Edge have Web GPU enabled by default.
  • Devices running Android 12 or above that also have good Vulkan support have Web GPU enabled on by default. 
  • Chrome uses Metal to implement Web GPU for macOS. Safari Technology Preview has Web GPU on by default, full support for Safari is expected soon.
  • The implementation of Web GPU in iOS 18 is under a settings flag within Safari. The Linux one still experimental with Vulkan implementation.
  • Firefox is constantly being developed.

Project Prismatic: Web GPU in Action

Project Prismatic is the demonstration of how Web GPU can create high-fidelity FPS right in the browser. To create a direct-to-consumer experience that doesn’t sacrifice visuals or gameplay, the development team focused on four focal points; excellent onboarding, engaging gameplay, unique console-like features and user interaction.

We aimed for 60 FPS on mid-range hardware with great visuals as per target specs. Using the Web GPU way and the game’s traditional AAA production pipelines, the game was made more realistic through compute shaders, GPU skinning and VFX graph.

Overcoming Technical Challenges:

1. The artists utilized matte paintings to create large vistas. Also, a node based occlusion culling system was used that divided the game level into hexagonal cluster grids, creating dynamic sandbox types without affecting gameplay and also allowing some intent to draw calls and rigging what is onscreen.

2. The original build was 400MB. But after texture atlasing and other tricks, it is only 29.75MB. The team applied addressables and the UGS pipeline to import assets on the go, streaming in and out content when needed.

3. The job system was used to parallelize computation, and the VFX Graph pushed as much as possible on the GPU to free CPU resources.

Impressive Results:

  • 60 FPS on mid-level hardware in Chrome on desktop PCs.
  • Initial payload size of just 29.75MB.
  • Boot time of under 2 seconds from clicking a link to seeing the Unity splash screen.

The Road Ahead

Unity is more invested than ever in web development. With mobile web support in Unity 6 and Web GPU on the horizon, we can expect consumer expectations regarding what’s possible in the browser to shift. Web GPU is still experimental. But it proves there is a future for frictionless high quality web gaming that has direct access to their consumers.

Leave a Reply

Your email address will not be published. Required fields are marked *