|
Lagrange
|
Stateful algorithm for finding occluded facets across every instance of a scene. More...
#include <lagrange/raycasting/remove_occluded_facets.h>
Classes | |
| struct | Impl |
| struct | InstanceInfo |
| Maps a global facet index back to (mesh, instance, local facet). More... | |
Public Member Functions | |
| OccludedFacetSampler (const scene::SimpleScene< Scalar, Index, 3 > &scene, const OccludedFacetSamplerOptions &options={}, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;}) | |
| Build the ray caster and per-instance world-space facet data. | |
| OccludedFacetSampler (OccludedFacetSampler &&) noexcept | |
| OccludedFacetSampler & | operator= (OccludedFacetSampler &&) noexcept |
| void | run_normal_batch (uint64_t num_rays) |
| Cosine-weighted hemisphere batch. | |
| void | run_adaptive_batch (uint64_t num_rays) |
| Adaptive batch using cached escape directions of 1-ring visible neighbors. | |
| void | run_brute_force_batch (uint64_t num_rays) |
| Cosine-weighted hemisphere batch with no escape caching — baseline for benchmarking the adaptive mode against pure sampling. | |
| bool | is_visible (uint64_t global_facet_index) const |
| Whether the facet has been marked visible so far. | |
| uint64_t | num_rays_cast (uint64_t global_facet_index) const |
| Rays cast so far for the facet. | |
| uint64_t | num_facets () const |
| Total number of facets across all instances. | |
| span< const InstanceInfo > | instances () const |
| Per-instance metadata for mapping global facet indices to (mesh, instance, local facet). | |
Stateful algorithm for finding occluded facets across every instance of a scene.
Each instance is gated independently with its own world-space facets.
Combines two sampling strategies that can be alternated progressively:
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
|
explicit |
Build the ray caster and per-instance world-space facet data.
| [in] | scene | Scene to process. Every referenced mesh must be a triangle mesh. |
| [in] | options | Sampler options. |
| [in] | is_occluder | Returns whether (mesh_index, instance_index) should block rays. Non-occluder instances are still tested for visibility but do not contribute to the ray-caster scene. |
| void run_normal_batch | ( | uint64_t | num_rays | ) |
Cosine-weighted hemisphere batch.
Caches each facet's first-discovered escape direction for later adaptive batches.
| void run_adaptive_batch | ( | uint64_t | num_rays | ) |
Adaptive batch using cached escape directions of 1-ring visible neighbors.
Skips facets with no visible neighbor.
| uint64_t num_facets | ( | ) | const |
Total number of facets across all instances.
Multi-instance meshes are counted once per instance.