Skip to content

feat(wasm): migrate advanced renderer to @fastled/gfx - #3621

Merged
zackees merged 1 commit into
masterfrom
feat/gfx-package-migration
Jul 13, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/gfx-package-migration

Conversation

@zackees

@zackees zackees commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • migrate the default/advanced WASM renderer to the shared @fastled/gfx 0.1.0 release artifact
  • retain gfx=0 as the fast 2D fallback
  • use the same adapter in the OffscreenCanvas worker and remove the superseded Three.js renderer
  • pin Three.js 0.183.2, compatible with the package

Validation

  • npm run typecheck
  • npm run build

Coordinated with zackees/ledmapper#345. Package release: https://github.com/zackees/ledmapper/releases/tag/gfx-v0.1.0

Summary by CodeRabbit

  • New Features
    • Updated the default WASM graphics renderer for improved shared rendering support.
    • Added support for rendering through the new graphics engine, including screen maps, frame updates, bloom effects, and canvas management.
  • Bug Fixes
    • Improved background frame handling by transferring captured frames to the main thread for recording.
  • Refactor
    • Replaced the previous default renderer while retaining fast-renderer behavior when explicitly selected.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9abaec00-5934-4007-b7e1-3a5df3091ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 606ac51 and 7fe82f7.

⛔ Files ignored due to path filters (1)
  • src/platforms/wasm/compiler/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • src/platforms/wasm/compiler/index.ts
  • src/platforms/wasm/compiler/modules/core/fastled_background_worker.ts
  • src/platforms/wasm/compiler/modules/graphics/graphics_manager_gfx.ts
  • src/platforms/wasm/compiler/modules/graphics/graphics_manager_threejs.ts
  • src/platforms/wasm/compiler/package.json
  • src/platforms/wasm/compiler/types.d.ts

📝 Walkthrough

Walkthrough

The WASM graphics pipeline replaces its default ThreeJS renderer with a new GraphicsManagerGfx adapter backed by @fastled/gfx. Screenmaps and frames are normalized for the shared core, public declarations are updated, and related ThreeJS implementation code is removed.

Changes

WASM gfx renderer migration

Layer / File(s) Summary
Gfx adapter and frame pipeline
src/platforms/wasm/compiler/modules/graphics/graphics_manager_gfx.ts
Adds screenmap conversion, RGB8 frame combination, lazy gfx-core initialization, bloom configuration, and cleanup APIs.
Default renderer wiring
src/platforms/wasm/compiler/index.ts, src/platforms/wasm/compiler/modules/core/fastled_background_worker.ts, src/platforms/wasm/compiler/modules/graphics/graphics_manager_threejs.ts
Routes the default compiler and worker renderer paths to GraphicsManagerGfx, removes the ThreeJS manager, and updates recording workflow comments.
Public declarations and package setup
src/platforms/wasm/compiler/types.d.ts, src/platforms/wasm/compiler/package.json
Exports and types GraphicsManagerGfx, updates the global manager type, adds @fastled/gfx, and updates ThreeJS versions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WASMWorker
  participant GraphicsManagerGfx
  participant GfxCore
  participant Canvas
  WASMWorker->>GraphicsManagerGfx: updateScreenMap(screenMapsData)
  GraphicsManagerGfx->>GfxCore: normalize screenmap and initialize core
  WASMWorker->>GraphicsManagerGfx: updateCanvas(frameData)
  GraphicsManagerGfx->>GfxCore: combine and forward RGB8 frame
  GfxCore->>Canvas: render frame
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gfx-package-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant