feat(sdf3d): triplanar PBR texture maps (albedo/metallic/roughness/normal/emission) - #355
Merged
Merged
Conversation
…rmal/emission) SDF3D can now take PBR material maps, projected triplanar in the SDF's local space — so a raymarched metaball gets real surface detail (normal/roughness/ metallic/albedo/emission) AND keeps the gooey smooth-union merge (no UVs needed). - Five texture INPUT ports mirroring Blender's Principled BSDF core: Base Color, Metallic, Roughness, Normal, Emission. Wire an Image/Video node into any of them; unwired ports fall back to neutral 1x1 defaults, so untextured SDF3D is the old look at zero cost (triplanar is gated off). - WGSL: triplanar sample + a whiteout normal blend (Ben Golus) so the normal map perturbs the lit surface; modulates base_color/normal/roughness/metallic/ emission at the ray hit. Two params: tex_scale (tiling) + normal_strength. - C++: repeat sampler + 5 fallback textures; group-0 bind group extended 4->10 entries and rebuilt when an input's view changes. Self-contained in SDF3D (Render3D only binds group 0 for custom raymarch fragments — no renderer change). - A port counts as connected only when it supplies a real (>1x1) texture: a disconnected texture port surfaces a non-null 1x1 default view, which would otherwise enable triplanar and zero the surface to black. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT
jeffcrouse
enabled auto-merge (squash)
August 16, 2026 15:53
Contributor
Production gate (core): ✅ PASS
|
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.
Adds PBR material-map support to SDF3D — so a raymarched metaball can carry real surface detail (normal / roughness / metallic / albedo / emission) and keep the gooey smooth-union merge. Triplanar-projected in the SDF's local space, so no UVs are needed and the texture survives the merge.
What it adds
Image/Videonode into any of them.tex_scale(tiling) andnormal_strength.Scope / design
sdf3d.cpp— no renderer changes. (Render3D only binds group 0 for custom raymarch fragments, so SDF3D owns its pipeline + a single group-0 bind group, extended 4→10 entries and rebuilt when an input's view changes.)Verification
Built locally and tested on the
blobdemo: the hero metaball renders as a bump-textured, PBR-lit surface with the gooey merge intact, while untextured metaballs light exactly as before.Follow-ups (not in this PR): AO + height ports; possibly an ADR note for the operator feature.
🤖 Generated with Claude Code