SDL-based implementation of a tiny and cross-platform ray tracer.
Firstly, you should retrieve the resources from another repository https://github.com/foreverbell/miscellaneous, just executing the initialize.py
in the root folder.
Microsoft Visual C++ 2013 is currently supported. To compile, please open the respective project file in the root folder. We already provide SDL.dll
in the root folder and the SDL library in the folder lib/SDL-1.2.15
.
N.B. Switch to the Release
mode to improve the efficiency of the program.
sudo apt-get install libsdl1.2-dev
cd src/
make
./rt <demo_id>
We currently provide 6 demos for testing.
The first demo presents two Utah teapots ported from GLUT, with the material_transparent
to show the reflection & refraction.
The second demo presents the Earth with texture. This is a real-time demo, you can press left & right to rotate the camera.
The third demo presents a quadratic surface.
The fourth demo presents the famous Stanford Bunny (See http://en.wikipedia.org/wiki/Stanford_bunny) stored with the noff file format in resource/bunny.noff
.
The fifth demo presents a mobius strip.
The sixth demo presents a random fractal terrain generated by Diamond-Square Algorithm
.
And the followings are several images rendered by our program.
- Ray Tracing from the Ground Up (2007)
- Fundamentals of Computer Graphics (2009)
- SDL-1.2.15: http://www.libsdl.org
- ply-1.1: http://graphics.stanford.edu/pub/zippack/ply-1.1.tar.Z
- lodepng: http://lodev.org/lodepng