rtcInterpolate with subdivision surface in dynamic scene

rtcInterpolate with subdivision surface in dynamic scene

I'm building a dynamic scene containing subdivision geometry with continuously updating vertex buffers. I'm making rtcIntersect calls in that scene and the intersections points are updating correctly.

Also, for each intersection I'm calling rtcInterpolate on the vertex buffer and using the calculated tangents to construct an interpolated normal. That works correctly on the first frame, but if the vertex buffer is changed the tangents are no longer correct. Deleting and rebuilding the geometry rather than updating the vertex buffer fixes the problem.

I'm guessing that your suggested solution might be to use OpenSubdiv rather than the built in subdivision geometry. I am planning to make that change anyway so if that will also solve this problem I should be OK going forward, but I thought I would ask in case I might be doing something else wrong.

3 posts / 0 new

Best Reply

Hi Adam,

just double-checking: After updating the vertex array you notified Embree about the changes by calling rtcUpdateGeometryBuffer(...) and rtcCommitGeometry(...)?

 I was calling rtcCommitGeometry  but not rtcUpdateGeometryBuffer, I must have missed that change when upgrading from v2 to v3. I'm surprised the rtcIntersect calls seemed to work without calling rtcUpdateGeometryBuffer, only the rtcInterpolate failed, but both are working now, thanks!

Leave a Comment

Please sign in to add a comment. Not a member? Join today