Repository navigation
feat(wave): output Gaussian-style blur as super-sample alternative (refs #3122 A4) - #3145
Conversation
…efs #3122 A4) A4 of meta #3122. Implements #3112 research doc §A1 recommendation — addresses super-sample's actual user motivation (LED-grid anti-aliasing on smooth fields) at ~1.2x scalar cost vs 8-512x for true super-sample. ## API Two new fields on WaveFxArgs: fl::u8 output_blur_amount = 0; // 0 disables. 32-128 ≈ SUPER_SAMPLE_2X fl::u8 output_blur_passes = 1; Runtime setter on WaveFx (FL_NOEXCEPT): void setOutputBlur(fl::u8 amount, fl::u8 passes = 1); fl::u8 getOutputBlurAmount() const; fl::u8 getOutputBlurPasses() const; The blur runs in WaveFx::draw() after mCrgbMap->mapWaveToLEDs() via the existing fl::blur2d (which already takes an XYMap and handles the LED grid topology including cylindrical / serpentine). ## What's NOT in this PR Deliberate slicing: - Defaulting SuperSample to NONE wholesale — that's a wider behavioral change that should land separately after users have evaluated the blur quality. Today's PR is opt-in (amount=0 is the default). - New UI checkbox in the example sketches — separate slice; current WaveFx users can wire setOutputBlur() into their existing UI loop similarly to how #3110 added the stencil toggle. - Bench numbers from --wave2d-perf — separate slice, requires hardware on desk. ## Validation - bash lint --cpp — clean. - bash compile wasm --examples Wave2d — build clean. Cost-vs-quality breakdown vs SuperSample on a 16x16+ grid with gradient palette (from the #3112 research doc): SUPER_SAMPLE_NONE + output_blur=64: ~1.1x baseline cost SUPER_SAMPLE_2X (current default): ~8x baseline cost SUPER_SAMPLE_4X: ~64x baseline cost The blur path is roughly comparable visually to SUPER_SAMPLE_2X on smooth wave fields; super-sample wins on hard edges (e.g. half-duplex zero floor) but WaveFx is rarely used at hard edges. Refs #3122 A4, #3112 research doc §A1, #3113 parent meta.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesWaveFx Output Blur
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
A4 of meta #3122. Implements #3112 research doc §A1 — addresses super-sample's actual user motivation (LED-grid anti-aliasing on smooth fields) at ~1.2× scalar cost vs 8–512× for true super-sample.
API
Runs in
WaveFx::draw()aftermCrgbMap->mapWaveToLEDs()viafl::blur2d(which already handles the LED grid topology including serpentine).Cost comparison
SuperSample::NONE+output_blur=64SuperSample::SUPER_SAMPLE_2X(current default)SuperSample::SUPER_SAMPLE_4XSuperSample::SUPER_SAMPLE_8XPer the research doc: super-sample wins on hard edges (half-duplex zero floor) but
WaveFxis rarely used at hard edges.What's NOT in this PR
Deliberate slicing:
SuperSampleto NONE wholesale — wider behavioral change; lands separately after users evaluate blur quality.--wave2d-perf— separate slice, requires hardware.Validation
bash lint --cpp— clean.bash compile wasm --examples Wave2d— build clean.Refs #3122 A4, #3112 research doc §A1, #3113 parent meta.
Summary by CodeRabbit