Explaining hitgroup records creation in sutil vs path tracer

The main difference between the two applications with respect to the shader binding table (SBT) is that the optixPathTracer only uses a single geometry acceleration structure (GAS) with multiple SBT hit record entries to handle the different colors of the polygons, while the optixMeshViewer is using a two-level acceleration structure, means a single instance acceleration structure (IAS) as root traversable where each mesh GAS is referenced by an instance in that IAS. Therefore the SBT layout needs to be different.

Please read this chapter of the OptiX Programming Guide
https://raytracing-docs.nvidia.com/optix7/guide/index.html#shader_binding_table#shader-binding-table
and concentrate on the SBT index calculation formula in chapter 7.3.
That is crucial to understand with which values from the instance and optixTrace arguments the traversal decides which hit or miss record to call inside your SBT.
Work through the examples given there. The SBT is very flexible and there are some possible structures when using instancing.

Please also refer to these previous posts which explained possible SBT layouts:
https://forums.developer.nvidia.com/t/sbt-theoretical-quesions/179309
https://forums.developer.nvidia.com/t/basic-question-world-and-object-coordinates/169725
https://forums.developer.nvidia.com/t/question-about-sbts/158357
https://forums.developer.nvidia.com/t/multiple-pipelines-and-shared-instancing/170735

1 Like