Visual representation of ray propagation using ray tracing

I do not quite understand though why we should rewrite the material system. The one already existing should be sufficient since, in our case, we just want all materials to have the same properties, just different values on the properties. Like permittivity, permeability etc. And these values later on control how the rays will interact with the objects.

Well, I was expecting that you’d need to implement some other distributions than the Lambert, Specular and GGX distributions. Those are implementing specific reflection and transmission behaviors with an index of refraction and the renderer handles absorption in homogeneous media.

We have added the following code related to hit records in the void Device::createHitGroupRecords() function

That’s not enough. If you implemented your own OptixPipeline, then you also need to build your own SBT with the program headers you got from your own program groups and everything with optixSbtRecordPackHeader() needs to be duplicated as well.
Means you need to duplicate the whole Device::createHitGroupRecords() function and everything referenced in there to a version which only uses your new program groups and a separate SBT.
You must not use these hit groups record headers in your own SBT:
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/rtigo3/src/Device.cpp#L863

That’s why I said you should copy the whole application and replace these things, which would be simpler than bolting on a separate pipeline to the existing application. I was describing how to make the whole simulation a separate application.