PDA

View Full Version : raytracer and openCL artifacts



abahena
05-03-2010, 11:51 AM
Hi

Any idea why we are getting this artifacts. Please look at the picture below. if we use a i7 as opencl we get more artifacst than using a ati card, also the code doesnt work in Nvidia opencl implementation, with an nvidia card.

http://www.alchemist3d.com/raytracer.jpg

thanks in advance,

Alex

Considerate
05-06-2010, 12:48 PM
This is a common problem with raytracing.
It is due to floating point imprecision.
To prevent this from happening after reflecting or refracting move the new ray's origin slightly in the ray's direction.


#define EPSILON 0.001f
newOrigin = intersectionPoint + direction * EPSILON;



//Considerate