For each objects (geometry instances) in my scene I want to set two materials. One specific for each object, and an other common to all (or a group of) objects.
For the one specific to each object, there is no problem.
But for the other, I’ve got some trouble.
First I create the material from the context, and I set to it the closest hit program. Then, where I create each geometry instance, I set the material count to 2, and I add the common material to the current geometry instance. Afterward, I set a variable, “matVal”, to 1 to the material.
My problem is, the value set to matVal is only correct for the first object to which I linked the material. All other objects have matVal equal to 0.
How can I attach a material to several geometry instances?
For information, I’m under CentOS 7, with Optix 6.0.0 and cuda 10.2.