I’m having some trouble getting OptiXMesh to do what I want.
I’m running OptiX 3.9.1, CUDA 7.5, Windows 7 (64-Bit).
My wish is to set some variables per group within the mesh. These variables differ per material.
I use a functor to walk over all MeshGroups within an imported OptiXMesh.
mesh.loadBegin_Geometry(obj_filename);
mesh.forEachGroup(per_group_functor);
mesh.loadFinish_Materials();
Within the functor I would like to set the variables on the material of each group.
Material material = m_mesh->getOptiXMaterial(group.material_number);
material["variable_name"]->setFloat(variable_value);
However, it seems that setting variables this way sets them for all groups.
Afterwards the last variable is set on all materials (which I checked using mesh->getOptiXMaterial(i)).
Maybe getOptiXMaterial always returns the same material, despite the group.material_number being different?
Do I misunderstand something, or is this possibly one of the issues discussed in this topic? Any suggestions how I might be able to set variables per material/group? I cannot upgrade to OptiX 4.0 since I’m on a Fermi class GPU.