cancel
Showing results for 
Search instead for 
Did you mean: 

Newcomers Start Here

Highlighted
Journeyman III
Journeyman III

IntersectBatch is not intersecting at all - Firerays

/*DEVICE SETUP*/

int gpuidx = -1;

for (int idx = 0; idx < IntersectionApi::GetIntersectionDeviceCount(); ++idx) {

     IntersectionDeviceInfo const& devinfo(IntersectionApi::GetIntersectionDeviceInfo(idx));

     if (devinfo.type == IntersectionDeviceInfo::kGpu && devinfo.apis & IntersectionDeviceInfo::kOpenCl) {

          gpuidx = idx;

     }

}

int apitype = IntersectionDeviceInfo::kOpenCl;

scene = IntersectionApi::Create(0, &gpuidx, &apitype, 1);

/* SCENE SETUP */

Shape *shape = scene->CreateMesh(&vertex[0].x, numVert, sizeof(vec4), &v->at(0), sizeof(int) * 3, nullptr, numTri/3);

scene->AttachShape(shape);
scene->Commit();

/* BUFFERS SETUP */

hitsGPU = scene->CreateBuffer(hitBufferRayCount * sizeof(Intersection), nullptr);

raysGPU = scene->CreateBuffer(rayBufferRayCount * sizeof(ray), raysCPU);

hitsCPU = (Intersection*)malloc(sizeof(Intersection)*hitBufferRayCount);

raysCPU = (ray*)malloc(sizeof(ray)*rayBufferRayCount);

m_Rays->getData(0, rayBufferRayCount, raysCPU);

scene->IntersectBatch(raysGPU, hitBufferRayCount, hitsGPU, nullptr, &event);

event->Wait();

scene->MapBuffer(hitsGPU, MapType::kMapRead, 0, hitBufferRayCount*sizeof(Intersection), (void**)&hitsCPU, &event);

event->Wait() ;

The call of the IntersectionBatch function results in bad intersections.
i dont know what i am doing wrong.

0 Kudos
2 Replies
Highlighted
Challenger
Challenger

Re: IntersectBatch is not intersecting at all - Firerays

You will get a better response here if you describe in detail what you are trying to achieve, and what the problem is.

0 Kudos
Highlighted
Staff
Staff

Re: IntersectBatch is not intersecting at all - Firerays

Hi dimz,

I would suggest reporting the issues related to FireRays in its Github repository here: https://github.com/GPUOpen-LibrariesAndSDKs/FireRays_SDK

When reporting the issue there please make sure you include your hardware configuration, driver and OpenCL runtime version.

0 Kudos