Tuesday, September 25, 2012

Ray Casting

I started with ray casting of the scene from the camera. Ray casting is a process of shooting rays into the scene to find the first intersection of the rays. The rays are created from the camera and the direction is determined by the pixel the ray is passing through. The rays are then checked for intersection with the scene objects. The material attached to the object is considered as the pixel color. Below is an image (800x800) for 3 spheres in a Cornell box. As you can see from the image, it looks very flat as there were no rays sent out for shadow feelers (to determine light reaching a point) nor were recursive rays sent out within the scene for reflection or transmission.
The ray casting is parallely performed for each pixel of the image and so it is pretty fast.


Next Steps:
  • Figure out how recursion will work on the GPU
  • Call kernel functions for reflected and refracted rays

No comments:

Post a Comment