Hello, I’m trying to implement a basic procedure to show/hide geometry within the rendered scene. I use a Selector for this. I couldn’t find any examples on Selector use, so I might use it incorrectly and that’s why the program crashes. Below is a simple implementation example:
//--------cuda file
#include <optix.h>
rtDeclareVariable(int, vis, , );
RT_PROGRAM void vis_prog()
{
rtIntersectChild(0);
}
//----------program
optix::Selector selector = context->createSelector();
//create program from ptx
…
optix::Program selection_program;
//–
selector->setVisitProgram(selection_program);
selector->addChild(group_to_hide_or_show);
//---------------------------
The scene contains other groups, but I’m not adding them to selector.
All steps are passed successfully (generation of PTX, creating selector, scene and etc.), but after launch I receive the following error:
Uses:
%6 = call float* @_ZN4cort11AABB_getPtrEPNS_14CanonicalStateE(%“struct.cort::C
anonicalState.4”* %0) #1
%7 = call i32 @_ZN4cort24Traversal_getCurrentNodeEPNS_14CanonicalStateE(%“stru
ct.cort::CanonicalState.4”* %0) #1
%8 = call i32 @_ZN4cort33GraphNode_convertToSelectorHandleEPNS_14CanonicalStat
eEj(%“struct.cort::CanonicalState.4”* %0, i32 %7) #1
%9 = call i32 @_ZN4cort20Selector_getChildrenEPNS_14CanonicalStateEj(%“struct.
cort::CanonicalState.4”* %0, i32 %8) #1
call void @_ZN4cort33Runtime_computeGraphNodeGeneralBBEPNS_14CanonicalStateEjP
NS_9GeneralBBE(%“struct.cort::CanonicalState.4”* %0, i32 %25, %“struct.cort::Gen
eralBB”* %childbb) #1
Are there any suggestions what I do wrong or maybe there are more detailed examples on how to use Selectors in Optix?
Thank you very much in advance,
Evgeniya
//-------------------
Device info:
OptiX 6.0.0
Number of Devices = 1
Device 0: Quadro P4000
Compute Support: 6.1
Total Memory: 8589934592
Clock Rate: 1480000 kHz
Max. Threads per Block: 1024
Streaming Multiprocessor Count: 14
Execution Timeout Enabled: 1
Max. Hardware Texture Count: 1048576
TCC Driver enabled: 0
CUDA Device Ordinal: 0