-
Notifications
You must be signed in to change notification settings - Fork 1
I) Introduction
Ray Tracing is a computer graphics solution to generate 3D images. The basic principle is to trace a ray on each pixel of a window and try to determine whether or not objects defined in the scene are intersected by this ray in order to define the color of the pixel. This technique can generate realistic renderer with complex optical effects like reflection, refraction, caustics or chromatic aberration.
Image source : https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29
This RayTracer is a student project for 42. The project is the last before our first internship and brings us to work on complex concepts and to improve our organisation on big projects. The subject ask us to do an advanced RayTracer with all the options we want. We have some restrictions about the code :
- The Raytracer needs to be written in C
- We can only use basic libraries
- We must use our own library for some Libc functions
- We must follow a norm convention for our code :
Sample from the norm:
- Each function must have a maximum of 25 lines.
- Each line cannot have more than 80 columns, commentary included. Warning: a tab does not count as a column but instead the n spaces it represents.
- Only one instruction per line.
- Only one variable declaration per line.
- We cannot make a declaration and instantiation on the same line, at the exception of global variables and static variables.
- You are forbidden to use:
- for
- do...while
- switch
- case
- goto
- Each operator (binary or ternary) and operand must be separated by a single space.
- etc... (the rule list goes on for 6 pages).
So, even if it is hard, we decided to do the best raytracer in the world ! (and we did...)
Good transition for our project presentation.
Our RayTracer have a lots of functionalities :
- Multi cameras
- Multi lights
- Reflexion
- Refraction
- Specular
- .yml scene parsing
- Changeable window width/height
- Image filters (invert, grayscale, gamma, ...)
- Exporter yml
- Exporter bmp
- Importer bmp (texture loading)
- Perlin noise (procedural textures)
- Texture mapping (plane, sphere)
- Changeable field of view
- Super-sampling (anti-aliasing)
- Beer law 🍺
- Error log
- Texture bilinear filtering
- Loading infos
- Loading percentage
- Line loading display
- Generate normal-map from texture (sobel filter)
- Normal mapping
- Light attenuation with distance
- Camera movement
- Camera orientation with mouse
- Mouse smooth (linear interpolation)
- Frame per second display
- Progressive loading
- Glossy reflection/refractions
- Soft shadows
- Transparent objects texture projection
- Stereoscopic camera for 3D view