Clip planes/section planes
straaljager opened this issue · comments
Hi there,
are there any plans for clipping plane support in VisRTX? For example Iray has section planes which optionally allow light to pass through as if the geometry was cut away entirely (https://blog.irayrender.com/post/48117954581/section-planes). This would be a very useful feature for visualizing both meshes, isosurfaces and volumes.
Thanks for the suggestion; that would be a valuable feature indeed!
I'll put it on the TODO list. Let's keep this issue open.
Sam, I've added an experimental clipping planes feature in 4565194.
Use Renderer::SetClippingPlanes
to set an arbitrary number of planes. A plane is defined by position
, normal
and primaryRaysOnly
, where primaryRaysOnly
controls whether the geometry is cut off completely and also affects lighting accordingly (false
), or to just let the viewer take a peek inside at unaltered lighting (true
), similar to the Iray section planes.
Looking forward to your feedback!
Thanks,
Tim
Awesome, thanks Tim. That was very fast.
Hi Tim,
I tried to compile this experimental branch with clipping planes, but we hit a snag. The code does not compile with Optix 5.1
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(815): error: identifier "RTrayflags" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(815): error: identifier "RT_RAY_FLAG_NONE" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(815): error: identifier "RT_RAY_FLAG_DISABLE_ANYHIT" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(816): error: identifier "RT_VISIBILITY_ALL" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(816): error: no instance of overloaded function "rtTrace" matches the argument list
argument types are: (rtObject, optix::Ray, PathtracePRD, <error-type>, const <error-type>)
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(1291): error: identifier "RTrayflags" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(1291): error: identifier "RT_RAY_FLAG_NONE" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(1291): error: identifier "RT_RAY_FLAG_DISABLE_ANYHIT" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(1292): error: identifier "RT_VISIBILITY_ALL" is undefined
/home/lapere/Code/VisRTX/src/Pathtracer/Pathtracer.cu(1292): error: no instance of overloaded function "rtTrace" matches the argument list
argument types are: (rtObject, optix::Ray, PickStruct, <error-type>, const <error-type>)
Oh, yes, indeed! Sorry about that!
Is there a particular reason why you are using OptiX 5.1? Even on non-Turing hardware I do recommend upgrading to OptiX 6.
The ray flags however are just a performance optimization, i.e., disabling the any hit program if there are no clipping planes.
For testing, you could simply remove those undefined flags from the rtTrace calls.
Let me know how it works out!
Thanks!
I've implemented a check to use the RTrayflags only with OptiX 6 in 50bf042.
Thanks, I will upgrade to Optix 6.0 soon and check it out.
Awesome, thanks for the positive feedback! :)