Skip to content

Commit

Permalink
Compatibility fix: Use RTrayflags only with OptiX 6
Browse files Browse the repository at this point in the history
  • Loading branch information
tbiedert committed May 2, 2019
1 parent 3f6b9a9 commit 50bf042
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ VisRTX is a C++ rendering framework developed by the HPC Visualization Developer
* Perspective/orthographic cameras
* Depth of field
* Picking
* Clipping planes
* Tone mapping
* OpenGL interop
* Dynamic loading of VisRTX library
Expand Down
12 changes: 10 additions & 2 deletions src/Pathtracer/Pathtracer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,12 @@ RT_FUNCTION void Pathtrace(const float3 & rayOrigin, const float3 & rayDirection
prd.lightPdf = PDF_DIRAC;
prd.light = false;

const RTrayflags rayFlags = launchParameters[0].numClippingPlanes > 0 ? RT_RAY_FLAG_NONE : RT_RAY_FLAG_DISABLE_ANYHIT;
#if OPTIX_VERSION_MAJOR >= 6
const RTrayflags rayFlags = (launchParameters[0].numClippingPlanes > 0) ? RT_RAY_FLAG_NONE : RT_RAY_FLAG_DISABLE_ANYHIT;
rtTrace(/*launchParameters[0].*/topObject, ray, prd, RT_VISIBILITY_ALL, rayFlags);
#else
rtTrace(/*launchParameters[0].*/topObject, ray, prd);
#endif

// Store primary hit depth (can't store albedo here because it's set/modified by the material)
if (prd.depth == 0)
Expand Down Expand Up @@ -1288,8 +1292,12 @@ RT_PROGRAM void RayGenPick()
pick.primIndex = 0;
pick.t = 0.0f;

const RTrayflags rayFlags = launchParameters[0].numClippingPlanes > 0 ? RT_RAY_FLAG_NONE : RT_RAY_FLAG_DISABLE_ANYHIT;
#if OPTIX_VERSION_MAJOR >= 6
const RTrayflags rayFlags = (launchParameters[0].numClippingPlanes > 0) ? RT_RAY_FLAG_NONE : RT_RAY_FLAG_DISABLE_ANYHIT;
rtTrace(/*launchParameters[0].*/topObject, ray, pick, RT_VISIBILITY_ALL, rayFlags);
#else
rtTrace(/*launchParameters[0].*/topObject, ray, pick);
#endif

pickResult[0] = pick;
}
Expand Down
2 changes: 1 addition & 1 deletion src/VisRTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace VisRTX
rtDeviceGetAttribute(i, RT_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY, sizeof(computeCapability), &computeCapability);

if (computeCapability[0] < 5)
deviceValid = false;
deviceValid = false;
#endif

if (deviceValid)
Expand Down

0 comments on commit 50bf042

Please sign in to comment.