Skip to content

R1.v: reduced base takes the albedo correction (reducedCorrection: 'match') - #118

Open
DennisSmolek wants to merge 1 commit into
mainfrom
issue-55-reduced-correction
Open

DennisSmolek wants to merge 1 commit into
mainfrom
issue-55-reduced-correction

Conversation

@DennisSmolek

Copy link
Copy Markdown
Member

Part of #55 (R1.v, DIVERGES V555 / V556).

What changed

  • PtMaterialOptions.reducedCorrection: 'none' | 'match' (bsdf/adapter.ts). Default 'none': every kernel and image unchanged (V214 stands). 'match' multiplies the reduced Lambert lobe by the same fitted base correction c(r, mu_o, base Ri) that the full albedo layering applies (only when the full material has one and the interface is rough). No new fit was needed: the reduced Lambert weight is the layered diffuse albedo, so scaling it by the full material's own correction makes the albedos agree.
  • The reduced adapter carries its own copy of the 8x8x3 table (1.9 KB unminified WGSL, only with match), so the wavefront secondary shade kernel needs no new binding.
  • Bench: pt_lod_corr=match, renderer ids pt-mk-lod-corr / pt-wf-lod-corr, lod-check corr=1 gatenone=0 cases=..., matrix.ts --no-lock (correctness-only runs).

Verified

  • node bench/size-snapshot.ts before/after: 355 files, diff -rq empty (default kernels byte-identical).
  • pnpm typecheck (only the known @pmndrs/vdb errors), vitest bsdf/lod.test.ts wavefront/lod-wgsl.test.ts (20 pass; new: reduced albedo with match within 3% + 0.005 of the corrected full quadrature, TS twin vs WGSL table and interpolation, none text unchanged).
  • Furnace node bench/runner/run.ts --page lod-check --no-lock --args spp=512 corr=1 gatenone=0 (depth 0, whole-sphere mean, reduced vs full albedo layering with the D32 default correction), none -> match: grey 0.8 r0.3 +5.15% -> +0.07%, r0.6 +39.9% -> +0.08%, red r0.3 +2.5% -> +0.25%, metal-mix +6.2% -> +0.06%, fuzz over layered +4.0% -> +0.9%, coat r0.3 +1.4% -> -0.6% (slight over-correction). Wavefront = megakernel per pixel (relMSE <= 1e-13). Coated metals are unchanged (coated-gold-rough mismatch is R1c, not this).
  • Tier 1 A/B, 1024 spp, seed 3, depth 1, albedo layering (relBias / 32 px block max, lod vs full), pt-mk-lod -> pt-mk-lod-corr: ClearCoatTest-notex +0.01% / 2.07% -> -0.00% / 0.55%; SheenTestGrid-notex +0.29% / 6.90% -> -0.01% / 0.87%; MetalRoughSpheresNoTextures +0.16% / 3.76% -> +0.00% / 0.12%; IORTestGrid-notex-A, AttenuationTest-notex, ClearCoatTest-notex-metal unchanged. (Run on a loaded Mac, correctness only; no timings.)

A/B for the maintainer

node bench/adapters/matrix.ts --renderers pt-megakernel --scenes SheenTestGrid-notex,ClearCoatTest-notex --spp 1024 --name a --extra pt_layering=albedo,pt_lod=full,pt_seed=3 --no-lock
# same with --name b --extra pt_layering=albedo,pt_lod=secondary,pt_seed=3 and --name c ... ,pt_lod_corr=match
node bench/adapters/lod-agreement.ts --full a --lod b   # then --lod c: c should move toward 0

Decision left: make 'match' the default of mode: 'preview' / 'realtime' (quality says yes; the extra lookup timing is a QUIET-PASS row).

Left

Default flip; timing; R1c (coated rough metal) untouched.

🤖 Generated with Claude Code

…o correction (V555, V556); Tier 1 A/B, furnace, matrix --no-lock

Part of #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant