In the path tracer example in the SDK I want to add an OBJ file to trace, so I went over to the loadGeometry()
function, and right after the last parallelogram creation, I added this code block
OptiXMesh mesh;
mesh.context = context;
loadMesh(mesh_file, mesh);
gis.push_back(mesh.geom_instance);
//setMaterial(gis.back(), diffuse, "diffuse_color", white);
note that gis
is a GeometryInstance
vector.
When I run it, the display window opens, and immediately closes and I get the following exceptions:
Exception thrown at 0x00007FFA2856A388 in optixPathTracer.exe: Microsoft C++ exception: optix::TypeMismatch at memory location 0x0000000E29EFF030.
Exception thrown at 0x00007FFA2856A388 in optixPathTracer.exe: Microsoft C++ exception: optix::Exception at memory location 0x0000000E29EFF5C0.
If I comment out the modified code block, it works fine.
How can I load an OBJ file to the tracer? Do I need to add something in the shaders / RT_PROGRAMs side? Thank in advance!
P.S. I know that the loadMesh()
function takes care of the material, but since the program doesn't work, I tried to set a material just like it's shown for all the other GeometryInstances, as demonstrated in the code block above.