chrono::sensor::ChOptixPipeline Class Reference

Description

Class to hold all the Shader Binding Table parameters adnd manage the ray tracing pipeline, materials, ray gen programs.

#include <ChOptixPipeline.h>

Public Member Functions

 ChOptixPipeline (OptixDeviceContext context, unsigned int trace_depth, bool debug)
 Class constructor. More...
 
 ~ChOptixPipeline ()
 Class destructor. Cleans up all data associated with the pipeline.
 
void SpawnPipeline (PipelineType type)
 Create a new pipeline for a specific type of sensor. More...
 
unsigned int GetBoxMaterial (std::vector< std::shared_ptr< ChVisualMaterial >> mat_list={})
 Creates a new box material. More...
 
unsigned int GetSphereMaterial (std::vector< std::shared_ptr< ChVisualMaterial >> mat_list={})
 Creates a new sphere material. More...
 
unsigned int GetCylinderMaterial (std::vector< std::shared_ptr< ChVisualMaterial >> mat_list={})
 Creates a new cylinder material. More...
 
unsigned int GetRigidMeshMaterial (CUdeviceptr &d_vertices, CUdeviceptr &d_indices, std::shared_ptr< ChVisualShapeTriangleMesh > sphere_shape, std::vector< std::shared_ptr< ChVisualMaterial >> mat_list)
 Creates a new rigid material/mesh in optix. More...
 
unsigned int GetDeformableMeshMaterial (CUdeviceptr &d_vertices, CUdeviceptr &d_indices, std::shared_ptr< ChVisualShapeTriangleMesh > sphere_shape, std::vector< std::shared_ptr< ChVisualMaterial >> mat_list)
 Creates a new deformable material/mesh in optix. More...
 
unsigned int GetNVDBMaterial (std::vector< std::shared_ptr< ChVisualMaterial >> mat_list={})
 
void UpdateDeformableMeshes ()
 Function to update all the deformable meshes in the optix scene based on their chrono meshes.
 
void UpdateAllSBTs ()
 Function to update all the shader binding tables associated with this optix scene.
 
void UpdateAllPipelines ()
 Function to update all the pipeline associated with this optix scene.
 
void UpdateObjectVelocity ()
 Function to update all object velocities. More...
 
CUdeviceptr GetMeshPool ()
 Function to access the mesh pool on the device. More...
 
CUdeviceptr GetMaterialPool ()
 Function to access the material pool on the device. More...
 
void AddBody (std::shared_ptr< ChBody > body)
 Add a new body to the optix scene based on a chrono body. More...
 
OptixPipeline & GetPipeline (unsigned int id)
 OptixPipeline accessor function. More...
 
std::shared_ptr< OptixShaderBindingTable > GetSBT (unsigned int id)
 SBT accessor. More...
 
std::shared_ptr< Record< RaygenParameters > > GetRayGenRecord (unsigned int id)
 Raygen record accessor. More...
 
void Cleanup ()
 Explicit cleanup function for freeing memory associated with this pipeline which should be freed before reconstructing the pipeline. More...
 
void CleanMaterials ()
 Explicit material cleanup function for freeing all memory associate with materials in the optix scene.
 
void UpdateBackground (Background b)
 Updates the background of the scene. More...
 

Constructor & Destructor Documentation

◆ ChOptixPipeline()

chrono::sensor::ChOptixPipeline::ChOptixPipeline ( OptixDeviceContext  context,
unsigned int  trace_depth,
bool  debug 
)

Class constructor.

Creates a ChOptixPipeline that can manage sensors, materials, and SBT information

Parameters
contextThe optix context to which this pipeline will be attached
trace_depththe maximum trace depth for ray recusions in this pipeline (contant for all sensors in the pipeline)
debugwhether the pipeline should be run in debug mode. Only use for development as this slows down the ray tracing

Member Function Documentation

◆ AddBody()

void chrono::sensor::ChOptixPipeline::AddBody ( std::shared_ptr< ChBody body)
inline

Add a new body to the optix scene based on a chrono body.

Parameters
bodythe Chrono body from which to create an optix object

◆ Cleanup()

void chrono::sensor::ChOptixPipeline::Cleanup ( )

Explicit cleanup function for freeing memory associated with this pipeline which should be freed before reconstructing the pipeline.

Any reusable varaibles will not be cleaned up here

◆ GetBoxMaterial()

unsigned int chrono::sensor::ChOptixPipeline::GetBoxMaterial ( std::vector< std::shared_ptr< ChVisualMaterial >>  mat_list = {})

