MCPcopy Create free account
hub / github.com/RenderKit/embree / shootRandomRays

Function shootRandomRays

tutorials/verify/verify.cpp:4742–4763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4740 /////////////////////////////////////////////////////////////////////////////////
4741
4742 void shootRandomRays (int hash, std::vector<IntersectMode>& intersectModes, std::vector<IntersectVariant>& intersectVariants, const VerifyScene& scene)
4743 {
4744 RandomSampler sampler;
4745 RandomSampler_init(sampler,hash);
4746
4747 const size_t numRays = 100;
4748 for (auto imode : intersectModes)
4749 {
4750 for (auto ivariant : intersectVariants)
4751 {
4752 if (!has_variant(imode,ivariant)) continue;
4753
4754 RTCRayHit rays[numRays];
4755 for (size_t i=0; i<numRays; i++) {
4756 Vec3fa org = 2.0f*RandomSampler_get3D(sampler) - Vec3fa(1.0f);
4757 Vec3fa dir = 2.0f*RandomSampler_get3D(sampler) - Vec3fa(1.0f);
4758 rays[i] = makeRay(org,dir);
4759 }
4760 IntersectWithMode(imode,ivariant,scene,rays,numRays);
4761 }
4762 }
4763 }
4764
4765 struct RegressionTask
4766 {

Calls 6

RandomSampler_initFunction · 0.85
has_variantFunction · 0.85
RandomSampler_get3DFunction · 0.85
makeRayFunction · 0.85
IntersectWithModeFunction · 0.85
Vec3faClass · 0.50

Tested by

no test coverage detected