TASK 51 blur 'heavy' fix: quadratic blur radius. BlurRadius(strength) = 1 + 5s^2, MaxBlurRadius 12 -> 6 downscaled px (~24 full px max). Default 0.5 is now radius 2 small px (was the old linear 6) - ~3x lighter perceived spread, matching the creator's real-camera finding. Range from the established tools: StreamFX defaults its Box blur Size to 5 and its author stops downscale-based blurs around 8px. One integration test pins the mapping (0 -> 1, 0.5 -> 2, 1 -> 6) and step-edge behaviour (light reaches 9px at default vs 26px at full); the existing slice-2 blur test passes unchanged. 419/419 pass. Refs: https://github.com/Vhonowslend/StreamFX-Public/wiki/Filter-Blur https://xaymar.com/articles/2020/04/26/optimizing-streamfx-in-your-obs-scenes/ (Unit: bg-blur heavy fix)

This commit is contained in:
2026-10-10 07:08:01 -07:00
parent 305706956e
commit c2d64dcd6d
7 changed files with 124 additions and 44 deletions
+14 -8
View File
@@ -5,10 +5,11 @@
> This **reverses** the 2026-10-05 "background removal: out of product" exclusion (TASK 3 item 19).
**Status:** ✅ **Built 2026-10-09 — all five slices shipped** (engine, Blur, config + persistence,
camera hookup, UI). **Creator's real-camera check done 2026-10-09:** 🎯 **Remove "jittery" — FIXED**
(temporal mask smoothing, `MaskSmoother` — 0.75×new + 0.25×previous momentum, weights from the
OBS/Jitsi consensus); 🔶 **Blur "heavy" — the remaining follow-up** (next work unit, on the radius
curve in `BackgroundEffectProcessor.ApplyBlur`; documented below).
camera hookup, UI). **Creator's real-camera check done 2026-10-09 and both findings addressed:**
🎯 **Remove "jittery" — FIXED** (temporal mask smoothing, `MaskSmoother` — 0.75×new + 0.25×previous
momentum, weights from the OBS/Jitsi consensus); 🎯 **Blur "heavy" — FIXED** (quadratic radius curve,
max 12→6 small px, default 0.5 = 2 — StreamFX-consensus scale). **Pending: creator's recheck of both
on a real camera.**
**Goal:** per-webcam **Background Remove** and **Background Blur** on the live webcam layer,
selected per element in its properties panel, composited into stream + recording like any
@@ -123,10 +124,15 @@ delivery shape changed:
resets history; first frame passes through; no per-frame allocation (two ping-pong buffers — a
256×144 mask is 147 KB > the 85 KB LOH). Integration test: `CameraManagerTests.Temporal_Smoothing_…`
(two consecutive masks disagree at an edge → second frame keeps partial alpha where raw would cut).
- 🔶 **Finding: "blur is heavy"** — strength 0.5 ≈ radius 6 downscaled px ≈ **26 full-res px**, max
≈ 50 px (1+11·s at ¼ res, 3 box passes). **Next work unit:** soften the radius curve/range
(e.g. lower the strength→radius mapping, and/or a shorter maximum) — see
`BackgroundEffectProcessor` `MinBlurRadius`/`MaxBlurRadius`/`BlurDownscale`.
- 🎯 **Finding: "blur is heavy"** — the OLD curve was linear 1→12 downscaled px (≈ 26–50 full-res px),
far past any moderate background blur. **Fix shipped: quadratic radius** —
`BackgroundEffectProcessor.BlurRadius(strength)` = 1 + 5·s²: default 0.5 = 2 small px (≈ a third of
the old default's spread), max = 6 small px (≈ 24 full px). Why these numbers: StreamFX defaults its
Box blur Size to 5 and its author stops downscale-based blurs around 8 px (cited). Integration test
`BackgroundEffectEngineTests.Blur_default_strength_is_gentle_and_full_strength_is_strong` pins the
mapping (BlurRadius(0)=1, 0.5→2, 1→6) and the step-edge behaviour: default smears light ~9px into
the dark half vs ~26px at full strength. The existing slice-2 blur test (person sharp + checkerboard
smoothed) passes unchanged.
- ✅ `startup.log` perf line present on the real box ("background effects avg … ms/frame").
## Related (not duplicated here)