Renderer

template<IsSpectral TSpectral>
class Renderer

Abstract base class for scene renderers.

Renderer provides the interface and common helpers for rendering a SceneView into a FrameBuffer. Derived classes implement specific rendering algorithms (e.g., rasterization, ray tracing).

Template Parameters:

TSpectral – Spectral type for the rendering pipeline

Subclassed by huira::RasterRenderer< TSpectral >

Public Functions

virtual ~Renderer() = default
virtual void render(SceneView<TSpectral> &scene_view, FrameBuffer<TSpectral> &frame_buffer, float exposure_time) = 0

Protected Functions

void render_unresolved_(SceneView<TSpectral> &scene_view, FrameBuffer<TSpectral> &frame_buffer)

Render unresolved point sources (stars and unresolved objects) into the frame buffer.

This method implements an optimized pipeline for rendering point sources that cannot be resolved into visible geometry. It supports both delta-function (no PSF) and spatially- distributed PSF rendering with adaptive radius culling for performance.

The rendering pipeline:

  1. Collects all stars and unresolved objects into a unified list

  2. Builds a radius LUT and assigns per-source effective PSF radii based on irradiance

  3. Projects sources to screen space and bins them into tiles

  4. Renders each tile in parallel into local buffers

  5. Combines tile buffers into the final frame buffer

Performance optimizations:

  • Adaptive PSF radius: dim sources use smaller kernels

  • Tiled rendering: parallel processing with minimal synchronization

  • Depth occlusion testing: skip sources behind resolved geometry

Template Parameters:

TSpectral – Spectral type for the rendering pipeline

Parameters:
  • scene_view – The scene view containing stars and unresolved objects

  • frame_buffer – The frame buffer to render into

inline std::shared_ptr<CameraModel<TSpectral>> get_camera(SceneView<TSpectral> &scene_view) const
inline std::vector<MeshBatch<TSpectral>> get_meshes(SceneView<TSpectral> &scene_view) const
inline std::vector<LightInstance<TSpectral>> get_lights(SceneView<TSpectral> &scene_view) const

Protected Attributes

RandomSampler<float> sampler_