Repository navigation
OpenPBR: stochastic coat / transmission weight blend (default stays threshold) - #129
Open
DennisSmolek wants to merge 1 commit into
Open
DennisSmolek wants to merge 1 commit into
DennisSmolek wants to merge 1 commit into
Conversation
…-V614), default stays threshold PtMaterialOptions.weightBlend 'stochastic' takes a fractional coatWeight / transmissionWeight layer with probability = weight from its own sampler pair, so the expectation is OpenPBR's linear mix. Both schedulers; ReSTIR and materialLod 'secondary' refuse it. Default kernels byte-identical. Checks: weight-blend-check page, openpbr-check adapter twin, unit tests, wblend-* scenes vs pbrt mix / Mitsuba blendbsdf. Part of #55. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part of #55 (materials) / #52 (maps).
What
The OpenPBR-mode adapter cut a fractional
coatWeightandtransmissionWeightat 0.5 (found by PR #122, its V576): a coat of 0.3 rendered as no coat, 0.7 as a full one. OpenPBR mixes linearly.PtMaterialOptions.weightBlend: 'threshold' | 'stochastic'(bench:pt_weight_blend=stochastic).'stochastic'draws two numbers per shading point from their own sampler pair (ptWeightPair, 2^30 + vertex: x transmission, y coat) and takes the layer with probability = weight, so the expectation is the linear mix; weights 0 and 1 stay exact. Same model as the metalnessmixpick: a fixed function of the vertex's numbers, so NEE and MIS see the same lobe set as the BSDF sample.threshold: all 355 existing kernels ofnode bench/size-snapshot.tsare byte-identical (6 new*wblend*files; +0.23 KB on the all-features megakernel).materialLod: 'secondary'refuse it (clear error): the reservoir target / reduced adapter would need the same pick. The legacy adapter (noopenpbrmaterial) has no per-vertex random number and is unchanged, as is its metalness threshold.ptMaterialFeatures(table, { weightBlend })compiles lobes for any weight > 0.Verified (M5 Pro, load 37-53, correctness only)
--page weight-blend-check(spp 128): coat sphere (diffuse and metal) at w 0.25/0.5/0.75 vs(1-w)A(0) + wA(1)per mu_o bin: max abs 0.0007-0.0015 (threshold 0.024-0.099). Thin sheet w 0.25..1 vsw T' L: max abs 1.6e-4 (threshold 0.23). Megakernel vs wavefront per pixel: max rel 5.5e-7.--page openpbr-check: stochastic adapter WGSL vs TS twin, 140 cases (5 new fractional materials), 0 mismatches; default mode still 0.weight-blend.test.ts) + the touched bsdf / integrator / wavefront / restir / exporter tests pass.pnpm typecheck: only the known@pmndrs/vdberrors.wblend-coat/-glass/-sheet; exporters write pbrtmixand Mitsubablendbsdf; refs 4096 spp, ours 1024 spp), relBias vs Mitsuba / pbrt:Wavefront vs megakernel per pixel (
pt-wavefront-agreement.ts): max rel 2e-6 / 3e-6 / 0.A/B for the maintainer (default flip)
Read relBias and relMSE vs the references; the cost is variance from a binary pick per vertex. No timing claims (0.08 ms/spp on the sheet in both modes, loaded machine).
Open
ReSTIR / reduced adapter with the pick stored; a weight-map scene once #122 lands; spec-form coat scaling (V613). V614 notes a knife edge at exactly 0.5 in the default mode (f64 features vs the unorm16 record).
🤖 Generated with Claude Code