Optix 6: Ray-generation program with only anyhit rays. All hits ignored?

We are a bit stumped by a problem that has shown up twice now. If the ray-generation program only shoots shadow rays (as in, e.g., a lightmap baker) the anyhit program does not seem to run (prd.hit is not recorded). By just adding a dummy closest-hit trace in the beginning of the shader everything works again. Is this a known problem? Am I missing something?

Hello. This should work just fine.

By ‘adding a dummy closest hit trace’ do you mean that you now trace an additional ray with a separate ray-type which has a closest-hit bound or did you bind a closest hit program to the ray-type that originally only had an any-hit bound?

Hi, im not sure if this is the correct place, but I’m facing a similar issue. I use OptiX6.5 at the moment.
I shoot shadow rays and normal rays. Even if I set RT_RAY_FLAG_DISABLE_ANYHIT i can see that anyHit is called by the normal rays. And I also declared use anyHit_shadow for shadow rays and anyHit for nomal rays, unfortunately it doesnt work as expected. Do you have any ideas?


rtTrace(top_shadower, shadow_ray, shp, RT_VISIBILITY_ALL ,RT_RAY_FLAG_DISABLE_CLOSESTHIT);


rtTrace(top_object, ray, prd, RT_VISIBILITY_ALL, RT_RAY_FLAG_DISABLE_ANYHIT);

        <Function type="AnyHit"     name="anyHit"               rayType="0" />
        <Function type="AnyHit"     name="anyHit_shadow"        rayType="1" />