Thank you for your response.
I wanted to divide the roles of the two ray generation programs because LiDar module can be plural, unlike the render camera.
Therefore, I designed the ptx shader for each and then loaded the module individually.
OPTIX_CHECK(optixModuleCreateFromPTX(optixContext,
&moduleCompileOptions,
&pipelineCompileOptions,
ptxCode.c_str(),
ptxCode.size(),
log, &sizeof_log,
&module
));
OPTIX_CHECK(optixAccelBuild(optixContext,
/* stream */stream,
&accelOptions,
triangleInput.data(),
(int)numMeshes,
tempBuffer.d_pointer(),
tempBuffer.sizeInBytes,
outputBuffer.d_pointer(),
outputBuffer.sizeInBytes,
&asHandle,
&emitDesc, 1
));
I understand that the SBT and AS are built over âOptixContextâ(Maybe my misunderstanding). In my implementation, the OptiX context is made multiple.
OptixProgram renderer(âA.ptxâ);
OptixProgram LiDAR(âB.ptxâ);
So I build previously Scene AS twice because of the different programs. This implementation is not efficient in my vision.
As far as sharing SBT or AS memory across two different pipelines, that is fine do to as long as they are compatible with both pipelines. Both the SBT and the ASes do sometimes depends on how your pipeline is setup and what options youâve used, but not always.
Can I understand that the LiDAR program (âB.contextâ) can use the handle created in the renderer program (âA.contextâ)?
B.LaunchParam.handle = A.LaunchParam.handle;
Do you truly need 2 optix pipelines to execute concurrently? Is this because they need to communicate with each other? Can your system be simplified to remove the need for 2 OptiX launches to run? Or combined into a single program?
In the real world, camera and LiDAR systems have different frequencies, so if I divide the program is more helpful. (example. Until 3 frame capture in LiDAR system, vision system only captures 1 frame)
Anyway, I think I can try like this:
enum CameraType{
pinhole,
LiDAR
}
enum RayType{
radiance,
occlusion,
LiDAR
}
and check the camera type on raygen shader,
extern âCâ global void raygen(){
///
if(CameraType == pinhole){
// general render pipeline
}else{
optixTrace(âŠ, RAY_TYPE_LiDAR)
}
}
Would this orientation be more appropriate for OptiX?