Skip to content

WebGL2 renderer backend #40

Closed
Closed

Description

@joeblau

Part of the percept.one parity roadmap. Do this last — only when the heatmap/footprint data volumes actually exceed Canvas2D throughput.

Problem

Renderer is Canvas2D-only (zero WebGL/WebGPU in src). Percept's headline claim is 10M+ points at 60fps via WebGL2. Canvas2D will degrade around ~50–100k points with a live heatmap layer.

Work

  • Abstract the render backend behind the existing Canvas2DLike seam (packages/chart/src/dom.ts:27)
  • WebGL2 backend: instanced quads for candles/heatmap cells, glyph atlas for text
  • Canvas2D kept as fallback (SSR, tests, workers)
  • Benchmark harness: fps vs point count, both backends

Completion audit

Completed by merged PR #41 plus PR #42. The backend seam supports Canvas2D fallback and WebGL2 instanced candle/heatmap quads. PR #42 adds an instanced glyph atlas for dense footprint bid×ask labels (axes/other text remain on Canvas2D), correct composited alpha, and a real Chrome backend benchmark at 1,000/50,000/144,000 retained depth points. The benchmark records CPU submission and animation-frame cadence for both backends, including a full 24-hour session. Chrome pixel checks verify glyph bounds, RGB, alpha, reuse and no GL errors at 1×/2×. See packages/chart/PERFORMANCE.md for raw results, limits and reproduction commands.

Validation: 1,855 tests pass with 100% line, branch and function coverage; all package entry points import; PR #42 test and documentation checks passed before merge.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    renderingRenderer architecture

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions