Skip to content

Add configurable maximum depth for hidden geometry sampling - #14

Open
matla91 wants to merge 1 commit into
diegoroyo:mainfrom
matla91:feat/hgs-max-depth
Open

Add configurable maximum depth for hidden geometry sampling#14
matla91 wants to merge 1 commit into
diegoroyo:mainfrom
matla91:feat/hgs-max-depth

Conversation

@matla91

@matla91 matla91 commented Aug 20, 2026

Copy link
Copy Markdown

Summary

This PR adds a configurable maximum depth for Hidden Geometry Sampling (HGS) in TransientNLOSPath.

HGS can significantly improve sampling efficiency in transient NLOS rendering by generating connections to hidden geometry. However, applying HGS recursively at every path depth can lead to high-variance contributions in some scenes, especially when later path vertices create difficult sampling configurations. In these cases, limiting HGS to early path vertices can provide a useful trade-off between sampling efficiency and variance control.

The new parameter:

nlos_hidden_geometry_sampling_max_depth

allows users to control how far HGS is applied along a path while keeping the existing behavior unchanged by default.

Behavior

  • -1 (default): preserves the previous unlimited HGS behavior.
  • N > 0: enables HGS only for path vertices with depth < N.
    • For example, 1 applies HGS only at depth 0.
  • Invalid values (0 or < -1) raise a runtime configuration error.

When the depth limit disables HGS, the BSDF method probability is restored to 1.0, since BSDF sampling becomes the only available sampling strategy at that depth.

Tests

Added integration tests covering:

  • default unlimited HGS behavior;
  • depth-limited HGS execution;
  • arbitrary positive depth limits;
  • preservation of BSDF sampling probabilities;
  • invalid parameter values.

All added tests pass.

@matla91
matla91 marked this pull request as ready for review August 20, 2026 09:40
@matla91

matla91 commented Aug 20, 2026

Copy link
Copy Markdown
Author

The implementation and integration tests are now complete.

Validation:

  • 6/6 integration tests passing
  • default behavior preserved (-1 = unlimited HGS)
  • invalid configuration values rejected
  • BSDF sampling probability remains consistent when HGS is disabled by the depth limit

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