Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)
Announcements
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
279 Discussions

## Wrong hit point and wrong surface normal.

Beginner
452 Views
Is it possible in Embree to do the following (see attached jpg for full explanation)? Thanks.
4 Replies
Moderator
452 Views

If you tessellate some surface, it is no longer easily possible to calculate the real hit point based on the hit point of the tessellated version. Thus what you have to do is either:

1) Implement an analytic intersection routine with your curved geometry and add this shape as an Embree user geometry.

2) or, increase the tessellation rate to better approximate the real hit point.

Beginner
452 Views
Thanks for the answer. Isn't there a way you sure? knowing the normal of the 3 vertex, they are directions afterall, the 3 vertex length to each other, isn't that enough info to calculate it? Like for a circle, we can calculate the arc length, then the sagita.based on the chord length and radius. It's not the same I know, but something tells me it can be done, I hope anyway because that would be an awesome feature for embree to have in also returning these 2 extra point by providing the vertex normal buffer to embree. This would provide perfect shading because as it is now, if you create a sphere made from 12 sided circles for example and shine the sun on it, you'll see shadow acne. If we could find the mathematics to make my suggestion work, it would solve the shadow acne problem and we wouldn't have to always tessellate to millions and millions of poly.
Moderator
452 Views

What you are asking for are PN-Triangles (http://alex.vlachos.com/graphics/CurvedPNTriangles.pdf). However, they still have discontinuities of the geometric normal along the edge.

Embree supports Catmull Clark Subdivision surfaces, which is a smooth surface representation. Maybe that is an option for you. However, internally we implement this primitive also through tessellation, however, we cache that tessellation to bound memory consumption.

Beginner
452 Views
Thank you :)