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

Intersect and occluded in Embree 2.0

ritwik_d_
Beginner
641 Views

Can anybody tell me the proper way to intersect a ray with a piece of geometry. I have been able to create the geometry but how am I supposed to get the hit information from intersection? What are the primitive IDs in Ray and why are there 2 of them?

Thanks,

Ritwik

0 Kudos
4 Replies
SvenW_Intel
Moderator
641 Views

Please read the API section in readme.pdf and have a look into tutorial00. The scene consists of geometries (e.g. triangle meshes), each having multiple primitives (e.g. triangles). The geomID is the identifier of the hit geometry, and the primID the identifier of the hit primitive inside this geometry.

0 Kudos
ritwik_d_
Beginner
641 Views

Please read the subject of this thread: I am looking for help with Embree 2.0. If there is a "readme.pdf" for 2.0 I would be glad to have it. I have been looking for it for quite some time now and somehow its magically non-existent. Anyway the Ray in Embree 2.0 does not have geomID and primID, instead has id0 and id1 but I don't think they are equivalent because in 2.0 there is no concept of intersecting with a full scene but only to the geometry - so a geomID equivalent would be redundant. So if you have any idea how I can interpret id0, id1 etc. other hit information then please let me know.

Thanks.

0 Kudos
SvenW_Intel
Moderator
641 Views

When creating a triangle mesh in Embree 2.0, you specify id0 and id1 for each triangle (see tutorrial00). These IDs are returned in the i0 and id1 fields of the ray after intersecting with the scene.

0 Kudos
ritwik_d_
Beginner
641 Views

Thanks Sven, this helps. Another thing,  how do I use the barycentric coordinates (u, v) which are returned in the Ray after hit?

On a separate note, since 2.0 does not have a concept of a scene as in 2.3, is it possible to create multiple object into one triangle mesh and treat it as the scene? For example, if there is a scene which consists of a cube and a ball (mutually disjoint), then can I create 1 mesh which contains both these objects and then intersect it with the ray?

Thanks,

Ritwik

0 Kudos
Reply