Creates a new box material.

Parameters
mat_listthe chrono material from which to create an optix material
Returns
an id pointing to the material that was created

◆ GetCylinderMaterial()

unsigned int chrono::sensor::ChOptixPipeline::GetCylinderMaterial ( std::vector< std::shared_ptr< ChVisualMaterial >>  mat_list = {})

Creates a new cylinder material.

Parameters
mat_listthe chrono material from which to create an optix material
Returns
an id pointing to the material that was created

◆ GetDeformableMeshMaterial()

unsigned int chrono::sensor::ChOptixPipeline::GetDeformableMeshMaterial ( CUdeviceptr &  d_vertices,
CUdeviceptr &  d_indices,
std::shared_ptr< ChVisualShapeTriangleMesh sphere_shape,
std::vector< std::shared_ptr< ChVisualMaterial >>  mat_list 
)

Creates a new deformable material/mesh in optix.

Parameters
[out]d_verticesa device pointer where the mesh's vertices will be stored
[out]d_indicesa device pointer where the mesh's indices will be stored
[in]sphere_shapethe chrono mesh to add to the optix scene
[in]mat_listthe chrono materials from which to create an optix material
Returns
an id pointing to the material that was created

◆ GetMaterialPool()

CUdeviceptr chrono::sensor::ChOptixPipeline::GetMaterialPool ( )

Function to access the material pool on the device.

Returns
a device pointer to the collection of materials

◆ GetMeshPool()

CUdeviceptr chrono::sensor::ChOptixPipeline::GetMeshPool ( )

Function to access the mesh pool on the device.

Returns
a device pointer to the collection of meshes

◆ GetPipeline()

OptixPipeline & chrono::sensor::ChOptixPipeline::GetPipeline ( unsigned int  id)

OptixPipeline accessor function.

Parameters
idthe id of the desired pipeline
Returns
a reference to the specified OptixPipeline

◆ GetRayGenRecord()

std::shared_ptr< Record< RaygenParameters > > chrono::sensor::ChOptixPipeline::GetRayGenRecord ( unsigned int  id)

Raygen record accessor.

Parameters
idthe id of the pipline whose raygen record should be returned
Returns
a shared pointer to the specified raygen record

◆ GetRigidMeshMaterial()

unsigned int chrono::sensor::ChOptixPipeline::GetRigidMeshMaterial ( CUdeviceptr &  d_vertices,
CUdeviceptr &  d_indices,
std::shared_ptr< ChVisualShapeTriangleMesh sphere_shape,
std::vector< std::shared_ptr< ChVisualMaterial >>  mat_list 
)

Creates a new rigid material/mesh in optix.

Parameters
[out]d_verticesa device pointer where the mesh's vertices will be stored
[out]d_indicesa device pointer where the mesh's indices will be stored
[in]sphere_shapethe chrono mesh to add to the optix scene
[in]mat_listthe chrono materials from which to create an optix material
Returns
an id pointing to the material that was created

◆ GetSBT()

std::shared_ptr< OptixShaderBindingTable > chrono::sensor::ChOptixPipeline::GetSBT ( unsigned int  id)

SBT accessor.

Parameters
idthe id of the pipeline whose shader binding table should be returned
Returns
a shared pointer to the specified shader binding table

◆ GetSphereMaterial()

unsigned int chrono::sensor::ChOptixPipeline::GetSphereMaterial ( std::vector< std::shared_ptr< ChVisualMaterial >>  mat_list = {})

Creates a new sphere material.

Parameters
mat_listthe chrono material from which to create an optix material
Returns
an id pointing to the material that was created

◆ SpawnPipeline()

void chrono::sensor::ChOptixPipeline::SpawnPipeline ( PipelineType  type)

Create a new pipeline for a specific type of sensor.

Parameters
typethe type of sensor/ray tracing to add to the pipeline manager

◆ UpdateBackground()

void chrono::sensor::ChOptixPipeline::UpdateBackground ( Background  b)

Updates the background of the scene.

Only used for cameras

Parameters
ba new background to use for the scene. The old background will be removed

◆ UpdateObjectVelocity()

void chrono::sensor::ChOptixPipeline::UpdateObjectVelocity ( )

Function to update all object velocities.

Only required for sensors that measure velocity with is a dynamic property


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_sensor/optix/ChOptixPipeline.h
  • /builds/uwsbel/chrono/src/chrono_sensor/optix/ChOptixPipeline.cpp