Skip to content

Kaamyab/Ray-Tracing-Engine

Repository files navigation

Raytracing Engine

License

This is a simple raytracing project written in C++. It renders images based on user input for image width and samples per pixel. The rendered image is saved in output.ppm.

1920x1080 1000 Samples per pixel 1920x1080 1000 Samples per pixel

Getting Started

Prerequisites

  • C++ compiler (supporting C++11)
  • Git

Compilation

Clone the repository:

git clone https://github.com/Kaamyab/Ray-Tracing-Engine.git
cd Ray-Tracing-Engine
g++ main.cpp -o main -std=c++17

Running the Program

Run the compiled program:

./main

Follow the prompts to enter the image width and samples per pixel.

How Raytracing Works

Raytracing is a technique used in computer graphics to simulate the way light interacts with objects in a scene. The basic steps involve shooting rays from the camera into the scene, calculating the intersections with objects, and determining the color of the intersected points.

In this project:

  • The user provides the image width and samples per pixel.
  • The program shoots rays through each pixel, adjusting for the aspect ratio.
  • For each pixel, multiple rays are traced (samples per pixel).
  • The program calculates the color of each pixel by simulating the interaction of light with objects in the scene.

Contributing

If you'd like to contribute to this project, please follow the standard GitHub fork and pull request workflow.

License

This project is licensed under the MIT License

About

This is a simple raytracing project written in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages