I am facing a very strange problem now.
I made my OptiX program into a DLL, and when I put it in the C # console program, everything worked fine. Putting it in Unity3D to call the ray tracing calculation gave me an error and the program crashed.
After debugging, it is found that there is no error when the Unity program runs to the
“const char* testPtx = getPtxString(“draw_color.cu”);” API, but when it runs to the
“Program ray_gen_program1 = context1->createProgramFromPTXString(testPtx, “draw_solid_color”);” API, it crashes and freezes. But after this time, I called the optixHello program in the SDK through the same DLL to run normally when the Check function was removed, but the window popped up by OpenGL did not display any color.
In addition, I found that when compiling PTX code in Unity programs, no matter the path of the .cu file is correct, no matter whether the code in the file is correct, it passes in the SDK API like this(rtProgramCreateFromPTXString(context, ptx, “draw_solid_color”, &ray_gen_program);), but in the end, it does not output correctly in OpenGL. Result (a picture with a custom color).
So can the DLL made by Optix be called by Unity to calculate?