OptiX-Based Code
Description
Collaboration diagram for OptiX-Based Code:
Classes | |
struct | AreaLight |
The different types of area lights that can exist in our current models. More... | |
struct | PointLight |
Packed parameters of a point light. More... | |
struct | CameraMissParameters |
The parameters associated with camera miss data. A.K.A background data. More... | |
struct | MissParameters |
The parameters for a camera miss record. More... | |
struct | LensParams |
Inverse lens param for modeling polynomial forward model. More... | |
struct | CameraParameters |
The parameters needed to define a camera. More... | |
struct | SemanticCameraParameters |
Parameters need to define a camera that generates semantic segmentation data. More... | |
struct | LidarParameters |
Parameters used to define a lidar. More... | |
struct | RadarParameters |
Parameters used to define a radar. More... | |
struct | RaygenParameters |
Parameters for specifying raygen programs. More... | |
struct | MeshParameters |
All the data to specific a triangle mesh. More... | |
struct | MaterialParameters |
All parameters for specifying a material in optix. More... | |
struct | ContextParameters |
Parameters associated with the entire optix scene. More... | |
struct | MaterialRecordParameters |
Parameters associated with a single object in the scene. Padding added during record creation. More... | |
struct | PerRayData_camera |
Data associated with a single camera ray. More... | |
struct | PerRayData_semantic |
Data associated with a single segmentation camera ray. More... | |
struct | PerRayData_shadow |
Data associated with a single shadow ray. More... | |
struct | PerRayData_lidar |
Data associated with a single lidar ray. More... | |
struct | PerRayData_radar |
Data associated with a single radar ray. More... | |
class | chrono::sensor::ChOptixEngine |
Optix Engine that is responsible for managing all render-based sensors. More... | |
struct | chrono::sensor::Transform |
Transform struct for packing a translation, rotation, and scale. More... | |
class | chrono::sensor::ChOptixGeometry |
Optix Geometry class that is responsible for managing all geometric information in the optix scene This handles the acceleration structure and transforms. More... | |
class | chrono::sensor::ChOptixPipeline |
Class to hold all the Shader Binding Table parameters adnd manage the ray tracing pipeline, materials, ray gen programs. More... | |
struct | chrono::sensor::ProgramString |
holds string values for ptx file and ray generation program More... | |
struct | chrono::sensor::ByteImageData |
stores image data More... | |
Macros | |
#define | OPTIX_ERROR_CHECK(result) |
Checks the output of an optix call for any error, will throw a runtime error if not success. More... | |
#define | CUDA_ERROR_CHECK(result) |
Checks the output of a cuda call for any error, will throw a runtime error if not success. More... | |
Functions | |
void | chrono::sensor::GetShaderFromFile (OptixDeviceContext context, OptixModule &module, const std::string &file_name, OptixModuleCompileOptions &module_compile_options, OptixPipelineCompileOptions &pipeline_compile_options) |
launches ray generation program More... | |
void | chrono::sensor::optix_log_callback (unsigned int level, const char *tag, const char *message, void *) |
ByteImageData | chrono::sensor::LoadByteImage (const std::string &filename) |
loads image to struct ByteImageData, returns an empty struct with 0 values if loading failed More... | |
void | chrono::sensor::SetSensorShaderDir (const std::string &path) |
Variables | |
__half | half4::x |
__half | half4::y |
__half | half4::z |
__half | half4::w |
float3 | AreaLight::pos |
the centre position of the area light from a global perspective | |
float3 | AreaLight::color |
the light's color and intensity | |
float | AreaLight::max_range |
the range at which 10% of the light's intensity remains | |
float3 | AreaLight::du |
the vector signifying the length of the area light | |
float3 | AreaLight::dv |
The vector signifying the width of the area light. | |
float3 | PointLight::pos |
the light's global position | |
float3 | PointLight::color |
the light's color and intensity | |
float | PointLight::max_range |
the range at which 10% of the light's intensity remains | |
BackgroundMode | CameraMissParameters::mode |
the mode to determine type of miss shading | |
float3 | CameraMissParameters::color_zenith |
the color at the zenith (ignored when using a sky map) | |
float3 | CameraMissParameters::color_horizon |
the color at the horizon (only used for GRADIENT) | |
cudaTextureObject_t | CameraMissParameters::env_map |
the texture object of the sky map (ignored when using a color mode) | |
CameraMissParameters | MissParameters::camera_miss |
float | LensParams::a0 |
float | LensParams::a1 |
float | LensParams::a2 |
float | LensParams::a3 |
float | LensParams::a4 |
float | LensParams::a5 |
float | LensParams::a6 |
float | LensParams::a7 |
float | LensParams::a8 |
float | CameraParameters::hFOV |
horizontal field of view | |
CameraLensModelType | CameraParameters::lens_model |
lens model to use | |
LensParams | CameraParameters::lens_parameters |
lens fitting parameters (if applicable) | |
unsigned int | CameraParameters::super_sample_factor |
number of samples per pixel in each dimension | |
float | CameraParameters::gamma |
camera's gamma value | |
bool | CameraParameters::use_gi |
whether to use global illumination | |
bool | CameraParameters::use_fog |
whether to use the scene fog model | |
half4 * | CameraParameters::frame_buffer |
buffer of camera pixels | |
half4 * | CameraParameters::albedo_buffer |
the material color of the first hit. Only initialized if using global illumination | |
half4 * | CameraParameters::normal_buffer |
The screen-space normal of the first hit. More... | |
curandState_t * | CameraParameters::rng_buffer |
The random number generator object. Only initialized if using global illumination. | |
float | DepthCameraParameters::hFOV |
horizontal field of view | |
CameraLensModelType | DepthCameraParameters::lens_model |
lens model to use | |
LensParams | DepthCameraParameters::lens_parameters |
lens fitting parameters (if applicable) | |
float * | DepthCameraParameters::frame_buffer |
buffer of class and instance ids | |
curandState_t * | DepthCameraParameters::rng_buffer |
only initialized if using global illumination | |
float | SemanticCameraParameters::hFOV |
horizontal field of view | |
CameraLensModelType | SemanticCameraParameters::lens_model |
lens model to use | |
LensParams | SemanticCameraParameters::lens_parameters |
lens fitting parameters (if applicable) | |
ushort2 * | SemanticCameraParameters::frame_buffer |
buffer of class and instance ids | |
curandState_t * | SemanticCameraParameters::rng_buffer |
only initialized if using global illumination | |
float | LidarParameters::max_vert_angle |
angle of the top-most lidar channel | |
float | LidarParameters::min_vert_angle |
angle of the bottom-most lidar channel | |
float | LidarParameters::hFOV |
horizontal field of view of the lidar | |
float | LidarParameters::max_distance |
maximum distance measureable by the lidar | |
float | LidarParameters::clip_near |
near clipping distance to geometric considerations | |
unsigned short | LidarParameters::sample_radius |
radius of samples for discretizing the lidar beams | |
LidarBeamShape | LidarParameters::beam_shape |
the beam shape | |
float | LidarParameters::horiz_div_angle |
divergence angle of the beam horizontally (in radians) | |
float | LidarParameters::vert_div_angle |
divergence angle of the beam vertically (in radians) | |
float2 * | LidarParameters::frame_buffer |
buffer where the lidar data will be placed when generated | |
float | RadarParameters::vFOV |
float | RadarParameters::hFOV |
float | RadarParameters::max_distance |
float | RadarParameters::clip_near |
float | RadarParameters::horiz_div_angle |
float | RadarParameters::vert_div_angle |
float3 | RadarParameters::velocity |
the velocity of the sensor | |
float * | RadarParameters::frame_buffer |
buffer where the radar data will be placed when generated | |
float | RaygenParameters::t0 |
time of the first ray | |
float | RaygenParameters::t1 |
time of the last ray | |
float3 | RaygenParameters::pos0 |
sensor position at t0 | |
float4 | RaygenParameters::rot0 |
sensor rotation at t0 | |
float3 | RaygenParameters::pos1 |
sensor position at t1 | |
float4 | RaygenParameters::rot1 |
sensor rotation at t1 | |
CameraParameters RaygenParameters::camera | |
the specific data when modeling a camera | |
SemanticCameraParameters RaygenParameters::segmentation | |
the specific data when modeling a semantic segementation camera | |
LidarParameters RaygenParameters::lidar | |
the specific data when modeling a lidar | |
RadarParameters RaygenParameters::radar | |
the specific data when modeling a radar | |
DepthCameraParameters RaygenParameters::depthCamera | |
union { | |
CameraParameters RaygenParameters::camera | |
the specific data when modeling a camera | |
SemanticCameraParameters RaygenParameters::segmentation | |
the specific data when modeling a semantic segementation camera | |
LidarParameters RaygenParameters::lidar | |
the specific data when modeling a lidar | |
RadarParameters RaygenParameters::radar | |
the specific data when modeling a radar | |
DepthCameraParameters depthCamera | |
} | RaygenParameters::specific |
the data for the specific sensor | |
float4 * | MeshParameters::vertex_buffer |
a device pointer to the mesh's vertices // size 8 | |
float4 * | MeshParameters::normal_buffer |
a device pointer to the mesh's normals //size 8 | |
float2 * | MeshParameters::uv_buffer |
a device pointer to the mesh's uv coordinates // size 8 | |
uint4 * | MeshParameters::vertex_index_buffer |
a device pointer to the mesh's vertex indices // size 8 | |
uint4 * | MeshParameters::normal_index_buffer |
a device pointer to the mesh's normal indices // size 8 | |
uint4 * | MeshParameters::uv_index_buffer |
a device pointer to the mesh's uv indices // size 8 | |
unsigned int * | MeshParameters::mat_index_buffer |
a device pointer to the mesh's materials on a per face basis // size 8 | |
double | MeshParameters::pad |
padding to ensure 16 byte alignment // size 8 | |
float3 | MaterialParameters::Kd |
the diffuse color // size 12 | |
float3 | MaterialParameters::Ks |
the specular color // size 12 | |
float3 | MaterialParameters::Ke |
float | MaterialParameters::anisotropy |
< the emissive color // size 12> More... | |
float | MaterialParameters::fresnel_exp |
the fresnel exponent // size 4 | |
float | MaterialParameters::fresnel_min |
the minimum fresnel value (0-1) // size 4 | |
float | MaterialParameters::fresnel_max |
maximum fresnel value (0-1) // size 4 | |
float | MaterialParameters::transparency |
transparency value (0-1) // size 4 | |
float | MaterialParameters::roughness |
roughness value (0-1) // size 4 | |
float | MaterialParameters::metallic |
metallic value (0-1) // size 4 | |
float | MaterialParameters::lidar_intensity |
reflectivity in a lidar's wavelength (0-1) // size 4 | |
float | MaterialParameters::radar_backscatter |
reflectivity in a radar's wavelength (0-1) // size 4 | |
int | MaterialParameters::use_specular_workflow |
toggle between a specular workflow or a metallic/roughness PBR workflow // size 4 | |
cudaTextureObject_t | MaterialParameters::kd_tex |
a diffuse color texture // size 8 | |
cudaTextureObject_t | MaterialParameters::kn_tex |
a normal perterbation texture // size 8 | |
cudaTextureObject_t | MaterialParameters::ks_tex |
a specular color texture // size 8 | |
cudaTextureObject_t | MaterialParameters::ke_tex |
cudaTextureObject_t | MaterialParameters::metallic_tex |
<an emissive color texture // size 8 More... | |
cudaTextureObject_t | MaterialParameters::roughness_tex |
a roughness texture // size 8 | |
cudaTextureObject_t | MaterialParameters::opacity_tex |
an opacity texture // size 8 | |
cudaTextureObject_t | MaterialParameters::weight_tex |
a weight texture for blended textures // size 8 | |
float2 | MaterialParameters::tex_scale |
texture scaling // size 8 | |
unsigned short int | MaterialParameters::class_id |
a class id of an object // size 2 | |
unsigned short int | MaterialParameters::instance_id |
an instance id of an object // size 2 | |
int | MaterialParameters::use_hapke |
float | MaterialParameters::emissive_power |
float | MaterialParameters::w |
float | MaterialParameters::b |
float | MaterialParameters::c |
float | MaterialParameters::B_s0 |
float | MaterialParameters::h_s |
float | MaterialParameters::phi |
float | MaterialParameters::theta_p |
float3 | MaterialParameters::pad |
AreaLight * | ContextParameters::arealights |
device pointer to the set of area lights in the scene | |
PointLight * | ContextParameters::lights |
device pointer to set of point lights in the scene | |
int | ContextParameters::num_arealights |
the number of area lights in the scene | |
int | ContextParameters::num_lights |
the number of point lights in the scene | |
float3 | ContextParameters::ambient_light_color |
the ambient light color and intensity | |
float3 | ContextParameters::fog_color |
color of fog in the scene | |
float | ContextParameters::fog_scattering |
scattering coefficient of fog in the scene | |
int | ContextParameters::max_depth |
maximum traversable depth | |
float | ContextParameters::scene_epsilon |
an epsilon value used for detecting self intersections | |
float | ContextParameters::importance_cutoff |
mimumum value before killing rays | |
OptixTraversableHandle | ContextParameters::root |
a handle to the root node in the scene | |
MaterialParameters * | ContextParameters::material_pool |
device pointer to list of materials to use for shading | |
MeshParameters * | ContextParameters::mesh_pool |
device pointer to list of meshes for instancing | |
int | ContextParameters::handle_ptr |
unsigned int | MaterialRecordParameters::material_pool_id |
material id of first material to be | |
unsigned int | MaterialRecordParameters::num_blended_materials |
number of blended materials on this object (can use a weight file per material to blend) | |
unsigned int | MaterialRecordParameters::mesh_pool_id |
mesh id of object | |
float3 | MaterialRecordParameters::translational_velocity |
translational velocity of object, used for radars | |
float3 | MaterialRecordParameters::angular_velocity |
angular velocity of object, used for radar | |
float | MaterialRecordParameters::objectId |
object id, used for tracking and clustering in radar | |
float3 | PerRayData_camera::color |
color packed on the ray | |
float3 | PerRayData_camera::contrib_to_pixel |
the current contribution to the pixel | |
curandState_t | PerRayData_camera::rng |
a random number generator. Only valid if use_gi is true | |
int | PerRayData_camera::depth |
the current depth of the ray | |
bool | PerRayData_camera::use_gi |
whether global illumination is on | |
float3 | PerRayData_camera::albedo |
the albed of the first hit | |
float3 | PerRayData_camera::normal |
the global normal of the first hit | |
bool | PerRayData_camera::use_fog |
whether to use fog on this prd | |
float | PerRayData_depthCamera::depth |
unsigned short int | PerRayData_semantic::class_id |
the class id of the first hit | |
unsigned short int | PerRayData_semantic::instance_id |
the instance id of the first hit | |
float3 | PerRayData_shadow::attenuation |
the current attenuation of the light | |
int | PerRayData_shadow::depth |
the current traversal depth of the ray | |
float | PerRayData_shadow::ramaining_dist |
the remaining distance to the light | |
float | PerRayData_lidar::range |
the distance to the first hit | |
float | PerRayData_lidar::intensity |
the intensity of the first hit | |
float | PerRayData_radar::range |
float | PerRayData_radar::rcs |
float3 | PerRayData_radar::velocity |
float | PerRayData_radar::objectId |
Macro Definition Documentation
◆ CUDA_ERROR_CHECK
#define CUDA_ERROR_CHECK | ( | result | ) |
Value:
{ \
if (result != cudaSuccess) { \
std::string error_name = std::string(cudaGetErrorName(result)); \
std::string error_string = std::string(cudaGetErrorString(result)); \
std::string file = std::string(__FILE__); \
std::string line = std::to_string(__LINE__); \
throw std::runtime_error(error_name + ": " + error_string + " at " + file + ":" + line); \
} \
}
Checks the output of a cuda call for any error, will throw a runtime error if not success.
◆ OPTIX_ERROR_CHECK
#define OPTIX_ERROR_CHECK | ( | result | ) |
Value:
{ \
if (result != OPTIX_SUCCESS) { \
std::string error_name = std::string(optixGetErrorName(result)); \
std::string error_string = std::string(optixGetErrorString(result)); \
std::string file = std::string(__FILE__); \
std::string line = std::to_string(__LINE__); \
throw std::runtime_error(error_name + ": " + error_string + " at " + file + ":" + line); \
} \
}
Checks the output of an optix call for any error, will throw a runtime error if not success.
Enumeration Type Documentation
◆ BackgroundMode
|
strong |
◆ CameraLensModelType
enum CameraLensModelType |
◆ LidarBeamShape
|
strong |
◆ PipelineType
|
strong |
◆ RadarReturnMode
|
strong |
◆ RayType
enum RayType |
Function Documentation
◆ GetShaderFromFile()
CH_SENSOR_API void chrono::sensor::GetShaderFromFile | ( | OptixDeviceContext | context, |
OptixModule & | module, | ||
const std::string & | file_name, | ||
OptixModuleCompileOptions & | module_compile_options, | ||
OptixPipelineCompileOptions & | pipeline_compile_options | ||
) |
launches ray generation program
- Parameters
-
context optix device context module optix module that will be created file_name the file where the shader program is implemented module_compile_options compile options for the module pipeline_compile_options compile options for the pipeline
◆ LoadByteImage()
CH_SENSOR_API ByteImageData chrono::sensor::LoadByteImage | ( | const std::string & | filename | ) |
loads image to struct ByteImageData, returns an empty struct with 0 values if loading failed
- Parameters
-
filename
Variable Documentation
◆ anisotropy
float MaterialParameters::anisotropy |
< the emissive color // size 12>
the anisotropic value of material (0-1) // size 4
◆ metallic_tex
cudaTextureObject_t MaterialParameters::metallic_tex |
<an emissive color texture // size 8
a metalic color texture // size 8
◆ normal_buffer
half4* CameraParameters::normal_buffer |
The screen-space normal of the first hit.
Only initialized if using global illumination (screenspace normal)