This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ivec4 ObjectNearestHit (in int theBVHOffset, in int theVrtOffset, in int theTrgOffset, | |
in SRay theRay, in vec3 theInverse, inout SIntersect theHit, in int theSentinel) | |
{ | |
int aHead = theSentinel; // stack pointer | |
int aNode = 0; // node to visit | |
ivec4 aTriIndex = INALID_HIT; | |
float aTimeOut; | |
float aTimeLft; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pushedT = (aTimeLft < aTimeRgh) ? aTimeRgh : aTimeLft; | |
... | |
int aStackOffset = theHit.Time < pushedT ? 2 : 1; | |
if (aHead - aStackOffset + 1 <= theSentinel) | |
return aTriIndex; | |
aNode = Stack[aHead - aStackOffset + 1]; |
NewerOlder