- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
We're using Embree in the latest incarnation of our mental ray compatible raytracer, and we've noticed a bug concerning axis aligned rays. When Embree calculates the reciprocal direction vector, it doesn't check for divide by 0, which then causes it to fail to intersect. Here's a simple fix - in ray.h
#define BIGNUM(3.4E38f)
/*! Constructs a ray from origin, direction, and ray segment. Near
* has to be smaller than far. */
__forceinline Ray(const Vec3f& org, const Vec3f& dir, const float&
near = zero, const float& far = inf)
: org(org), dir(dir), near(near), far(far)
{
rdir.x = (dir.x==0.0f)? BIGNUM : 1.0f/dir.x;
rdir.y = (dir.y==0.0f)? BIGNUM : 1.0f/dir.y;
rdir.z = (dir.z==0.0f)? BIGNUM : 1.0f/dir.z;
}
* has to be smaller than far. */
__forceinline Ray(const Vec3f& org, const Vec3f& dir, const float&
near = zero, const float& far = inf)
: org(org), dir(dir), near(near), far(far)
{
rdir.x = (dir.x==0.0f)? BIGNUM : 1.0f/dir.x;
rdir.y = (dir.y==0.0f)? BIGNUM : 1.0f/dir.y;
rdir.z = (dir.z==0.0f)? BIGNUM : 1.0f/dir.z;
}
I'm sure you guys will have a better solution, but this seems to work, at least. :-)
Congratulations on Embree, it's really zippy! If you're interested in hearing more about our raytracer, let me know!
Best Regards
Matt Taylor
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting this bug. It is fixed in version 1.0 final.
And yes, I'm interested in hearing more about your ray tracer. Please send an email to Embree support.
And yes, I'm interested in hearing more about your ray tracer. Please send an email to Embree support.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page