• Home
  • About
    • Navi Ning photo

      Navi Ning

      MSE@UIUC, CSE@UIUC. Interested in High-Performance Computing, Server-side Development and Computer Graphics.

    • Learn More
    • Facebook
    • LinkedIn
    • Instagram
    • Github
  • Blog
  • Projects

A Simpler Ray Tracer

11 May 2020

Reading time ~1 minute

Github

https://github.com/navining/raytracing

Introduction

This project is a simple ray-tracer written in C++.

Features

  • Spheres
  • Diffuse material
  • Metal material
  • Dielectric material
  • Emissive material
  • Shadows
  • Positionable camera

Build

make

Run

./raytracing [samples per pixel]

This will render an image of 960×540 with multiple samples per pixel (5000 by default).

The image is saved as “result.ppm” which uses PPM format. You can view the picture with

display result.ppm

or convert it into PNG format with

convert result.ppm result.png

Result

Result

This image is rendered with 5000 samples per pixel, which takes approximately 30 minutes on my laptop.



Computer Graphics Share Tweet +1