I have thought about the two function for a couple of days,but there still are some aspects I don’t understand.Now I will write down my confusion,I hope someone can correct my misunderstandings.
bool rtPotentialIntersection(float t)
rtPotentialIntersection will determine whether the reported hit distance is within the valid interval associated with the ray, and return true if the intersection is valid.
q1:In a Intersection Program, first the hit distance, t, will be computed. What does the t-value mean? How can it be computed? I didn’t found any information about it.
q2: What does the valid interval mean? It is decided by programmer or default? How can I known the value of interval?
q3: If the function return false, the intersection program will trivially return. Does it imply the ray hit nothing, and the miss program will be invoked?
q4: Now we assume rtPotentialIntersection returned true. it imply the ray hit someting, but at the moment, we don’t know what kind of material it hit, the material can be either opaque or transparent, so we call it Potential Intersection. Is it right? I hope someone can explain what any_hit mean in detail for me, I appreciate it.
Subsequently, the geometry program will compute the attributes (normal, texture coordinates, etc.) associated with the intersection before calling rtReportIntersection. Now I want to talk about the second function.
bool rtReportIntersection(unsigned int material)
If rtReportIntersection is invoked, at the same time any_hit program will be invoked, whether rtReportIntersection return true or false is decided by any_hit program.
If rtIgnoreIntersection is called, rtReportIntersection will return false, which means the intersection not exist, the object is probably transparent. Otherwise rtReportIntersection returns true, and then closest_hit Program will be invoked.
This is my understanding about rtReportIntersection.
These are my questions and understanding, I expect you can solve my questions and point out my misunderstanding. Thank you.