Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)

Inrtersection Filter

Igors__Igors
Beginner
1,008 Views

Hi All

I'm porting from Embree 2 to latest 3.5.1. For shadows I need to ignore some intersections

a) if ray hits the same facet it's cast from

b) if ray hits the neighbor facets with same normal

My inersection filter gives ray.geomID == RTC_INVALID_GEOMETRY_ID almost always, but it does not mean background (ray hits nothing), I receive correct geom/primID but only after rtIntersect1 returns control. So I've forced to cast ray again if the hit should be ignored. Also most of unwanted intersection can be excluded if specify some tnear - but it's inaccurate

How can I skip such facets?

Thx

0 Kudos
2 Replies
SvenW_Intel
Moderator
1,008 Views

You only shoot single rays with rtcIntersect1? When you receive invalid geomID inside your intersection filter, then you likely have the wrong hit layout. Or, maybe you cast the filter_arg->ray member to a rayhit? Please not that inside the filter callback the ray pointer only points to the ray, while you should read the geomID/primID/u/v/t etc. from the hit member of the filter_args.

0 Kudos
Igors__Igors
Beginner
1,008 Views

Hi, Sven

Thx for your reply. Yes, I use only rtcIntersect1. After experimenting I've found the hit info is valid inside filter in this case (was confused because doc says that no). Please correct if I'm wrong

BTW: before porting I was ready for next round of PITA with adding building bvh progress indicator and mem usage (with Embree 1 and 2 it was 3/4 of work). But ops! Embree 3 has callbacks to do this, so pleasant surprise! THANK you very much

 

0 Kudos
Reply