<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged webgpu</title>
<link>https://coderlegion.com/tag/webgpu</link>
<description>Powered by Question2Answer</description>
<item>
<title>WebGPU for Browser Games: What Actually Changes From WebGL</title>
<link>https://coderlegion.com/29267/webgpu-for-browser-games-what-actually-changes-from-webgl</link>
<description>&lt;p&gt;Plenty of us here have shipped something on WebGL, a game, a visualization or a canvas experiment, and WebGPU now ships in Chrome, Edge, Firefox and Safari. Here is a practical look at what actually changes in your code and your frame budget when you move a browser game over.&lt;/p&gt;
&lt;h3 id=&quot;pipelines-instead-of-a-state-machine&quot;&gt;Pipelines Instead of a State Machine&lt;/h3&gt;
&lt;p&gt;WebGL inherited OpenGL's global state machine. You set blend mode, depth test and active texture on a shared context, then every draw call uses whatever state happens to be active, and the browser validates all of it again on each call. In a scene with thousands of objects, that CPU side overhead can cost more than the rendering itself.&lt;/p&gt;
&lt;p&gt;WebGPU moves that work to creation time. A render pipeline object bakes in the shaders, vertex layout, blend state, depth configuration and primitive topology once. At draw time you record commands into a command buffer and submit the whole batch. Benchmarks in this &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.abratabia.com/webgpu/&quot;&gt;guide to WebGPU for browser games&lt;/a&gt; show a scene going from 15,000 objects at 15 FPS under WebGL to 200,000 objects at a locked 60 FPS, with CPU usage falling from saturated to nearly idle.&lt;/p&gt;
&lt;h3 id=&quot;bind-groups-and-explicit-resources&quot;&gt;Bind Groups and Explicit Resources&lt;/h3&gt;
&lt;p&gt;WebGL binds textures and uniforms one call at a time through numbered units and locations. WebGPU groups buffers, textures and samplers into bind groups that attach to a pipeline as a single unit, so switching materials becomes one bind group swap instead of a dozen state changes. Buffer mapping replaces bufferSubData copies, and you decide when the CPU and GPU synchronize instead of the driver guessing for you.&lt;/p&gt;
&lt;h3 id=&quot;wgsl-and-errors-you-can-actually-see&quot;&gt;WGSL and Errors You Can Actually See&lt;/h3&gt;
&lt;p&gt;WGSL replaces GLSL with a stricter, Rust influenced syntax. Every variable has an explicit type, there are no implicit conversions, and resource bindings are declared with @group and @binding attributes that map straight to your bind group layouts. Shaders are validated when the module is created, so a type mismatch or out of bounds access shows up as a readable error instead of a black screen three frames later. WebGL errors, by comparison, stay silent unless you remember to poll getError.&lt;/p&gt;
&lt;h3 id=&quot;compute-shaders-in-a-game-loop&quot;&gt;Compute Shaders in a Game Loop&lt;/h3&gt;
&lt;p&gt;This is the part that changes what a browser game can do. Compute shaders run outside the render pipeline on plain storage buffers, with shared workgroup memory. A particle system can update millions of particles in one dispatch and render them straight from GPU memory with no CPU round trip. Cloth, soft bodies, fluid grids, procedural terrain and post processing effects like bloom and ambient occlusion all fit the same pattern.&lt;/p&gt;
&lt;p&gt;If you are not ready to write raw WebGPU, Babylon.js and Three.js both ship WebGPU renderers that fall back to WebGL automatically, which is the lowest risk way to start. Either way, the practical takeaway is to profile where your frame time goes today. If it is CPU side draw overhead or work you are faking with fragment shaders, WebGPU is worth the move.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/29267/webgpu-for-browser-games-what-actually-changes-from-webgl</guid>
<pubDate>Wed, 30 Sep 2026 15:55:25 +0000</pubDate>
</item>
<item>
<title>Choosing A Browser 3D Engine: Where PlayCanvas Fits</title>
<link>https://coderlegion.com/24260/choosing-a-browser-3d-engine-where-playcanvas-fits</link>
<description>&lt;p&gt;A lot of the browser 3D talk here defaults to three.js, and for good reason, but it is a rendering library rather than an engine and the gap shows up the moment you need scenes, physics and a build pipeline. This is a short breakdown of where PlayCanvas sits for anyone weighing that choice.&lt;/p&gt;
&lt;h3 id=&quot;the-runtime-is-small&quot;&gt;The Runtime Is Small&lt;/h3&gt;
&lt;p&gt;PlayCanvas ships under 300KB gzipped. It renders through WebGPU where the browser supports it, which is worth roughly 25 to 50 percent on complex scenes, and it falls back to WebGL 2 automatically rather than making you branch on it yourself.&lt;/p&gt;
&lt;h3 id=&quot;it-is-an-engine-not-a-renderer&quot;&gt;It Is An Engine, Not A Renderer&lt;/h3&gt;
&lt;p&gt;The architecture is entity component system. You compose entities from models, cameras, lights, physics bodies and scripts, which keeps a project navigable as it grows. Scripting is plain JavaScript and TypeScript, so there is no new shader language or build toolchain to adopt for normal work.&lt;/p&gt;
&lt;h3 id=&quot;the-editor-is-collaborative&quot;&gt;The Editor Is Collaborative&lt;/h3&gt;
&lt;p&gt;The editor runs in the browser and several people can work on the same scene at once, the way a shared document works. That removes the usual pain of syncing large binary assets through version control, which is where a lot of small teams quietly lose time.&lt;/p&gt;
&lt;h3 id=&quot;where-it-costs-you&quot;&gt;Where It Costs You&lt;/h3&gt;
&lt;p&gt;The cloud editor is the tradeoff. Your project lives on their infrastructure, and while the engine itself is MIT licensed, the editor workflow is the part you are buying into. If that matters to your team it is worth deciding early, rather than after the asset pipeline is built.&lt;/p&gt;
&lt;p&gt;Full write-up with the deployment and performance details: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.abratabia.com/playcanvas/&quot;&gt;PlayCanvas game development&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/24260/choosing-a-browser-3d-engine-where-playcanvas-fits</guid>
<pubDate>Fri, 07 Aug 2026 13:01:59 +0000</pubDate>
</item>
</channel>
</rss>