ElisaLegnani / PhotorealisticRendering

A simple raytracer for generating photorealistic images written in C++
https://elisalegnani.github.io/PhotorealisticRendering/
GNU General Public License v3.0
3 stars 0 forks source link

Photorealistic Rendering

release OS license build Top Language

πŸͺ„ A simple raytracing library for generating photorealistic images written in C++.

It is developed for the course Numerical techniques for photorealistic image generation held by professor Maurizio Tomasi (University of Milan, AY2020-2021).

πŸ‘©πŸ»β€πŸ’» The main contributors to this repository are Elisa Legnani and Adele Zaini.

Brief description

The main functionality of the library is rendering photorealistic images from user instructions on an external input text file. The code features four different backwards raytracing algorithms (onoff, flat, pathtracer, pointlight tracer) and –at the moment– the scene elements are basic geometric shapes (spheres, planes, boxes). Setting material properties of the objects determines the interaction with light rays, while the observer point of view is represented by a camera with two different projections available (orthogonal and perspective). This library has another useful functionality that is converting HDR images to LDR ones. The format supported are respectively PFM and PNG/JPG.

🌈 "Reality leaves a lot to the imagination." – J. Lennon. Here is the mean, now it's your turn... unleash all your imagination!

Website

πŸ”— A webpage Photorealistic rendering has been created in order to give more detailed explanations.

Installation

Dependencies

A C++ compiler is needed (C++14 or higher).

You also need to install the following dependencies:

If you want to parallelize the execution or run animations, the required dependencies are:

Note: they are not needed for running the raytracing code.

Download latest release

You can download the latest stable release here (version 1.1.0) and then unpack it running in the command line (Linux):

tar -xvf PhotorealisticRendering-1.0.0.tar

The command is tar xopf for MacOS.

Install from git repository

You can also clone this repository through the command:

git clone https://github.com/ElisaLegnani/PhotorealisticRendering.git

Compile

In order to build and compile the code, run the following commands:

cd PhotorealisticRendering
mkdir build
cd build
cmake ..
make

Executables files can be found in the build directory.

Testing

Tests are being implemented in the test directory.

In order to test the code, run in the build directory:

ctest

The testing interface is built using Catch2.

Usage

You can run the program through the script raytracer, located in the build directory.

The code implements two features, that you can call with commands:

The basic usage is the following:

./raytracer [COMMAND] [INPUT_FILENAME] {OPTIONS}

The [INPUT_FILENAME] is required. There are some examples in the examples directory if you want to give it a try or play with the code.

To have more information about available {OPTIONS}, a commmand-line help shows more details about program features and parameters:

./raytracer --help

The command line interface is built using the argument parsing library Taywee/args.

πŸ”— For further details, examples and full documentation of the code, see the page Photorealistic rendering.

Potentialities and examples

πŸ€ΉπŸ»β€β™€οΈ There is a nice overview of the library potentialities with lots of examples, hoping this can tickle your creativity!

Here is just a spoiler of what awaits you!

Documentation

πŸ““ The complete documentation of the library is available here. It was generated with Doxygen. This is the first versione of the documentation, any suggestions are very appreciated!

Contributing

🚧 Please open pull requests or use the issue tracker to suggest any code implementations or report bugs. Any contributions are welcome!

License

πŸ“‹ The code is released under the terms of the GNU General Public License v3.0. See the file LICENSE.md.