Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Chouh__Hamza1
Beginner
130 Views

Double precision intersection

Hi all,

In a case I'm working on, I am dealing with high values for tfar compared to the dimensions of my triangles. This results in precision problems, specifically around edges.
Thus, I am thinking about using double precision for ray/triangle intersection. What do you think would be the best approach? For now, I'm considering implementing a user geometry and implementing the Pluecker algorithm with double precision vertex coordinates.

Hamza

0 Kudos
2 Replies
SvenW_Intel
Moderator
130 Views

Using a user geometry to do the job should work. You would then still have vertices as float as well as u,v,t?

Could you describe the problem you face in some more detail? As you mention issues around edges, I assume you see rays tunneling through the mesh at an edge?

Chouh__Hamza1
Beginner
130 Views

Currently, my mesh is described using double precision out of Embree. I think that doing the intersection test using double precision should be enough to avoid the problems I'm describing.

These are, for example, two hits near an edge between two triangles with the following characteristics :

Hit 0 :
tfar = 1000;
u = 0.5
v = 5e-4
primID = 0

Hit 1 :
tfar = 1000
u = -5e-4
v = 0.5
primID = 1

Both these hits verify the condition from triangle_intersector_pluecker.h :
(minUVW >= -eps) | (maxUVW <= eps)

I could choose to eliminate one of the two intersections (which, in this case, are equivalent) when tfar0 ~ tfar1.
However, this would result in missed intersections when two triangles from the same geometries overlap (and in this case, I need to have both the intersections).

Thus, the whole problem consists in deciding whether a ray hit an edge of hits two overlapping triangles, which is problematic when hit distances become high enough to reach the precision limits of the float 32 type.
 

Reply