feat(texture): multi-view bake consistency — seed lock, color match, seam feather#732
Conversation
… seam feather Makes the front/back (and any N) views of a multi-view bake look like one coherent texture instead of independent diffusion runs. - Seed lock: generateMeshTextureMultiView picks ONE positive seed and passes it to every view's generateMeshTexture, so all views share the same denoising trajectory (closest hue/lighting/style). SDManager::generateMeshTexture gains an optional `seed` arg (>=0 overrides the stored/random seed; -1 = unchanged). - Color match: MultiViewTextureBaker shifts each later view image's per-channel mean to the FIRST view's mean before baking (Options::colorMatchToFirstView, default on), killing the global hue/brightness jump across the seam. Mean is computed over non-background pixels; correction is a gentle additive shift. - Wider seam feather: default Options::facingPower lowered 1.0 → 0.5 so front and back cross-fade over a band near the silhouette rather than switching hard. Unit test added for the color-match shift. Color-match math validated standalone (dark back image mean lifted exactly to the front mean). App + UnitTests build clean; SD-driven generation stays #ifdef-guarded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 49 minutes and 29 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d74203f889
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sr += qRed(c); sg += qGreen(c); sb += qBlue(c); ++count; | ||
| } | ||
| } | ||
| if (count == 0) return Ogre::Vector3(0.5f, 0.5f, 0.5f); |
There was a problem hiding this comment.
Avoid defaulting valid white references to gray
When the first generated view is a legitimate near-white material (for example snow, white ceramic, or a white-painted mesh), the filter above can skip every sampled pixel as background, so this fallback makes the reference mean mid-gray. Because colorMatchToFirstView is now enabled by default, any later view with slightly darker white surface pixels will be shifted down toward gray, creating the same kind of cross-view brightness jump this feature is meant to remove; consider disabling matching when no foreground mean is found or using a better foreground mask.
Useful? React with 👍 / 👎.
|



Follow-up to the multi-view AI texture bake (#729). Makes the per-view images read as one coherent texture instead of independent diffusion runs, so front/back don't show a style/colour jump at the silhouette seam.
Changes
generateMeshTextureMultiViewpicks ONE positive seed and passes it to every view's generation, so all views share the same denoising trajectory (closest hue/lighting/style).SDManager::generateMeshTexturegains an optionalseedarg (>=0overrides the stored/random seed;-1= unchanged) — the single-view path is unaffected.MultiViewTextureBakershifts each later view's per-channel mean to the FIRST view's mean before baking (Options::colorMatchToFirstView, default on). Mean is computed over non-background, non-near-white pixels; correction is a gentle additive shift (avoids the contrast over-stretch of a full mean+std match). Kills the global hue/brightness mismatch across the seam.Options::facingPowerlowered 1.0 → 0.5 so front and back cross-fade over a band near the silhouette rather than switching hard.Why seed+color+feather (not
ref_imagesyet)The literal "back uses front as context" is sd.cpp's reference-image path (
ref_images[]). The field exists in the build but isn't wired, and its payoff depends on an empirical model test. This trio is the safe, high-leverage fix with zero sd.cpp risk;ref_imagesis scoped as a follow-up if style drift remains.Testing
#ifdef ENABLE_STABLE_DIFFUSION-guarded (no model in CI), matching AI: Mesh-aware texture generation (depth-conditioned sd.cpp) #403/feat(texture): multi-view AI texture bake (front+back projection onto UV0) #729.🤖 Generated with Claude Code