Unity WebGL and WebGPU for 3D product configurators in the browser
Unity can build a 3D product configurator that runs inside an ordinary web page, with no download or plug-in: in Unity 6.6 you build for WebGL2, which works in most browsers, and can add WebGPU where browsers support it. The choice between them matters less than you might expect. Baked lighting and a phone’s memory limits apply to both, and they shape the design far more.
WebGL2 and WebGPU in Unity 6.6
Unity’s web platform offers two graphics APIs, the layer through which software asks the graphics card to draw. WebGL2 is the default graphics API, “compatible with most devices and browsers” and based on OpenGL ES 3.0 functionality.
WebGPU is the newer option, and it runs on DirectX 12, Vulkan or Metal underneath, depending on the device. That gives it features WebGL2 cannot offer, including:
- Compute shaders, which run general calculations on the graphics card
- Indirect rendering, which lets the graphics card work out what to draw without waiting for the processor
- GPU skinning, which deforms animated meshes on the graphics card instead of the processor
- VFX Graph, Unity’s tool for large particle effects
Async compute, dynamic resolution and cubemap arrays are still missing.
Unity 6.3 labelled WebGPU experimental, and its 6.3 manual says it is “not supported by all browsers and devices.” In the 6.6 pages that label has gone, but the comparison table still lists “Limited browser and device support”. Visitors might need to enable WebGPU in their browser settings, “some texture formats and other extensions aren’t available on Safari or Firefox”, and Unity falls back to a compatibility mode with stricter limits on older devices that can’t support the core WebGPU specification.
| WebGL2 | WebGPU | |
|---|---|---|
| Status in Unity 6.6 | Default, enabled automatically | Must be enabled; limited browser and device support |
| Underlying technology | OpenGL ES 3.0 functionality | DirectX 12, Vulkan or Metal, depending on device |
| Compute shaders, indirect rendering, GPU skinning, VFX Graph | Not available | Available |
| Global illumination | Baked only, non-directional lightmaps | Baked only, non-directional lightmaps |
| URP deferred rendering | Deferred and Deferred+ not available | Deferred+ available |
WebGPU is never switched on for you. You add it to the Graphics API list in Player settings; Unity tries the first API on the list and, if the browser can’t support it, falls back to the next. Unity’s advice is that “it’s useful to keep both because not all browsers support WebGPU”, and it is frank about the cost: “You need to create extra code to cater to 2 different graphics APIs, which makes it more complex to develop and test.”
For a product configurator, WebGL2 is the version that has to look right, because it is the one most visitors’ browsers and devices can run. WebGPU earns a place at the top of the list when a specific feature needs it, such as VFX Graph particles or a heavily animated product that benefits from GPU skinning, and from then on every option in the range is checked under both.
How the 3D view talks to the rest of the page
A browser configurator does not have to draw everything inside Unity. The option lists, price, basket and checkout can be ordinary HTML and JavaScript, with the Unity canvas drawing only the product. Unity’s web development page illustrates the idea with a 3D Room Designer whose HTML and JavaScript front end “communicates with the Unity Web Player”. The two sides talk through the browser’s JavaScript engine, in both directions.
For messages from the page into Unity, the recommended route is SendMessage, and Unity’s own example is “a JavaScript UI element that triggers a Unity behaviour”: a colour swatch or a size button, in configurator terms. SendMessage only accepts methods with no parameter, one string or one number. If a choice carries several values, pack them into one short JSON string and unpack it in C#:
// In the page: the visitor picks oak for the seat
unityInstance.SendMessage("Configurator", "ApplyOption",
JSON.stringify({ part: "seat", finish: "oak" }));
[System.Serializable]
public class OptionChoice { public string part; public string finish; }
public class Configurator : MonoBehaviour {
public void ApplyOption(string json) {
var choice = JsonUtility.FromJson<OptionChoice>(json);
// swap the material on choice.part to choice.finish
}
}
In the other direction, C# calls JavaScript functions held in .jslib plug-ins, JavaScript files compiled into the build, which Unity says are useful because “you might need to communicate with other elements on your web page or Web APIs”. If a visitor clicks a handle on the 3D model, a one-function plug-in can tell the page:
// Assets/Plugins/Configurator.jslib
mergeInto(LibraryManager.library, {
ReportPartClicked: function (partPtr) {
window.dispatchEvent(new CustomEvent("partclicked",
{ detail: UTF8ToString(partPtr) }));
}
});
[DllImport("__Internal")]
private static extern void ReportPartClicked(string part);
The page listens for that event, highlights the matching option and updates the price. Keeping the build’s code in its own scope lets you embed it without clashing with the page’s code, and even put more than one build on a page.
Keep prices, stock and basket logic in the web page and the back end behind it, and a price change becomes a website update, not a new Unity build: the message into the 3D view only ever says which part and which finish.
Lighting, lights and fonts: the limits that shape the design
The biggest design constraint is lighting. Unity Web supports baked global illumination only, not real-time, and only non-directional lightmaps. Global illumination is the light that bounces between surfaces; baking it means calculating it in advance and storing it in textures called lightmaps. Baked light suits a product shown in a fixed studio set. It does not follow an object, so a configurator that lets visitors move a sofa around a room or switch between lighting scenes needs that planned from the first sketch.
Colour and material swaps are the core of a configurator, and they sit awkwardly with baked light, because a lightmap records how a surface looked at the moment it was baked. One approach that fits the web’s limits is to bake only the environment (the floor, walls and set) and light the product itself another way. Light probes sample the baked light at points in space and apply it to objects that move or change; reflection probes give glossy finishes something to reflect. One or two real-time lights on the product add highlights that respond to each new finish. Every material in the range then needs checking under that set-up, because a matt fabric and a polished chrome react very differently to the same probes.
Real-time lights are rationed too. In a staff reply on Unity’s official render pipeline post, Oliver Schnabel of Unity writes that “On web platforms URP uses a much lower default for visible additional lights per camera than the 256 on desktop”. The reason he gives is that neither browser graphics API promises more shader capacity than a phone offers. URP is the Universal Render Pipeline, one of Unity’s sets of rendering code, and additional lights are any beyond the main one. Two separate caps apply. Per camera, the web default is far below 256; the post puts no number on it, so check what your target browsers actually light before committing to a rig. Per object, URP’s standard Forward mode lights each object with at most eight additional lights, on WebGL2 and WebGPU alike. Forward+, a mode built to handle many lights more efficiently, removes that per-object cap on both. Deferred and Deferred+, which light the scene in a separate pass after the geometry is drawn, are not available on WebGL; WebGPU gets Deferred+.
For a configurator started now, the same post points to URP. It says the Built-In Render Pipeline “will be obsolete and removed in Unity 7.0”, while remaining supported through the 6.7 LTS releases until the close of 2028, or of 2029 under Extended Support.
A few smaller limits matter too. Unity Web cannot use fonts installed on the visitor’s machine, so every typeface has to ship in the build. Unwanted shader variants (compiled versions of a shader for different feature combinations) waste the limited memory and should be stripped out. A “save my design” button needs more thought on WebGPU, which has no synchronous readback: the browser won’t let the build pause and copy the finished image straight back from the graphics card. ScreenCapture.CaptureScreenshot and similar functions therefore fail there, and the image has to be captured with ScreenCapture.CaptureScreenshotIntoRenderTexture and read back with AsyncGPUReadback, collected once the readback completes, which belongs in the estimate.
Memory, download size and mobile browsers
Memory is the other limit that applies whichever API draws the scene. “Memory constraints in Unity Web can restrict the complexity of the content you run,” says Unity’s memory page, and the amount available varies by device, operating system, browser and how the browser handles tabs. The heap, the block of memory the build works in, can grow by itself, but if the browser can’t find a single unbroken stretch of memory for the bigger heap, the application can crash. So keep the heap as small as possible. Default settings suit desktop; mobile browsers need the advanced tuning options in Player settings, starting with the initial memory size, which is best set from what the build actually uses on the target phone.
A budget only works if it is measured, and on the right device. Pick the least powerful phone the brief has to support and measure three things there: the compressed download size, the time until a visitor can first interact on a mobile connection (and again from cache), and peak heap use. Agree targets for all three before modelling starts. Divided across the range, they give the 3D artists a polygon count and a texture allowance in megabytes per product variant.
How the range splits for download is the real configurator decision. AssetBundles, packages of assets that download separately from the main build, let you choose when each part arrives and when it is unloaded. One bundle per product family is a natural split: the build opens with the family the visitor came for, and the next downloads only when they choose it, then unloads when they move on. Whatever stays in the main build goes into the .data file, the assets packed into the initial download, and Unity advises keeping that uncompressed file as small as possible because it costs both download time and memory. Data Caching then stores asset data on the visitor’s machine, so a returning visitor doesn’t download it again.
For texture compression, Unity says you might want two builds, one for desktop and one for mobile. Compressed formats let the graphics card read textures without unpacking them first, which saves memory, but desktop and mobile graphics chips understand different ones. Unity’s texture compression page suggests DXT, the format desktop graphics chips support, and ASTC, the format phone chips support. The page decides which to load before Unity starts, by asking the browser whether it can read ASTC:
const gl = document.createElement("canvas").getContext("webgl2");
const astc = gl && gl.getExtension("WEBGL_compressed_texture_astc");
const buildUrl = astc ? "Build/mobile" : "Build/desktop";
// pass the file names under buildUrl to createUnityInstance
If a device lacks native support for the format it receives, Unity decompresses in software: “your application still works, but it uses more memory and might run slower.” WebAssembly64 raises the heap ceiling to 16 GB, but Unity says to use it only above 4 GB, and a phone-targeted configurator should sit far below that.
Ethereum Towers: one world in a headset and a browser
Ethereum Towers is a metaverse world of 4,388 apartments across 202 floors. We built it from one Unity codebase as a VR world for Meta Quest headsets and a browser-based WebGL companion. The browser half is a WebGL companion to the headset world, and it is the part that bears on a configurator. Our WebGL and interactive websites page sets out what we build for the browser.
Questions to settle at discovery
Discovery is the first stage of any project with us, where we ask the questions that decide the scope. For a browser configurator, these are worth answering before any 3D work starts, the first above all, because changing it once modelling has begun means redoing the environment and every material:
- Whether the lighting can be fixed and baked, or products must move between lit scenes
- How many products, variants and options there are, and how they combine (this sets the size of the asset library and how it splits into AssetBundles)
- Where the 3D models come from: existing CAD files that need converting and simplifying for real time, or new models built from photos and drawings
- Who updates the models when a product changes, and how a new variant reaches the live configurator
- Which browsers and devices it must run on, and whether phones are in scope (this decides the texture builds and memory tuning)
- Whether any feature needs WebGPU, or WebGL2 covers everything the customer sees
- Which messages pass between the HTML page and the 3D view, and whether each fits in a single string or number
- Whether the visitor needs to save or share an image of their design
A working prototype lets you test the answers before committing to full development. Built around the product with the hardest finishes, polished chrome beside matt fabric for instance, and run on the least powerful phone in the brief and a desktop browser, it shows whether the baked set and probes hold up, what the download and peak heap come to on that phone, and whether the messages between page and 3D view carry everything the options need.
If you have a product range you would like to put in a browser, tell us about it.