Skip to content

srishti26/ray

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple ray tracer

This is our projects repository for computer graphics course.

Installation instruction

Dependencies

The following packages are required:

  • gcc 4.7 or clang 3.1
  • CMake 2.6
  • SDL
  • Boost (thread, date_time, program_options)
  • libgd (optional for generating PNG images)

On debian based system the packages could be installed as follows:

$ sudo apt-get install gcc cmake libsdl1.2-dev libboost-dev libgd-dev

On gentoo make sure that png USE flag is enabled and as root:

$ emerge -a1 cmake libsdl gd boost

Build instructions

In the root source directory:

$ cp config.local.example config.local
$ mkdir build
$ cd build
$ cmake ..
$ make -j3
$ ./src/ray --help

Usage instructions

The help is provided with "--help" command line argument. Use "--bpt" to enable bidirectional path tracing and use "-s" to set the number of samples. The higher the number of samples the longer the rendering will take. The default value is 5.

For example, the first image below was rendered in the build directory with the following options:

$ ./src/ray --bpt -s 1000 --png out.png --non-interactive ../nff/cornell-spheres.nff

The options perform the following: specify that bidirectional path tracing is to be used, sets the samples to 1000, specifies png output file, disables interactive rendering and finally specified which scene to render. Warning, the image took around 6 hours to render on a 4 core i7 clocked at 3.4GHz.

New features

  • Support for area and spot lights.
  • Bidirectional path tracing algorithm.
  • Blender exporter to slightly modified NFF. Does not fully support materials, textures and lights, but provides a nice way to export geometry to NFF.
  • Basic texturing.

Example renders

Cornell box

Cornell box with spheres

About

Path tracer for computer graphics project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 90.7%
  • Python 5.2%
  • CMake 3.4%
  • C 0.7%