Skip to content

foreverbell/ray-tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracer

SDL-based implementation of a tiny and cross-platform ray tracer.

Compiling

Firstly, you should retrieve the resources from another repository https://github.com/foreverbell/miscellaneous, just executing the initialize.py in the root folder.

Under Windows

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.

Under Linux

sudo apt-get install libsdl1.2-dev
cd src/
make
./rt <demo_id>

Demos

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.

References

  • Ray Tracing from the Ground Up (2007)
  • Fundamentals of Computer Graphics (2009)

3rd-parties

About

SDL-based implementation of a tiny and cross-platform ray tracer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published