Repository navigation
P5.s6: exact Airy thin film per wavelength in the spectral mode - #115
Open
DennisSmolek wants to merge 1 commit into
Open
DennisSmolek wants to merge 1 commit into
DennisSmolek wants to merge 1 commit into
Conversation
With integrator.spectral and a thin-film material the film Fresnel is the exact unpolarised Airy sum per wavelength lane instead of the Belcour-Barla RGB fit. Other kernels are byte-identical. lobe-oracle gains spectral=1; wf-p5-check gains film-spheres. 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 (P5.s6, DIVERGES V570; V257 superseded).
What changed
ptThinFilmWgsl(spectral)(packages/pathtracer/src/bsdf/thinfilm-wgsl.ts): withintegrator.spectral+features.thinFilmthe film Fresnel is the exact unpolarised Airy sum per wavelength lane (the formula ofbench/metrics/thinfilm-airy.ts: complex Fresnel amplitudes at both interfaces, s and p, the lane's complex base IOR). A metal's base isp.eta+ ip.k(the RGB-uplifted colour at that wavelength, as before); a dielectric's is its scalar IOR. No thickness fade. The call site isptShadingModulesWgsl(megakernel and wavefront share it).node bench/size-snapshot.tsbefore/after,diff -rqempty over all 355 files. New variantspectral-pbr-albedo-thinFilm(58.0 KB minified megakernel, over the ~50 KB DXC class).lobe-oraclegetsspectral=1;wf-p5-checkgets the casefilm-spheres; a WGSL-text unit test.Verification (M5 Pro,
--no-lock, best effort, not timings)node bench/runner/run.ts --page lobe-oracle --args fuzz=0 film=1 spectral=1(andspectral=0), 256 spp, against the exact spectral Airy sum under D65. Max absolute error, near-normal bins (mu_o > 0.55), RGB fit vs spectral:The worst bin over all angles in spectral mode is 9e-3 (smooth dielectric, sphere rim, noise).
--page wf-p5-check --args cases=film-spheres,cornell variants=plain,inline,sorted spp=16: megakernel vs wavefront per pixel 6.9e-7 (film-spheres), 9.0e-7 (Cornell), 0 non-finite.pnpm typecheckshows only the known@pmndrs/vdberrors;thinfilm.test.ts,integrator-wgsl.test.ts,spectraltests pass.Left open
The optional dispersive coat / layered interface (V256) is not done. A conductor's eta and k still come from the RGB-uplifted colour (no measured spectra). No edit near
ptSpecIor(PR #79).🤖 Generated with Claude Code