Skip to content

C++ raytracer, developed during the "Computer Graphics" course

Notifications You must be signed in to change notification settings

cerfedino/ComputerGraphics

Repository files navigation

Introduction

This repo contains all the assignments from the Computer Graphics 6 ECTS course.
The course is part of BSc INF (3rd year) at Università della Svizzera Italiana (USI), in Lugano.

The submodule refers to the current raytracer, any updates will be visible there.

Assignments

Assignment 1 - Ray Sphere Intersection

Assignment 2 - Phong Lighting model

Assignment 3 - Ray-plane intersection, texturing, tone mapping

Assignment 5 - Cone and transformations

Assignment 6 - Shadows, Reflection, and Refraction

Assignment 8 - WebGL

Assignment 9 - Transformations and Lighting

Assignment 10 - Texturing

Rendering Competition

Assignment 11 - Mass-spring System

Rendering

  1. cd into the target assignment folder
cd Assignment1
  1. A Makefile is provided, for compiling and rendering:
  • To render the still image, run the default recipe:
make
  • To render the animation, run the following command:
make animation
  • To render both:
make all
  • To remove the render folder and all the executables
make clean



A folder render containing the rendered material is created.

We use ffmpeg to convert the rendered .ppm file into .png.

All the frames are stored in render/animation. The animation frames are joined together by ffmpeg into a .gif loop animation and an .mp4 file.


By default, the program will render an image of the scene described by the sceneDefinition() function in renderer.h.

The animation is defined in the animation.cpp file.