I am using OptiX 9.1 for volumetric tracing of sphere primitives. I am having difficulties in finding the correct information for the following.
I am using SER. An overview of my raygen is:
optixTraverse(...);
if (optixHitObjectIsHit())
{
optixReorder();
optixInvoke();
}
else if (optixHitObjectIsMiss())
{
// Do miss stuff
}
First of all, is my SER logic correct, i.e., do I use the API correctly/according to best usage guidelines?
Second, in my closest hit program, I am trying to determine if the reported hit is front or back face (in the case of spheres I assume entry/exit point). I am using the following:
float t_hit = optixGetRayTmax();
bool is_entry = optixIsFrontFaceHit();
According to this post the builtin sphere intersection program should report the closest intersection distance. From what I understand optixGetRayTmax() will not always return a front face hit (in the case of the sphere an entry hit) but only the closest hit (which could either be an entry or an exit one).
Again according to the same post, `optixGetAttribute_0()` should return the second closest intersection distance. I am using the following in an effort to understand what hits are reported float t_hit_other = __uint_as_float(optixGetAttribute_0()) in the closest hit, but it always returns `0.0f` (I have specified 2 attributes at module creation on the host side).
What am I missing/haven’t undstood correctly? Another thing that passed my mind is that backface culling could be enabled by default. But I couldn’t find a related ray flag to use.
Thanks for your time