Skip to content

Lumen follow-up: true CDF-based importance sampling for probe rays #19

@proggeramlug

Description

@proggeramlug

Ticket 016 V1-V4 landed first-order importance-sampling approximations (temporal + spatial jitter decorrelation, history-luma-scaled jitter magnitude, variance-adaptive EMA alpha). The ticket spec's fully-general approach — per-probe 2D PDF from prev-frame radiance × BRDF, precomputed inverse CDF, inverse-CDF ray direction sampling with per-ray PDF weighting for unbiased accumulation — was deferred as not load-bearing at our current 64-rays/probe density.

When to do this

  • If a case appears where a probe's 64 rays waste most of their budget on low-contribution directions (e.g., tight interior rooms where only the doorway is lit).
  • If ray budget ever drops to 16 or 32 rays/probe for perf reasons.

Scope

  • PROBE_CDF_PRECOMPUTE_WGSL — one compute pass per probe that reads the 8×8 octahedral history and writes row-sum + row-CDF textures (2× the atlas size).
  • Trace shader update (SW / SDF / HW): replace the fixed octel-to-direction mapping with inverse-CDF lookup (two textureLoad calls per ray) and divide accumulation by the sampled PDF.
  • Bind CDF textures on all 3 trace pipelines.

Why not yet

See docs/perf/016-lumen-importance-sampling.md §V4 closure — V1-V3 already redirect sample budget toward productive directions without the CDF machinery, and at 64 rays/probe the marginal gain over V3 is expected to be small.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions