Hello,
I am trying to include curves support in the Optix_Apps intro_runtime.
I am quite ok in loading .hair file but when I try to add built-in the intersection_program for cubic bspline with the optixBuiltinISModuleGet() function, I encounter the
error lnk2019 unresolved external symbol in optixBuiltinISModuleGet
here is a part of the code I use in the :
// CLOSESTHIT, ANYHIT, INTERSECTION (hit group)
std::string ptxClosesthit = readPTX("./intro_runtime_core/closesthit.ptx");
std::string ptxAnyhit = readPTX("./intro_runtime_core/anyhit.ptx");
OptixModule moduleClosesthit;
OptixModule moduleAnyhit;
OPTIX_CHECK( m_api.optixModuleCreateFromPTX(m_context, &moduleCompileOptions, &pipelineCompileOptions, ptxClosesthit.c_str(), ptxClosesthit.size(), nullptr, nullptr, &moduleClosesthit) );
OPTIX_CHECK( m_api.optixModuleCreateFromPTX(m_context, &moduleCompileOptions, &pipelineCompileOptions, ptxAnyhit.c_str(), ptxAnyhit.size(), nullptr, nullptr, &moduleAnyhit) );
OptixProgramGroupDesc programGroupDescHitRadiance;
memset(&programGroupDescHitRadiance, 0, sizeof(OptixProgramGroupDesc));
// ADDED
const OptixModuleCompileOptions defaultOptions = { OPTIX_COMPILE_DEFAULT_MAX_REGISTER_COUNT,
OPTIX_COMPILE_OPTIMIZATION_DEFAULT,
OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO };
OptixModule cubicCurveModule;
OptixBuiltinISOptions builtinISOptions = {};
builtinISOptions.builtinISModuleType = OPTIX_PRIMITIVE_TYPE_ROUND_CUBIC_BSPLINE;
OPTIX_CHECK(optixBuiltinISModuleGet(m_context, &defaultOptions, &pipelineCompileOptions, &builtinISOptions, &cubicCurveModule)); // Here is the error
programGroupDescHitRadiance.kind = OPTIX_PROGRAM_GROUP_KIND_HITGROUP;
programGroupDescHitRadiance.flags = OPTIX_PROGRAM_GROUP_FLAGS_NONE;
programGroupDescHitRadiance.hitgroup.moduleCH = moduleClosesthit;
programGroupDescHitRadiance.hitgroup.entryFunctionNameCH = "__closesthit__radiance";
//ADDED
programGroupDescHitRadiance.hitgroup.moduleIS = cubicCurveModule;
programGroupDescHitRadiance.hitgroup.entryFunctionNameIS = 0;
OptixProgramGroup programGroupHitRadiance;
OPTIX_CHECK( m_api.optixProgramGroupCreate(m_context, &programGroupDescHitRadiance, 1, &programGroupOptions, nullptr, nullptr, &programGroupHitRadiance ) );
could you help me with that please ?
For information, I runned the OptixHair sample from optix7.1 and it works pretty well. I take inspiration from this code to implement it in Optix_Apps. So I already adapted the Hair and HairFile classes for OptixApps and now I am trying to add a specific closest_hit for curves.
Here are the versions I use :
Visual Studio 2017
Optix7.1
Cuda10
Many thanks for your help !