Scene View

template<IsSpectral TSpectral>
class SceneView

View of a scene at a specific time and camera instance.

SceneView collects geometry, lights, unresolved objects, and stars for rendering.

Template Parameters:

TSpectral – Spectral type (e.g., RGB, Spectral)

Public Functions

SceneView(const Scene<TSpectral> &scene, const Interval &exposure_interval, const InstanceHandle<TSpectral> &camera_instance, ObservationMode obs_mode, std::size_t num_temporal_samples = 1)

Construct a SceneView for a given scene, time, camera, and observation mode.

Collects geometry, lights, unresolved objects, and stars for rendering.

Parameters:
  • sceneScene to view

  • exposure_interval – Exposure interval

  • camera_instance – Camera instance handle

  • obs_mode – Observation mode

  • num_temporal_samples – Number of temporal samples for motion blur (default: 1)

~SceneView()

Destructor for SceneView, releases TLAS and clears geometry and lights.

HitRecord intersect(const Ray<TSpectral> &ray, float time = 0.5f) const

Intersect a ray with the scene and return the hit record.

Parameters:
  • ray – The ray to intersect.

  • time – The time for motion blur.

Returns:

The hit record.

bool occluded(const Ray<TSpectral> &ray, float t_far, float time = 0.5f) const

Test if a ray is occluded by any geometry in the scene.

Parameters:
  • ray – The ray to test for occlusion.

  • t_far – The maximum distance to check for occlusion.

  • time – The time for motion blur.

Returns:

True if the ray is occluded, false otherwise.

Interaction<TSpectral> resolve_hit(const Ray<TSpectral> &ray, const HitRecord &hit) const

Resolve a hit record into a full interaction, including position, normals, UVs, etc.

Parameters:
  • ray – The ray that caused the hit.

  • hit – The hit record to resolve.

Returns:

The resolved interaction.

std::vector<HitRecord> intersect(const std::vector<Ray<TSpectral>> &rays, float time = 0.5f) const

Intersect a batch of rays with the scene and return their hit records.

Parameters:
  • rays – The rays to intersect.

  • time – The time for motion blur.

Returns:

A vector of hit records corresponding to each ray.

std::vector<bool> occluded(const std::vector<Ray<TSpectral>> &rays, float t_far, float time = 0.5f) const

Test if a batch of rays are occluded by any geometry in the scene.

Parameters:
  • rays – The rays to test for occlusion.

  • t_far – The maximum distance to check for occlusion.

  • time – The time for motion blur.

Returns:

A vector of booleans indicating occlusion for each ray.

std::vector<Interaction<TSpectral>> resolve_hits(const std::vector<Ray<TSpectral>> &rays, const std::vector<HitRecord> &hits) const

Resolve a batch of hit records into full interactions.

Parameters:
  • rays – The rays that caused the hits.

  • hits – The hit records to resolve.

Returns:

A vector of resolved interactions.

inline Interval get_exposure_interval() const
inline units::Second duration() const
inline Time get_time() const
inline Time get_start_time() const
inline Time get_end_time() const