Since OptiX is not a renderer but a ray casting SDK, it doesn’t know anything about file formats, and it’s your responsibility to convert any model data (vertex attributes, geometric primitives, and materials) to a format that you define in your OptiX-based renderer.
There are many different ways to structure your OptiX render graph contents and even more ways to implement a material system. If you first learn how to do that in OptiX, loading data from model files becomes pretty straightforward.
Materials can still be a pain. It’s of course possible to program a material system which exactly handles the associated MTL material files of an OBJ model.
With that said, you basically need some way to load *.obj files into host memory which you can convert into whatever data you require for your renderer implementation using OptiX.
For the fist step older OptiX SDK examples have been using
tinyobjloader for that: https://github.com/tinyobjloader/tinyobjloader
The newer OptiX SDK 7 versions are loading the more modern Khronos glTF format instead and use the tinygltf loader for that.
Actually Ingo Wald’s SIGGRAPH OptiX 7 course contains at least two examples loading OBJ models, so you can keep studying these.
(I would be wary of the vector class used in that code though because that is not GPU friendly enough.https://forums.developer.nvidia.com/t/optix-7-and-msvs-2017-hello-world-on-windows-10/141711/9 )
My more advanced OptiX 7 apps are using the ASSIMP library to load triangle data of any format supported by that library. I do not handle the materials or textures of that at all, except for the diffuse color. That would require quite some changes to the material system in there and those examples are meant to show other features like multi-GPU and NVLINK resource sharing.
There is an example scene description file named scene_rtigo3_instances.txt for the rtigo3 and nvlink_shared examples which loads the
cow.obj as multiple instances. The scene_rtigo3_models.txt shows how to load a single model.
I use a very simple host side scene graph which is then flattened to an OptiX render graph with single-instancing structure which is fully hardware accelerated by RTX boards.
Please have a look into all sticky threads of this OptiX sub-forum containing the links to these resources.