RasterRenderer

template<IsSpectral TSpectral>
class RasterRenderer : public huira::Renderer<TSpectral>

Simple rasterization-based renderer for mesh geometry.

RasterRenderer implements a basic triangle rasterization pipeline for rendering mesh geometry into a frame buffer. It supports per-pixel lighting, mesh ID, and normal output, and is intended for fast, reference-style rendering of scene views.

Template Parameters:

TSpectral – Spectral type for the rendering pipeline

Public Functions

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

Render a scene view into a frame buffer.

This method performs the complete rendering pipeline: rasterizes mesh geometry, renders unresolved objects (stars/planets), and applies camera readout with the specified exposure time.

Template Parameters:

TSpectral – Spectral type for the rendering pipeline

Parameters:
  • scene_view – The scene view to render

  • frame_buffer – The frame buffer to render into

  • exposure_time – Exposure time in seconds for camera readout

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_