Abstract interface for ray-tracing backends. More...
#include <RayTracingBackend.h>
Public Member Functions | |
| virtual void | initialize ()=0 |
| Initialize the ray tracing backend. | |
| virtual void | shutdown ()=0 |
| Shutdown the ray tracing backend. | |
| virtual void | updateGeometry (const RayTracingGeometry &geometry)=0 |
| Update geometry data in the ray tracing backend. | |
| virtual void | buildAccelerationStructure ()=0 |
| Build or rebuild the acceleration structure. | |
| virtual void | updateMaterials (const RayTracingMaterial &materials)=0 |
| Update material properties (reflectivity, transmissivity, specular) | |
| virtual void | updateSources (const std::vector< RayTracingSource > &sources)=0 |
| Update radiation source definitions. | |
| virtual void | updateDiffuseRadiation (const std::vector< float > &flux, const std::vector< float > &extinction, const std::vector< helios::vec3 > &peak_dir, const std::vector< float > &dist_norm, const std::vector< float > &sky_energy)=0 |
| Update diffuse (ambient) radiation parameters. | |
| virtual void | updateSkyModel (const std::vector< helios::vec4 > &sky_radiance_params, const std::vector< float > &camera_sky_radiance, const helios::vec3 &sun_direction, const std::vector< float > &solar_disk_radiance, float solar_disk_cos_angle)=0 |
| Update sky radiance model parameters (for camera rendering) | |
| virtual void | launchDirectRays (const RayTracingLaunchParams ¶ms)=0 |
| Launch direct (unscattered) rays to radiation sources. | |
| virtual void | launchDiffuseRays (const RayTracingLaunchParams ¶ms)=0 |
| Launch diffuse (hemispherically-distributed) rays. | |
| virtual void | launchCameraRays (const RayTracingLaunchParams ¶ms)=0 |
| Launch camera rays for image rendering. | |
| virtual void | launchPixelLabelRays (const RayTracingLaunchParams ¶ms)=0 |
| Launch pixel labeling rays (for primitive identification in images) | |
| virtual void | getRadiationResults (RayTracingResults &results)=0 |
| Get radiation simulation results. | |
| virtual void | getCameraResults (std::vector< float > &pixel_data, std::vector< uint > &pixel_labels, std::vector< float > &pixel_depths, uint camera_id, const helios::int2 &resolution)=0 |
| Get camera rendering results. | |
| virtual void | zeroRadiationBuffers (size_t launch_band_count)=0 |
| Zero all radiation result buffers (radiation_in, radiation_out, radiation_specular) | |
| virtual void | zeroScatterBuffers ()=0 |
| Zero scatter buffers (scatter_buff_top, scatter_buff_bottom) | |
| virtual void | zeroCameraPixelBuffers (const helios::int2 &resolution)=0 |
| Zero camera pixel label and depth buffers. | |
| virtual void | copyScatterToRadiation ()=0 |
| Copy scatter buffer contents to radiation buffers. | |
| virtual void | uploadRadiationOut (const std::vector< float > &radiation_out_top, const std::vector< float > &radiation_out_bottom)=0 |
| Upload radiation_out buffers directly (without launching rays) | |
| virtual void | uploadCameraScatterBuffers (const std::vector< float > &scatter_top_cam, const std::vector< float > &scatter_bottom_cam)=0 |
| Upload camera scatter buffers. | |
| virtual void | zeroCameraScatterBuffers (size_t launch_band_count)=0 |
| Zero camera scatter buffers (scatter_buff_top_cam, scatter_buff_bottom_cam) | |
| virtual void | uploadSourceFluxes (const std::vector< float > &fluxes)=0 |
| Upload source flux values for launched bands. | |
| virtual void | queryGPUMemory () const =0 |
| Query and report GPU memory usage. | |
| virtual std::string | getBackendName () const =0 |
| Get the name of the backend implementation. | |
Static Public Member Functions | |
| static std::unique_ptr< RayTracingBackend > | create (const std::string &backend_type) |
| Create a ray tracing backend instance. | |
Abstract interface for ray-tracing backends.
This interface provides a backend-agnostic API for ray tracing operations. Implementations include:
The interface is designed to support:
Definition at line 42 of file RayTracingBackend.h.
|
pure virtual |
Build or rebuild the acceleration structure.
Constructs the BVH or other acceleration structure for efficient ray traversal. Should be called after updateGeometry() or when geometry changes.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Copy scatter buffer contents to radiation buffers.
Used for multi-bounce radiation: scattering iteration results are accumulated into the main radiation buffers.
Implemented in helios::OptiX6Backend.
|
static |
Create a ray tracing backend instance.
| [in] | backend_type | Backend type string: "optix6", "optix7", "vulkan" |
Factory method that selects and instantiates the appropriate backend. Throws helios_runtime_error if backend type is unknown or unavailable.
Definition at line 25 of file BackendFactory.cpp.
|
pure virtual |
Get the name of the backend implementation.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Get camera rendering results.
| [out] | pixel_data | Flattened pixel values [band][pixel_y][pixel_x] |
| [out] | pixel_labels | Primitive UUID for each pixel (0 if sky/miss) |
| [out] | pixel_depths | Depth value for each pixel |
| [in] | camera_id | Camera identifier |
| [in] | resolution | Camera resolution (width, height) |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Get radiation simulation results.
| [out] | results | Structure containing radiation_in, radiation_out, scatter buffers, etc. |
Retrieves absorbed and emitted radiation for all primitives and bands.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Initialize the ray tracing backend.
Creates the ray tracing context, allocates buffers, compiles/loads programs, and sets up the acceleration structure.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Launch camera rays for image rendering.
| [in] | params | Launch parameters including camera position, direction, FOV, etc. |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Launch diffuse (hemispherically-distributed) rays.
| [in] | params | Launch parameters including diffuse distribution parameters |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Launch direct (unscattered) rays to radiation sources.
| [in] | params | Launch parameters (dimensions, seed, band config, etc.) |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Launch pixel labeling rays (for primitive identification in images)
| [in] | params | Launch parameters with camera configuration |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Query and report GPU memory usage.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Shutdown the ray tracing backend.
Destroys the context, frees all buffers and resources.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Update diffuse (ambient) radiation parameters.
| [in] | flux | Diffuse flux per band |
| [in] | extinction | Extinction coefficient per band |
| [in] | peak_dir | Peak direction for diffuse distribution per band |
| [in] | dist_norm | Distribution normalization factor per band |
| [in] | sky_energy | Energy absorbed by sky per band |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Update geometry data in the ray tracing backend.
| [in] | geometry | Geometry data for all primitive types |
This uploads vertex data, transform matrices, UUIDs, texture masks, and all other geometry-related data to the GPU.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Update material properties (reflectivity, transmissivity, specular)
| [in] | materials | Material data for all primitives, sources, and bands |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Update sky radiance model parameters (for camera rendering)
| [in] | sky_radiance_params | Prague sky model parameters per band (vec4) |
| [in] | camera_sky_radiance | Sky radiance for cameras per band |
| [in] | sun_direction | Direction to the sun |
| [in] | solar_disk_radiance | Solar disk radiance per band |
| [in] | solar_disk_cos_angle | Cosine of solar disk angular radius |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Update radiation source definitions.
| [in] | sources | Vector of radiation sources (collimated, sphere, sun, rectangle, disk) |
Implemented in helios::OptiX6Backend.
|
pure virtual |
Upload camera scatter buffers.
| [in] | scatter_top_cam | Scattered radiation for cameras (top surface) indexed by [primitive * Nbands_launch + band] |
| [in] | scatter_bottom_cam | Scattered radiation for cameras (bottom surface) |
Used to upload emission energy that cameras should see before scatter iterations.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Upload radiation_out buffers directly (without launching rays)
| [in] | radiation_out_top | Top-face outgoing radiation [Nprims * Nbands] |
| [in] | radiation_out_bottom | Bottom-face outgoing radiation [Nprims * Nbands] |
Used to set outgoing radiation for scattering iterations.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Upload source flux values for launched bands.
| [in] | fluxes | Source flux values indexed by [source * Nbands_launch + band] |
Used to set per-band source fluxes before direct ray launch.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Zero camera pixel label and depth buffers.
| [in] | resolution | Full camera resolution (width, height) |
Must be called before launching pixel label rays for multiple tiles. Each tile launch accumulates results without zeroing, so this must be called once before the tile loop to initialize the buffers.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Zero camera scatter buffers (scatter_buff_top_cam, scatter_buff_bottom_cam)
| [in] | launch_band_count | Number of bands being launched in current iteration |
Buffers are sized by launch_band_count to prevent double-counting when accumulating camera scatter across multiple ray launches.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Zero all radiation result buffers (radiation_in, radiation_out, radiation_specular)
| [in] | launch_band_count | Number of bands being launched in current iteration |
Camera scatter buffers are sized by launch_band_count (not global band count) to match per-launch accumulation semantics. All other buffers use the global band count.
Implemented in helios::OptiX6Backend.
|
pure virtual |
Zero scatter buffers (scatter_buff_top, scatter_buff_bottom)
Implemented in helios::OptiX6Backend.