OptiX 8.1 implementation of the ray tracing backend. More...
#include <OptiX8Backend.h>
Public Member Functions | |
| void | initialize () override |
| Initialize the ray tracing backend. | |
| void | shutdown () override |
| Shutdown the ray tracing backend. | |
| void | updateGeometry (const RayTracingGeometry &geometry) override |
| Update geometry data in the ray tracing backend. | |
| void | buildAccelerationStructure () override |
| Build or rebuild the acceleration structure. | |
| void | updateMaterials (const RayTracingMaterial &materials) override |
| Update material properties (reflectivity, transmissivity, specular) | |
| void | updateSources (const std::vector< RayTracingSource > &sources) override |
| Update radiation source definitions. | |
| 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) override |
| Update diffuse (ambient) radiation parameters. | |
| 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, const std::vector< float > &camera_diffuse_flux, const std::vector< uint32_t > &band_emission_flag) override |
| Update sky radiance model parameters (for camera rendering) | |
| void | launchDirectRays (const RayTracingLaunchParams ¶ms) override |
| Launch direct (unscattered) rays to radiation sources. | |
| void | launchDiffuseRays (const RayTracingLaunchParams ¶ms) override |
| Launch diffuse (hemispherically-distributed) rays. | |
| void | launchCameraRays (const RayTracingLaunchParams ¶ms) override |
| Launch camera rays for image rendering. | |
| void | launchPixelLabelRays (const RayTracingLaunchParams ¶ms) override |
| Launch pixel labeling rays (for primitive identification in images) | |
| void | getRadiationResults (RayTracingResults &results) override |
| Get radiation simulation results. | |
| void | getCameraResults (std::vector< float > &pixel_data, std::vector< uint > &pixel_labels, std::vector< float > &pixel_depths, uint camera_id, const helios::int2 &resolution) override |
| Get camera rendering results. | |
| void | zeroRadiationBuffers (size_t launch_band_count) override |
| Zero all radiation result buffers (radiation_in, radiation_out, radiation_specular) | |
| void | zeroScatterBuffers () override |
| Zero scatter buffers (scatter_buff_top, scatter_buff_bottom) | |
| void | zeroCameraPixelBuffers (const helios::int2 &resolution) override |
| Zero camera pixel label and depth buffers. | |
| void | copyScatterToRadiation () override |
| Copy scatter buffer contents to radiation buffers. | |
| void | uploadRadiationOut (const std::vector< float > &radiation_out_top, const std::vector< float > &radiation_out_bottom) override |
| Upload radiation_out buffers directly (without launching rays) | |
| void | uploadCameraScatterBuffers (const std::vector< float > &scatter_top_cam, const std::vector< float > &scatter_bottom_cam) override |
| Upload camera scatter buffers. | |
| void | zeroCameraScatterBuffers (size_t launch_band_count) override |
| Zero camera scatter buffers (scatter_buff_top_cam, scatter_buff_bottom_cam) | |
| void | uploadSourceFluxes (const std::vector< float > &fluxes) override |
| Upload source flux values for launched bands. | |
| void | uploadSourceFluxesCam (const std::vector< float > &fluxes_cam) override |
| Upload camera-weighted source flux values for specular reflection. | |
| void | queryGPUMemory () const override |
| Query and report GPU memory usage. | |
| std::string | getBackendName () const override |
| Get the name of the backend implementation. | |
Static Public Member Functions | |
| static bool | probe () noexcept |
| Lightweight probe to check if OptiX 8 hardware is available. | |
Static Public Member Functions inherited from helios::RayTracingBackend | |
| static std::unique_ptr< RayTracingBackend > | create (const std::string &backend_type) |
| Create a ray tracing backend instance. | |
OptiX 8.1 implementation of the ray tracing backend.
Uses the modern OptiX 8 pipeline/SBT model. Compatible with NVIDIA drivers >= 560 (required for OptiX 8.0+). Automatically selected when HELIOS_HAVE_OPTIX8 is defined at compile time.
Architecture:
Definition at line 71 of file OptiX8Backend.h.
|
override |
Definition at line 49 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 511 of file OptiX8Backend.cpp.
|
overridevirtual |
Copy scatter buffer contents to radiation buffers.
Used for multi-bounce radiation: scattering iteration results are accumulated into the main radiation buffers.
Implements helios::RayTracingBackend.
Definition at line 1205 of file OptiX8Backend.cpp.
|
inlineoverridevirtual |
Get the name of the backend implementation.
Implements helios::RayTracingBackend.
Definition at line 141 of file OptiX8Backend.h.
|
overridevirtual |
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) |
Implements helios::RayTracingBackend.
Definition at line 1130 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1104 of file OptiX8Backend.cpp.
|
overridevirtual |
Initialize the ray tracing backend.
Creates the ray tracing context, allocates buffers, compiles/loads programs, and sets up the acceleration structure.
Implements helios::RayTracingBackend.
Definition at line 59 of file OptiX8Backend.cpp.
|
overridevirtual |
Launch camera rays for image rendering.
| [in] | params | Launch parameters including camera position, direction, FOV, etc. |
Implements helios::RayTracingBackend.
Definition at line 989 of file OptiX8Backend.cpp.
|
overridevirtual |
Launch diffuse (hemispherically-distributed) rays.
| [in] | params | Launch parameters including diffuse distribution parameters |
Implements helios::RayTracingBackend.
Definition at line 857 of file OptiX8Backend.cpp.
|
overridevirtual |
Launch direct (unscattered) rays to radiation sources.
| [in] | params | Launch parameters (dimensions, seed, band config, etc.) |
Implements helios::RayTracingBackend.
Definition at line 798 of file OptiX8Backend.cpp.
|
overridevirtual |
Launch pixel labeling rays (for primitive identification in images)
| [in] | params | Launch parameters with camera configuration |
Implements helios::RayTracingBackend.
Definition at line 1056 of file OptiX8Backend.cpp.
|
staticnoexcept |
Lightweight probe to check if OptiX 8 hardware is available.
Checks CUDA device availability and OptiX driver initialization without allocating persistent GPU resources.
Definition at line 35 of file OptiX8Backend.cpp.
|
overridevirtual |
Query and report GPU memory usage.
Implements helios::RayTracingBackend.
Definition at line 1295 of file OptiX8Backend.cpp.
|
overridevirtual |
Shutdown the ray tracing backend.
Destroys the context, frees all buffers and resources.
Implements helios::RayTracingBackend.
Definition at line 235 of file OptiX8Backend.cpp.
|
overridevirtual |
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 |
Implements helios::RayTracingBackend.
Definition at line 689 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 319 of file OptiX8Backend.cpp.
|
overridevirtual |
Update material properties (reflectivity, transmissivity, specular)
| [in] | materials | Material data for all primitives, sources, and bands |
Implements helios::RayTracingBackend.
Definition at line 523 of file OptiX8Backend.cpp.
|
overridevirtual |
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 |
| [in] | camera_diffuse_flux | Diffuse (hemispherical) sky flux per band, sampled by cameras when band_emission_flag[b] is true. Allows cameras to see isotropic sky longwave/thermal emission. |
| [in] | band_emission_flag | Per-band flag (1 = emission enabled, 0 = disabled). Gates whether cameras add the isotropic sky-emission contribution from camera_diffuse_flux on a ray miss. |
Implements helios::RayTracingBackend.
Definition at line 729 of file OptiX8Backend.cpp.
|
overridevirtual |
Update radiation source definitions.
| [in] | sources | Vector of radiation sources (collimated, sphere, sun, rectangle, disk) |
Implements helios::RayTracingBackend.
Definition at line 624 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1236 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1220 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1267 of file OptiX8Backend.cpp.
|
overridevirtual |
Upload camera-weighted source flux values for specular reflection.
| [in] | fluxes_cam | Camera spectral response weights indexed by [source * Nbands_launch + band] |
Uploads per-camera spectral response weights used for specular reflection in camera rendering. The weights represent ∫(source_spectrum × camera_response) / ∫(source_spectrum) for each source/band combination. Called before each camera render with the current camera's weights.
Implements helios::RayTracingBackend.
Definition at line 1279 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1192 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1252 of file OptiX8Backend.cpp.
|
overridevirtual |
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.
Implements helios::RayTracingBackend.
Definition at line 1153 of file OptiX8Backend.cpp.
|
overridevirtual |
Zero scatter buffers (scatter_buff_top, scatter_buff_bottom)
Implements helios::RayTracingBackend.
Definition at line 1184 of file OptiX8Backend.cpp.