Building a high-performance 2D Editor with PixiJS (Blender/Figma UX). A Solo Dev's Journey.
Hi, PixiJS community! 👋
A little over a year ago, I started working on Ohae Editor — a heavy-duty 2D graphics editor for the web. I’m building it solo (though I actively use AI as a co-pilot for architecture and coding), and PixiJS is the absolute heart of the rendering engine.
(I’ve attached a video demonstrating the current progress — check out how the UI and canvas interact!)
Building complex tooling in the browser is notoriously hard. I want to share a few architectural decisions I’ve made over the past year. Hopefully, some of you might find this experience useful for your own projects.
1. Microkernel Architecture
The core of the editor actually does nothing. It only provides an event bus, a state manager, and a plugin loader. Everything else (tools, layer rendering, inspector) is a plugin communicating via a strict Service Locator. Any plugin can be hot-unplugged at runtime with zero memory leaks.
2. Why not React/Vue? (Custom UI & State)
To achieve a Blender/Figma-like UX, you need hundreds of inputs, accordions, and panels.
Building this inside PixiJS (on Canvas) is a nightmare for layout and text rendering. Building it on top with React kills your 60 FPS during Drag & Drop due to Virtual DOM overhead.
Ultimately, I wrote my own libraries: `@ohae/ui` (native Web Components) and `@ohae/state`. UI components subscribe directly to specific state paths. When you drag an object on the canvas, only the specific coordinate input updates, bypassing full-tree reconciliation.
3. Window Management & Surviving WebGL Context Loss
The editor features an N-ary BSP-tree window manager (just like Blender). You can infinitely split the screen into Canvases, Outliners, and Inspectors.
The neat trick: When you split a Canvas window, the DOM tree rebuilds. Normally, removing a node from the DOM destroys the Pixi.Application, causing a massive freeze. I solved this with an async garbage collector: when a node is detached, it waits 1 tick. If the node was simply reparented into a new splitter, the timer is canceled. The PixiJS canvas "jumps" to the new window instantly, without losing the WebGL context!
4. Pure Transform Math
Instead of nesting objects into temporary PIXI.Container`s for group scaling or rotation (which often messes up global coordinates), I moved all the math into a separate pipeline. The Gizmo calculates pure deformation matrices ($M = T_c \times B \times S \times B^{-1} \times T_{-c}$) and applies them to the objects' local properties. PixiJS is used strictly for the final render.
What's next?
I am currently pushing towards an MVP. Once the core features are polished, the entire project (the editor, the UI framework, and the state manager) will be released on GitHub, 100% free and open-source.
I’m really curious to hear the community’s thoughts:
How do you handle complex UI (inspectors, node editors) around your PixiJS projects?
Is a tool like this interesting to you? Would you like me to occasionally post devlogs and technical deep-dives here?
I’d love to hear any questions, feedback, or thoughts on the architecture!