Ray Traced Images!
First, here are the images
(in uncompressed JPG instead of PPM for PC compatibility)
:
The first image is the chrome spheres scenario from model1.c; no
parameters have been changed. The recursion depth is 5, which takes
care of all reflections in moderately complex scenarios. The second
image is the glass ball and red ball scenario from model2.c; the only
change is of refractive index from 1.5 to 1.05; this was suggested by
some colleagues to make the red sphere seen in the glass sphere more
visible. The third image is just a variation of model2.c, where a
checkerboard procedural texture is introduced on the plane, mainly for
debugging. The final result still looks cool, specially with a
slightly green transparent sphere put in to simulate green glass, and
the viewing angle changed so that a bit of sky shows through and the
image is inverted.
Features implemented:
- Whitted's illumination model, based on the Phong model but without the specular highlight term.
- Attenuation of diffuse light intensity as a function of distance, and reflected or transmitted light by a constant amount (typically 0.9, actually should be a function of the material).
- Transparency modulated by the material's "transparent color" (another hack to get interesting effects).
- The works. Everything else that Whitted's paper says one should do.
Features unimplemented
- The Fresnel term
- Specular highlights (the full Phong model)
- Anti-aliasing
- Intersection of a transparent object with another object (such a scene requires additional information about which object exists in the overlap region).
- Full reflection and diffuse shading inside solid objects (currently there is a hack that kills everything except refraction if we are inside a sphere trying to get out).
- Support for something other than air (index=1.0) as the medium.
- Proper handling of shadow feelers blocked by transparent objects. Currently these feelers are allowed to go straight through whereas they should bend, just like normal rays do when traced through the object.
- Probably a ton others I am forgetting...
Code
A copy of the code for the ray tracer (in C++) can be found in this directory.
Page created by Deepak Bandyopadhyay 8/12/2000 02:15AM EDT,
last updated 8/12/2000 02:42AM EDT.