https://github.com/subdavis/raytracer
My implementation of a ray tracer using native c++
https://github.com/subdavis/raytracer
Last synced: 5 months ago
JSON representation
My implementation of a ray tracer using native c++
- Host: GitHub
- URL: https://github.com/subdavis/raytracer
- Owner: subdavis
- Created: 2016-02-05T03:27:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-18T13:48:19.000Z (almost 10 years ago)
- Last Synced: 2024-06-11T23:38:56.466Z (about 2 years ago)
- Language: C++
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
_____ _______ _____ ______ _____ __ __ ______
| __ \ |__ __| | __ \| ____| /\ | __ \| \/ | ____|
| |__) |__ _ _ _ | |_ __ __ _ ___ ___ _ __ | |__) | |__ / \ | | | | \ / | |__
| _ // _" | | | | | | '__/ _" |/ __/ _ \ '__| | _ /| __| / /\ \ | | | | |\/| | __|
| | \ \ (_| | |_| | | | | | (_| | (_| __/ | | | \ \| |____ / ____ \| |__| | | | | |____
|_| \_\__,_|\__, | |_|_| \__,_|\___\___|_| |_| \_\______/_/ \_\_____/|_| |_|______|
__/ |
|___/ 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.
|
=================================================================================================