Hi all,
Is it possible to call rtTrace inside a RT_CALLABLE_PROGRAM ?
I’m trying to do it but it seems like when I put a rtTrace call into the code of my RT_CALLABLE_PROGRAM, the RT_CALLABLE_PROGRAM is not executed.
More precisely, for this very simple example of Ray Launch program and RT_CALLABLE_PROGRAM :
RT_CALLABLE_PROGRAM void propagate(float3 origin, float3 direction, Mode mode, unsigned material)
{
rtPrintf("Propagating : %f, %f, %f\n", direction.x, direction.y, direction.z);
Ray ray = make_Ray(origin, direction, 0, RAY_EPSILON, RT_DEFAULT_MAX);
Payload pld;
rtTrace(mesh_geometry, ray, pld);
}
rtCallableProgram(void, propagate, (float3 origin, float3 direction, Mode mode, unsigned material));
RT_PROGRAM void launch()
{
float3 direction = directions[launch_index];
propagate(origin, direction, mode, init_material_id);
}
I get no output. It looks like the code from propagate is not executed at all.
When I remove the call to rtTrace, I get the following output :
Propagating : 0.153765, 0.351678, 0.923406
Propagating : 0.800347, 0.218985, 0.558114
Propagating : 0.462844, 0.099148, 0.880878
Propagating : 0.487298, 0.144910, 0.861128
Propagating : 0.767564, 0.500614, 0.400288
Propagating : 0.069481, 0.656887, 0.750781
Propagating : 0.704419, 0.300434, 0.643066
Propagating : 0.644998, 0.763750, 0.025765
Propagating : 0.583844, 0.474976, 0.658426
Propagating : 0.340727, 0.312259, 0.886792
Which is exactly what I would want to see. What am I doing wrong ? Should I find another way than using rtTrace inside a RT_CALLABLE_PROGRAM ?
Thanks,
Hamza