Python-Fast-Raytracer

A basic Ray Tracer that exploits numpy arrays and functions to work fast. The code is written keeping as much readability as possible.

animation

  • [x] Refraction
  • [x] Thin film interference
  • [x] Textures
  • [x] Monte Carlo Ray Tracing with importance sampling
  • [ ] Relativistic optical effects

Installation

Just clone or download this repo. You'll need to install two packages.

  1. Pillow is a fork of the PIL package. It provides the Image module for this application.
    to install it run the following.
pip install pillow
  1. Numpy is a scientific package that helps with mathematical functions.
pip install numpy

Examples

See the examples to see how to render the following images:

python example1.py

EXAMPLE1--1-

python example2.py

EXAMPLE2--1-

python example3.py

EXAMPLE3

python example4.py

EXAMPLE4

python example_cornell_box.py

cornell_box

Some animations:

GitHub

https://github.com/rafael-fuente/Python-Raytracer