Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions tutorials/verify/verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2560,8 +2560,27 @@ namespace embree
RTCRayHit ray3 = makeRay(pos3+Vec3fa(0,10,0),Vec3fa(0,-1,0)); ray3.ray.mask = mask3;
RTCRayHit rays[4] = { ray0, ray1, ray2, ray3 };
IntersectWithMode(imode,ivariant,scene,rays,4);
for (size_t j=0; j<4; j++)
passed &= masks[j] & (1<<j) ? rays[j].hit.geomID != RTC_INVALID_GEOMETRY_ID : rays[j].hit.geomID == RTC_INVALID_GEOMETRY_ID;

switch (ivariant & VARIANT_INTERSECT_OCCLUDED_MASK)
{
case VARIANT_INTERSECT:
case VARIANT_INTERSECT_OCCLUDED:
{
for (size_t j = 0; j < 4; j++)
passed &= masks[j] & (1 << j) ? rays[j].hit.geomID != RTC_INVALID_GEOMETRY_ID : rays[j].hit.geomID == RTC_INVALID_GEOMETRY_ID;
break;
}
case VARIANT_OCCLUDED:
{
// There's not much we can verify here. 'hit' information is only available when calling rtcIntersect, not on rtcOccluded.
// We can only identify that something was hit by testing rays[j].ray.tfar == -inf.
break;
}
default:
{
assert(false);
}
}
}
AssertNoError(device);

Expand Down Expand Up @@ -3962,7 +3981,7 @@ namespace embree
rayHit.ray.dir_z = 1;
rayHit.ray.tnear = 0;
rayHit.ray.tfar = 100000;
rayHit.ray.mask = 0u;
rayHit.ray.mask = -1;
rayHit.ray.flags = 0u;
rayHit.hit.geomID = RTC_INVALID_GEOMETRY_ID;
rayHit.hit.instID[0] = RTC_INVALID_GEOMETRY_ID;
Expand Down