Skip to content

SirLorrence/Simple-Raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracer

A Ray Tracer Renderer using C++. This project is aimed at helping me understand the fundamentals of Ray-tracing and how it works.

Links:

Features

  • Implementation of all features included in Ray Tracing In One Weekend
    • Spheres
    • Surface Normals
    • Antialiasing
    • Diffuse Materials
    • Metal
    • Dielectrics
    • Positionable Camera
    • Defocus Blur (“depth of field”)
  • PNG image output
  • Multi-Threading (with C++ STD and OpenMP)
  • Render Time Information (ms)

Installation + Build

This program has been tested on Pop OS and MacOS but should work under any system that has cmake and a C++ compiler installed. (Clion, Visual Studio)

Once project files are downloaded and you are currently in the project directory, you can generate the Makefile using the following command:

mkdir build
cd build/
cmake ..

Additionally in the CMakeLists.txt you can enabled different types of rendering, by default its single threaded.

Remove '#' to enable feature
#add_compile_definitions(MTHREAD)
#add_compile_definitions(MTHREAD_V2) 
#add_compile_definitions(ENABLE_MP) <-- OpenMP Render
#add_compile_definitions(MTHREAD_TILE) <--- Tile MT Render

Now you can build the binary by running:

make

To generate the image, run the output binary in the terminal/cmd, which will result in the file appearing in the "images" folder

Project status

On Hold

Roadmap

  • Project Refactoring
  • SDL Project conversion
  • Runtime Rendering (being able to move the camera in a graphics window)

Authors

Built with

License

This code is released under the MIT License.

References

About

Ray Tracer done in C++. Project to learning about how Raytracing works

Resources

License

Stars

Watchers

Forks