Skip to content

GPU Phase 3: FFT vertex buffer with heat map (#391)#701

Merged
ten9876 merged 2 commits into
mainfrom
feature/gpu-spectrum-phase3
Apr 4, 2026
Merged

GPU Phase 3: FFT vertex buffer with heat map (#391)#701
ten9876 merged 2 commits into
mainfrom
feature/gpu-spectrum-phase3

Conversation

@ten9876

@ten9876 ten9876 commented Apr 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

FFT spectrum rendering moved from QPainter overlay to GPU vertex buffer with per-vertex colors. Adds intensity heat map mode. CPU reduced from 35% (Phase 2) to 28% (Phase 3).

What Changed

  • FFT as GPU vertex bufferdrawSpectrum() removed from per-frame QPainter. Smoothed bins converted to (x, y, r, g, b, a) vertices, rendered as TriangleStrip (fill) + LineStrip (line)
  • Heat map mode (default ON) — intensity-based gradient: blue (weak) → cyan → green → yellow → red (strong). Toggle in Display overlay panel
  • Solid color mode — uses color picker + fill slider alpha (original behavior)
  • Vertex-colored shaders — no uniforms needed, colors baked into vertex data. Eliminates mid-pass uniform update issues across QRhi backends
  • Opaque band plan — pre-blends segment colors with dark background to prevent FFT fill bleed-through while maintaining license class contrast
  • Fill gradient — full alpha at bottom, 30% at spectrum line. Strong signals get solidly filled bars

CPU Progression

Stage CPU
Baseline (QPainter) ~97%
Phase 2 (GPU waterfall + overlay) ~35%
Phase 3 (GPU FFT + heat map) ~28%

Test plan

  • Heat map toggle works
  • Color picker works in solid mode
  • Fill slider controls opacity in both modes
  • Band plan colors unaffected by fill
  • Overlays render correctly on top

🤖 Generated with Claude Code

ten9876 and others added 2 commits April 4, 2026 16:17
FFT spectrum rendered as GPU vertex buffer with per-vertex colors.
No uniforms — colors baked into vertex data for reliable cross-backend
rendering (avoids mid-pass uniform update issues).

Heat map gradient based on signal intensity:
  blue (weak) → cyan → green → yellow → red (strong)
Fill gradient: intensity color at spectrum line fading to dark blue
at the bottom. Fill alpha controlled by the existing fill slider.

Eliminated drawSpectrum() from per-frame QPainter overlay. Static
overlay (grid, scales, markers) uploaded only when dirty.

CPU: 97% (QPainter) → 35% (Phase 2) → 28% (Phase 3).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Heat map toggle in Display overlay panel (defaults to ON)
  - ON: intensity gradient blue → cyan → green → yellow → red
  - OFF: solid color from color picker with fill slider alpha
- Band plan rendered fully opaque — pre-blends segment color with dark
  background to simulate transparency without FFT fill bleed-through
- FFT colors baked into vertex data (no uniforms) for reliable
  cross-backend rendering
- Draw order: waterfall → FFT fill → FFT line → overlay (band plan on top)

CPU: 97% (baseline) → 28% (Phase 3). 71% reduction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ten9876 ten9876 merged commit ffbbf9d into main Apr 4, 2026
2 checks passed
@ten9876 ten9876 deleted the feature/gpu-spectrum-phase3 branch April 4, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant