A Raytrace Renderer implemented in C++ using the SDL2 library, designed to demonstrate real-time ray tracing rendering techniques.
- Near real-time ray tracing rendering.
- Support for multiple light sources.
- Scenes can be modified using external text files.
- Implementation of shadows, reflections, and specular highlights.
- Cross-platform compatibility with SDL2.
To build and run the Raytrace Renderer, you need the following dependencies:
- C++ Compiler (GCC or Clang recommended)
- SDL2 Library
- CMake
- Ensure Homebrew is installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install dependencies
brew install gcc sdl2 cmake
sudo apt-get update
sudo apt-get install build-essential libsdl2-dev cmake
Follow these steps to build the Raytrace Renderer:
- Clone the repository:
git clone https://github.com/Hal609/Ray-Trace-Cpp.git
cd raytrace-renderer
- Create a build directory and navigate to it:
mkdir build
cd build
- Run CMake to configure the project and then build it:
cmake -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13 ..
cmake --build .
- To run the renderer, navigate to the root directory and execute:
./main
After building the project, you can run the renderer and display a window with a rendered scene. To edit the scene simply modify sphereData.txt and lightData.txt.
Sphere data consists of: radius, x position, y position, z position, colour, specular exponent and reflection coefficient.
Contributions to the Raytrace Renderer are welcome! If you have suggestions for improvements or encounter any issues, please feel free to open an issue or submit a pr.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.