Skip to content

pmicelium/RT_42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dof

'RT' stands for RayTracer



Made from the end of april 2018 to the end of july 2018. The objective of the project was to create computer generated images. It was a 4 people school project, made from scratch and entirely in C.


Installing

Linux and Mac portability.

You first need to have gtk+3 installed locally.

  • Linux :
$ apt-get install libgtk-3-dev
  • Mac (takes time) :
$ brew install gtk+3

Then run :

$ make

Usage

The programm takes a scene written in json as an argument. Multiple scenes are directly available in the directory with the same name.

$ ./rt 'file_name'

Clustering calculations are implemented. You can run the programm simultaneously on different computers as long as you're connected to the same network.

  • To run the programm as the host :
$ ./rt 'file_name' -host 'number of clients'
  • To run the programm as a client (IP host was given when running the programm as a host) :
$ ./rt 'file_name' -client 'IP host'

Once the programm is running, you can move W A S D and rotate I J K L the camera. You can anti-alias O or pixelate P the display. You can also press ESC to quit the programm. Those are hotkeys implemented to save time searching for that particular display. The UI allows you to do everything you need.

Features

Basics

  • 4 objects : sphere, plane, cylinder, cone
  • Multiple light sources
  • Phong shading
  • Shadows
  • Translations & rotations (camera & objects)

multispot

Limited objects

  • Each object can be cut on 3 different axes
  • These 3 axes can be either the world axes or the object axes
  • Translations & rotations are still working with cut objects
  • Planes can either be cut into rectangles or circles

limited

Refraction / Reflection

  • Both have adjustable percentages
  • Implementation of Snell-Descartes's indice of refraction
  • A semi-transparent object has its colors projected in its shadow

refraction

reflection

Textures

  • Each object can have a texture put on it
  • Variable scale & position
  • Can use alpha channel to set the transparency of the object
  • Can size the object (sets its limits)
  • 24 bits & 32 bits images support

textures

Perturbations

  • Checkerboard / rainbow
  • Perlin noise (classic/cosine)
  • Bump mapping

checkboard

rainbow

perlin

perlin_cos

bump_reflec

User Interface

  • Made with GTK+3, also displays the scene
  • Can open json scenes while the programm is running
  • Possibility to adjust settings of all features
  • Multiple cameras (fov, position, rotation)
  • Can save the current scene in a json file
  • Can save the current scene in a png file

UI

Visual effects

  • Anti-aliasing (SSAA, x2 to x16)
  • Cel-shading
  • Depth of field
  • Sepia & black and white filters
  • Stereoscopy

cel_shading

dof2

sepia

bnw

Lights

  • Ponctual & parallel lights
  • Colored lights
  • Caustics

caust_bump_refrac

Optimization

  • Pixelation
  • Multi-threading
  • Clustering (works with multi-threading)

reflec_bump

caust_reflec

About

RT projet of 42

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published