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

Function postIntersect

tutorials/pathtracer/pathtracer_device.cpp:1358–1386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1356typedef ISPCInstance* ISPCInstancePtr;
1357
1358inline int postIntersect(const TutorialData& data, const Ray& ray, DifferentialGeometry& dg)
1359{
1360 dg.eps = 32.0f*1.19209e-07f*max(max(abs(dg.P.x),abs(dg.P.y)),max(abs(dg.P.z),ray.tfar));
1361
1362 AffineSpace3fa local2world = AffineSpace3fa::scale(Vec3fa(1));
1363 ISPCGeometry** geometries = data.ispc_scene->geometries;
1364
1365 for (int i=0; i<RTC_MAX_INSTANCE_LEVEL_COUNT; i++)
1366 {
1367 const unsigned int instID = dg.instIDs[i];
1368 if (instID == -1) break;
1369
1370 ISPCInstance* instance = (ISPCInstancePtr) geometries[instID];
1371 local2world = local2world * calculate_interpolated_space(instance,ray.time());
1372
1373 assert(instance->child->type == GROUP);
1374 geometries = ((ISPCGroup*)instance->child)->geometries;
1375 }
1376
1377 int materialID = 0;
1378 ISPCGeometry* geom = geometries[dg.geomID];
1379 auto g = geom; {
1380 postIntersectGeometry(data,ray,dg,g,materialID);
1381 }
1382 dg.Ng = xfmVector(local2world,dg.Ng);
1383 dg.Ns = xfmVector(local2world,dg.Ns);
1384
1385 return materialID;
1386}
1387
1388RTC_SYCL_INDIRECTLY_CALLABLE void occlusionFilterOpaque(const RTCFilterFunctionNArguments* args)
1389{

Callers 1

renderPixelFunctionFunction · 0.70

Calls 7

postIntersectGeometryFunction · 0.85
timeMethod · 0.80
maxFunction · 0.50
absFunction · 0.50
Vec3faClass · 0.50
xfmVectorFunction · 0.50

Tested by

no test coverage detected