My implementation of a ray tracer using native c++
C++ Makefile Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.txt

  _____               _______                        _____  ______          _____  __  __ ______ 
 |  __ \             |__   __|                      |  __ \|  ____|   /\   |  __ \|  \/  |  ____|
 | |__) |__ _ _   _     | |_ __ __ _  ___ ___ _ __  | |__) | |__     /  \  | |  | | \  / | |__   
 |  _  // _" | | | |    | | '__/ _" |/ __/ _ \ '__| |  _  /|  __|   / /\ \ | |  | | |\/| |  __|  
 | | \ \ (_| | |_| |    | | | | (_| | (_|  __/ |    | | \ \| |____ / ____ \| |__| | |  | | |____ 
 |_|  \_\__,_|\__, |    |_|_|  \__,_|\___\___|_|    |_|  \_\______/_/    \_\_____/|_|  |_|______|
               __/ |                                                                             
              |___/     Written by Brandon Davis with C++ and GNU/Linux                              

. . . . . . . . . . . . . . . . . . . .    ================ Compile Instructions ================ 
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .     + unzip this archive
. . . . . . . . █ █ █ █ . . . . . . . .     + open a terminal and cd to the source directory
. . . . . . . █ █ █ █ █ █ . . . . . . .     + run "./build.sh"
_ _ _ █ █ █ _ █ █ █ █ █ █ _ █ █ █ _ _ _     + run "./run.sh"  (runtime ~15 seconds)
_ _ _ █ █ █ _ █ █ █ █ █ █ _ █ █ █ _ _ _     + images will be located in ./Images
_ _ _ _ _ _ _ █ █ █ █ █ █ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ █ █ █ █ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

======================================== Build Requirements =====================================
|
|   + Any OS with a BASH shell
|   + The g++ compiler (I used version 5.2.1)
|       * Can be installed on ubuntu-based systems via "sudo apt-get install build-essential"
|   + An image viewer that supports the .ppm format
|       * Alternatively, use imagemagick to create a .png from the .ppm output
|       * "sudo apt-get install imagemagick"
|       * "cd Images"
|       * "./convert.sh"
|   + OpenGL is NOT required.
|
======================================= Description of Parts ====================================
|
|   This project is build from a few components:
|   + A room, which contains:
|       * Drawables: these implement an intersect function and a getOrtho, which returns an orthogonal ray for any point in space.
|           - Sphere
|           - Plane
|           - Each drawable has a PhongProp - Phong properties that the tracer will use to compute lighting
|       * A camera: a point in threespace to make the origin of each ray.
|       * Any number of lights, each of which will be computed spearately in the trace function.
|       * A View window: Can be set to any 3 coplanar points in space.  
|       * The room will generate initial camera rays based on the camera and view window
|   + The Tracer, which only implements perspective tracing but could be easily refactored to allow for orthographic tracing.
|       * Tracer logic: check if a camera ray has any intersections, then compute lighting for the closest intersect point it finds.
|   + The Renderer, which encapsulates antialiasing and image resolution.  
|       * The same room can be passed twice to the same tracer with different renderers to get either
|           - Different resolutions
|           - A different representation of the room (i.e. the ASCII preview you see)
|   + Helper Classes such as
|       * Color: normalized at the end of rendering based on the global min and max 
|       * Vector3: used for both vectors and points
|       * Ray: Which wraps a vector and a point together, and is the basic unit for checking intersection
|
|   For more detailed information, see inline comments.
|
=================================================================================================