Repository navigation
feat(blur): blur only the background and give the outline a smooth, tight edge - #2
Merged
Merged
Conversation
The first blur rung keeps the person out of the blurred background, so the outline no longer carries a halo of the person's colours. The mask is eroded before compositing, so the sharp area hugs the body.
Average the eroded mask over a small diamond so the model's coarse steps become a soft ramp, widen the feather and raise the threshold so the sharp area hugs the body, and stop the mask upsampler from following camera colours: that guidance pulled similar-coloured background next to the person into the mask.
The erosion and smoothing taps now run in one half-resolution pass into an r8 texture; the masked downsample and the composite read it with a single tap each. Same output, and the frame's GPU time is back to what it was before the outline work.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the "scattered" look of background blur: a halo of the person's colours around the outline, a blocky stair-stepped edge, and sharp background left next to the person. Same GPU cost as before.
Changes (shared core, so native and web both get them)
Measured
Web, Chrome on an Apple GPU, minimal-react against a sandbox room, 1280×720, camera-capped at 24 fps. GPU time is the full effect per frame (segmentation, blur, composite):
Background sharpness (edge energy at 1/10 resolution) drops from about 40 to 22 while the person columns stay unchanged; no WebGPU errors. Close-ups show a smooth outline with no halo and the door frame blurred up to the hair.
Not run on a phone this round (no device at hand); the change is in the shared core with no platform-specific code.
Version bump left out on purpose; release as 0.1.2 when you want.
https://claude.ai/code/session_01FWRoR5MneE6GE9crQ9tF6W