Skip to content

ReSTIR GI: textures + alpha MASK (P5.4) - #121

Open
DennisSmolek wants to merge 1 commit into
mainfrom
issue-58-restir-gi-textures
Open

DennisSmolek wants to merge 1 commit into
mainfrom
issue-58-restir-gi-textures

Conversation

@DennisSmolek

Copy link
Copy Markdown
Member

Part of #58 (P5.4: textures + alpha MASK for ReSTIR GI).

What changed

  • ptRestirGiUnsupported no longer refuses textures / alphaMask. The DI G-buffer already stores uv + footprint, so x1 needed nothing; the GI init pass gets ptGiClosest(ray, cone) (only emitted with textures): the megakernel's hit block as one function (uv + texture frame, cone footprint, rtApplyMaterialTextures, normal map, cutout walk through PT_MASK_SKIPS with the cone carried across skips under ptMaskIndirect). The x1 -> x2 ray and x2's BSDF ray use it, so the Lambert test (diffuse) and Lo see the textured colour. Every shadow ray of the passes (x2's light sample, visibility of each shifted sample) uses ptVisibleMasked (V173 rule).
  • The cone is not stored: width at x1 = pixel spread x |x1 - eye| (V580). DIVERGES V580-V582.
  • New scene restir-gi-mask, restir-check args hashseeds=1 and lod=cone, size-snapshot variants gi-tex*.

Verified

  • Kernel text: node bench/size-snapshot.ts before/after, diff -rq: all 355 old files identical; only new restir-*-gi-tex* files. Sizes: GI passes 53.1 KB textured / 51.5 + MASK / 60.7 + MASK + OpenPBR (plain 48.6, OpenPBR 57.8); shade 47.5 / 45.7 / 54.9. Textured GI passes are over the 50 KB class (trimming left open).
  • vitest: restir, integrator-wgsl, wavefront (new text tests; wavefront GI test updated: textures build, MASK still throws).
  • restir-check check=gi hashseeds=1 (128 frames, 6 hashed seeds, reference = our plain path tracer at maxDepth 2; load 40-47, bias numbers do not depend on it): gi_ts_unb relBias tex-checker +3.5e-5 +- 8.9e-5, tex-mask -2.6e-5 +- 3.1e-5, foliage-mask -1.9e-4 +- 0.9e-4, restir-tex-lamps -6.5e-5 +- 5.0e-4, restir-gi-mask +1.9e-4 +- 1.4e-4; biased mode darkens -0.6..-2.7%; 0 non-finite. Reuse is active on tex-checker (0.92x relMSE of gi_off) and restir-gi-mask (0.80x). tex-mask / foliage-mask cards are OpenPBR (never diffuse), so they see no reuse: restir-gi-mask is the scene for shifted samples through cutouts.
  • wf-frame-check restir=giu cases=tex-checker,restir-tex frames=6: wavefront vs megakernel <= 1.5e-7 per pixel (radiance bit-identical), sharedHit: false on both.

Found, not fixed (TASKS P5.4b)

ReSTIR DI with textureLod: 'cone' + alpha MASK + sun is biased on main: restir-check check=converge scenes=tex-mask lod=cone frames=128 reffames=2048 reads ris +3.5% (restir-gi-mask +0.74%); level 0 and lamp scenes fine. GI adds nothing to it.

Left

Wavefront alpha MASK (DI's refusal), multi-bounce Lo, specular chains, glossy x2, reactive mask, GI module under 50 KB with textures. No timing taken (no quiet-pass row needed).

🤖 Generated with Claude Code

x2 and the vertex behind it decode textures with a ray cone (ptGiClosest), cutouts are walked on the secondary rays and tested in every shadow ray. Kernels without GI textures are byte-identical. New scene restir-gi-mask, restir-check hashseeds / lod args.

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