Sunday, September 30, 2012

Wierd Pattern on the Back Wall

Feautures implemented:
  • Raycasting from a camera into a scenen through a pixel grid
  • Phong lighting for one point light source
  • Diffuse lambertian surfaces
  • Raytraced shadows
  • Cube intersection testing
  • Sphere surface point sampling
I don't know what happened to that wall. The diffuse and  ambient


Finally, I found out why. It is because I used EPSILON in the box-ray intersection set when the ray parrelle with one plane. EPSILON is defined as 0.000000001, which seems too small for a float number camparation. I have changed it to 0.001. 
Now, the picutre looks like this:



No comments:

Post a Comment