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

subd not watertight

Burr__Adam
Beginner
1,503 Views

I have a test case where a subd intersection is missed in Embree 3.5.0. I'm using these scene flags:

rtcSetSceneFlags (scene_, RTC_SCENE_FLAG_ROBUST | RTC_SCENE_FLAG_DYNAMIC |
    RTC_SCENE_FLAG_CONTEXT_FILTER_FUNCTION);

these geometry flags:

rtcSetGeometryBuildQuality (geom_, RTC_BUILD_QUALITY_REFIT);

and these context flags:

rtcInitIntersectContext (&context);
context.flags = RTC_INTERSECT_CONTEXT_FLAG_COHERENT;

Should I expect robust watertightness with these settings? >99.9% of the intersections are detected correctly but any misses in my particular application are problematic so I'm not sure how to proceed.

0 Kudos
1 Solution
SvenW_Intel
Moderator
1,503 Views

This problem is already know to us for a long time, but is tricky to fix because of the way Embree operates to tessellate the subdiv surface. If watertightness is a concern, then please use OpenSubDiv to create a mesh and render that mesh with triangles in Embree.

View solution in original post

0 Kudos
5 Replies
Burr__Adam
Beginner
1,503 Views

One random thought I had was to fire small ray packets separated by tiny epsilons and compare their results, but that seems like a potentially complex, heavy handed solution.

0 Kudos
Burr__Adam
Beginner
1,503 Views

One more bit of info, the miss (I've only seen one so far) occurs on a quad face sharing a valence 5 extraordinary vertex, I don't know if that is a coincidence or not.

0 Kudos
Burr__Adam
Beginner
1,503 Views

This screenshot is not for debugging, just for context. I am using Embree to project geometry onto subd surfaces, not a typical ray-tracing application but so far it seems to be a very promising approach. You can see one vertex is missing the surface causing a large distortion. The ray origin is not near the surface so that isn't the issue.

0 Kudos
SvenW_Intel
Moderator
1,504 Views

This problem is already know to us for a long time, but is tricky to fix because of the way Embree operates to tessellate the subdiv surface. If watertightness is a concern, then please use OpenSubDiv to create a mesh and render that mesh with triangles in Embree.

0 Kudos
Burr__Adam
Beginner
1,503 Views

OK, I'll try OpenSubdiv. You reccomend RTC_GEOMETRY_TYPE_TRIANGLE, not RTC_GEOMETRY_TYPE_QUAD?

I did see this in the docs which makes sense of course:

Note that edges may be shared between (typically 2) faces. To guarantee a watertight tessellation, the level of these shared edges should be identical. A uniform tessellation rate for an entire subdivision mesh can be set by using the rtcSetGeometryTessellationRate function. 

But I'm using the uniform rtcSetGeometryTessellationRate so I thought that implied watertightness. Anyway, thanks for your help, let me know if you need a test case.

 

0 Kudos
Reply