# Wrong hit point and wrong surface normal.

## Wrong hit point and wrong surface normal.

Is it possible in Embree to do the following (see attached jpg for full explanation)? Thanks.

AttachmentSize
81.69 KB
5 posts / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.

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.

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.

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.

Thank you :)