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

Floating point problem

Al_N_
Beginner
320 Views

Hi,

as a test, I have a rectangle of size 20 with its center at origin 0,0,0 with the face normal on the x axis and shoot a ray from org=(254894535,0,0) and dir=(-1,0,0)

I would expect tfar to return 254894535 but it return 254894528 instead, 7 is a lot when calculating the hit point, any idea what this could be??? thanks.

 

0 Kudos
2 Replies
Keymaster
New Contributor I
320 Views

Your absolute error is 7, but the relative error is 2.7e-8, which is pretty low for IEEE754 single precision. This is just how IEEE floating point numbers work. Just use a closer origin (with possibly negative tnear, but I dont know if embree supports that)

0 Kudos
Al_N_
Beginner
320 Views

Thanks

0 Kudos
Reply