It’s also a good idea to sync these two github repositories optix_advanced_samples and OptiX_Apps and run a source code diff tool between the example folders optixIntroduction_07 with the OptiX 5.1.0 based code and the intro_runtime resp. intro_driver folders in the new OptiX 7 based code.
The README.md in the OptiX 7 based example repository explains the connections between these samples.
The general structure of the OptiX device code inside the
shaders folders is identical, e.g. look at the
miss.cu for example.
The differences are due to the required changes to use OptiX 7 device functions instead of semantic variables, which includes a different attribute handling as well, and the overall different variable handling (scoped variables in the old API vs. launch parameters and SBT data in the new OptiX 7 API).
That also shows the new program domain naming scheme, e.g.
RT_PROGRAM void miss_env_constant()
extern "C" __global__ void __miss__env_constant().
Mind the new required program name prefixes like
__miss__ to tell OptiX 7 what kind of program domain that is for.
Similar for the other program domains.
You can also compare the OptiX 6.5.0 and OptiX 7.2.0 programming guides and API references here: NVIDIA Raytracing Doumentation