feat: ✨ WebGL graphics blog post, Gerber demo on landing page, open-source license notices

- Blog: porting-kicad-graphics-to-webgl post + GAL native/WebGL comparison images and <GalCompare>
- Landing page: embed lazily-loaded Gerber demo section + footer "Live demo" link
- Licensing: /licenses page (GPLv3 + wxWindows/LGPL-v2 breakdown, ahilss credit, corresponding-source offer) and a footer build-SHA link
- Docs: CLAUDE.md + README note to bump the hardcoded footer BUILD_SHA on each release

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-06-18 14:06:37 +02:00
commit 8b438b48b2
13 changed files with 403 additions and 14 deletions

View file

@ -1,22 +1,69 @@
---
title: "Porting KiCad's Graphics to WebGL with Claude"
description: "Coming soon."
pubDate: 2026-06-07
title: "Porting KiCad's Graphics to WebGL in 2026"
description: "How to make KiCad run in a browser pt. 1. Check the demo!"
pubDate: 2026-06-18
---
import GerberDemo from '../../components/GerberDemo.astro';
import GalCompare from '../../components/GalCompare.astro';
{/* TODO(author): intro — the gerbview port and the graphics-abstraction-layer → WebGL work. */}
# TLDR:
Coming soon.
I don't know much about graphics.
Back when it was still called GPGPU I did a CUDA class, but other than that I have no experience.
## See it run: a Gerber viewer in your browser
Then during porting KiCad I realized that I will need to run its graphics abstraction layer in the browser.
## Gerber viewer in your browser
The viewer below is KiCad's `gerbview` compiled to WebAssembly. Click to load it
(it streams ~22&nbsp;MB on demand) and it renders a real multi-layer board —
the [tiny_tapeout](https://tinytapeout.com/) demo — entirely client-side, with no
server doing the rasterization.
(it streams ~22&nbsp;MB on demand) and it renders a real multi-layer board:
the [tiny_tapeout](https://tinytapeout.com/) demo -- entirely client-side.
<GerberDemo />
# What did not work
First I just wanted KiCad to build with a WASM target.
It took a while, thankfully I've found https://github.com/ahilss/wxWidgets-wasm, a wxWidgets port for the web for an old version.
I've used that port as a starting point, but it missed a lot of features. After multiple lines of find-whats-missing and a lot of e2e tests with a lot of screenshots
I had a working~ish wxWidgets port, a good start.
Then it lot of corner cutting, lot of shimming things away that I wanted to work to make KiCad build. The first time the welcome dialog loaded I was happy, very happy, even though
clicks did nothing.
Then when I got through that eventually KiCad loaded up. It was horribly slow.
I had two main sources of errors: Asyncify and the OpenGL `-sLEGACY_GL_EMULATION` that made it possible to run OpenGL apps on the web.
Asyncify is a huge error source on its own, I wanted to get rid of all OpenGL errors ( and get some speed if possible ), so I have a chance to debug them.
The errors were an infinite loop of Emulation and WebGL sprinkled with some Asyncify interplay. I had no other option.
# Let's rewrite to WebGL!
Thankfully KiCad has a Graphics Abstraction Layer ( GAL ). There's already an alternative CPU renderer, an OpenGL one, let's do a WebGL one then!
I don't know OpenGL but there's Claude Code. So: the core idea was to create WebGL and native test apps that check each GAL feature, compare the screenshots to double check.
For the native GAL test apps I had to pull the headers inside KiCad from my test code, it needed a few shims ( KiCad usually brings the kitchen sink too ), but in the end worked.
At first I wanted to do byte-to-byte comparison but it is not possible ( AFAIK ),
the WebGL and OpenGL outputs will never be the same, but to a human eye they can look identical.
Here are two scenarios straight out of that regression suite -- the same GAL calls, drawn once by native OpenGL and once by my WebGL backend:
<GalCompare />
So in the end I relied on asking Claude to check the screenshots, prodding, checking again, but in the end I got two screenshots folders that looked the same.
Claude back then wasn't that good at understanding screenshots, sometimes LGTM'd totally black things, couldn't see colors, but it was still helpful.
# Moment of truth
And then I wired up my new WebGL GAL into KiCad and... It worked! And it was fast.
We want to upstream our changes eventually, I'm sure the fork needs a few changes, but it's not in a bad position already. The shaders stayed the same
( with the help of a GLSL 1.0 -> GLSL 3.0 ES transformer Python script ), the difference between the OpenGL and this version is a few hundred lines
of translation and emulation code ( for a few things you can't do in WebGL, no raw pointers, immediate mode for ex. ).
We don't want to dump this on someone, when that time comes I will need to understand the changes deeply and clean up the rough edges.
{/* TODO(author): the rest of the article. */}

View file

@ -0,0 +1,64 @@
---
title: Open-Source Licenses & Source Code
description: The open-source software PCBJam is built on, the licences that apply, and how to get the corresponding source code.
updated: 2026-06-18
---
## The short version (summary)
This summary helps you understand this page at a glance. It is **not a substitute** for the open-source licences themselves, which are what legally apply.
- **PCBJam runs open-source software in your browser.** The application is built on **KiCad** (the open-source EDA suite) compiled to WebAssembly, together with **wxWidgets** and other open-source libraries. Each stays under its own licence.
- **You have the right to the source.** Because we deliver GPL-licensed software (KiCad) to your browser, you are entitled under the GNU GPL to the **corresponding source code** for the version you receive. See [Getting the source code](#getting-the-source-code).
- **These licences are not changed by us.** Our [Terms of Service](/terms) govern the hosted PCBJam service and our own proprietary code; they do not modify or restrict your rights under the open-source licences with respect to the open-source components themselves.
- **Trademarks.** "KiCad" and related marks belong to their owners. PCBJam is an independent product built on KiCad and is **not affiliated with, endorsed by, or sponsored by** the KiCad project.
---
## Components and their licences
PCBJam is a combined work. The table below lists its principal open-source components and the licence that applies to each.
| Component | What it is | Licence |
|---|---|---|
| **KiCad** | EDA suite, compiled to WebAssembly — the core of PCBJam | **GNU General Public License, version 3 (GPLv3)** |
| **wxWidgets** (base) | Cross-platform GUI toolkit that KiCad uses | **wxWindows Library Licence v3.1** (LGPL v2+ with a binary-distribution exception) |
| **wxWidgets — WebAssembly port** | The browser/WASM platform layer, derived from [ahilss/wxWidgets-wasm](https://github.com/ahilss/wxWidgets-wasm) | **GNU Lesser General Public License, version 2 (LGPL v2)** — *without* the wxWindows binary exception |
| Other bundled libraries | Various supporting libraries used by KiCad | Their respective licences (Apache-2.0, MIT, BSD-3-Clause, Boost, CC0, ISC, CC-BY-SA-4.0, and others) |
The combined application is conveyed to you under the **GPLv3**. The wxWidgets components are GPL-compatible: the base toolkit's licence is explicitly compatible with GPL'd applications, and the LGPL v2 WebAssembly-port files may be combined into a GPLv3 work under the LGPL's terms.
> **Note on the WebAssembly port.** The wxWidgets WASM-port files (originally authored by Adam Hilss) are released under plain **LGPL v2 without** the wxWindows binary-distribution exception that the rest of wxWidgets grants. This does not affect your rights here — PCBJam is conveyed as open source under the GPLv3 regardless — but we state it so our notices are accurate. The unmodified wxWidgets base remains under the wxWindows Library Licence.
---
## Getting the source code
In line with the GNU GPL (and as referenced in §12.4 of our [Terms](/terms)), the complete **corresponding source code** for the GPL-licensed software we deliver to your browser — together with the applicable licence texts and notices — is publicly available in one place:
**<https://github.com/emergence-engineering/pcbjam>**
The KiCad and wxWidgets forks are included in that repository as **git submodules**, so a recursive clone fetches everything needed to build PCBJam:
```sh
git clone --recurse-submodules https://github.com/emergence-engineering/pcbjam.git
```
For reference, the component forks pulled in as submodules are:
- **KiCad fork** — <https://github.com/emergence-engineering/kicad-source-mirror> (branch `wasm-port`)
- **wxWidgets fork** (incl. the WebAssembly port) — <https://github.com/emergence-engineering/wxWidgets> (branch `wasm-port`)
The source corresponding to a specific deployed build is identified by the commit revisions — including submodule revisions — recorded in the application's **About / build information**. If you need the exact corresponding source for a build you received and cannot locate it, contact us at **hello@pcbjam.com** and we will provide it.
We do not claim ownership of, and do not purport to relicense, the open-source components.
---
## Full licence texts
- **GNU General Public License v3 (GPLv3)** — <https://www.gnu.org/licenses/gpl-3.0.html>
- **GNU Lesser General Public License v2 (LGPL v2)** — <https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
- **wxWindows Library Licence v3.1** — <https://www.wxwidgets.org/about/licence/>
Copies of these licences and the per-component notices are also included in the source repositories listed above.