Giter Site home page Giter Site logo

raytracer's Introduction

#######################
#      Raytracer      #
#  by Fabrice Lebeau  #
#######################

### Prerequisite ###
  - C++ compiler with C++11 standard
  - CMake >= 3.1
  - Boost
  - OpenMP
  - Threads

### Compilation ###
In order to compile the program, execute the following commands:
  mkdir -p build
  cd build
  cmake ..
  make

### Usage ###
There are two parts in the program: the random scene generator and the raytracer itself. See the help commands:
  - raytracer -h (for the raytracer)
  - raytracer -R -h (for the scene generator)

### Scene file specification ###
The raytracer takes as input a scene file containing all the info about the scene. The format is as follows:
  - comments: line starting with # are ignored
  - camera: a line of the form "C <x> <y> <z>" (x, y and z are float numbers) is required, specifying the position of the camera (the camera always point to the negative z coordinate)
  - light: a line of the form "L <x> <y> <z> <intensity>" (x, y, z and i are float numbers) is required, specifying the position and intensity of the light
  - spheres: a line of the form "S <x> <y> <z> <radius> <material>" specifies the position, radius and material of a sphere. Th <material> argument can be:
     * one of the predefined materials (see file src/material.hpp, namespace Materials)
	 * of the form "object <r> <g> <b>" where r,g and b are float numbers between 0 and 1 representing the color of the sphere.

### Scripts ###
Two scripts are provided with this code (you must first compile the program before using them):
  - generate_images.sh: generates all the images used in the report. I recommend to lower the resolution (to 500x500 or even 400x400) if you just want to test the program, otherwise the computation times are too big
  - random_scenes.sh: takes as input an integer and generates as many random scenes, with a fast rendering with the raytracer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.