Let's start this epic project!
This project is trying to create a ray tracing simulator by C.
The project grade is 125/100.
In WSL, most functions is ok, but the color presets of light and objects cannot be displayed normally, and reset function is wrong.
This may be because our color structure store int data, not double, and it causes precision loss in WSL. However, we found this problem too late, and as the color calculated in renderer is double type, so preset color is correct when running in Linux. So we didn't modify it.
- yingzhan11 - yzhan
- irwenjust - likong
miniRT-video.mp4
| Basic objects | |
|---|---|
| Reflection && Refraction | |
| Texture && Checkboard | |
| Metal material | |
Here are some of the features Mandatory part handles:
- Basic ray tracing by diffuse reflection;
- Basic render color and shadow for plane, sphere and cylinder;
- Bounding volume hierarchies by aabb box and BVH tree;
- Clear, intuitive and powerful menu system;
- Use "fake class"(fclass) to manage the objects;
- Adaptive render for transform, scale and rotation objects in real-time and dynamic;
Here are some of the features Bonus part add:
- Complete Phong Model(ambient + diffuse + specular);
- Color disruption: checkerboard;
- Colored and multi-spot lights;
- One other 2nd degree object: Cone;
- Smooth and bump texture;
- Reflection and refraction with each object (our bonus);
- Multiple thread render (our bonus);
- Frame rate control (our bonus);
- Multi-material overlay (our bonus);
| File Name | Functionality |
|---|---|
| libft/ | Contains standard libft project and some of the added tools function |
| mandatory/ | Contains all the source files for the mandatory part |
| scenes/ | Contains all the .rt files |
| textures/ | Contains all the texture files |
| bonus/ | Contains all the source files for the bonus part |
| bonus/src/bvh/ | Generate and update aabb box and BVH tree |
| bonus/src/color/ | Contain all calculations and logics for color, checkboard and texture |
| bonus/src/debug/ | Test program |
| bonus/src/entities/ | Objects management |
| bonus/src/fclass/ | Generate and manage the "fake class" |
| bonus/src/hook/ | Menu system operate management |
| bonus/src/init/ | Initialize data |
| bonus/src/intersection/ | Handle intersection for different shapes |
| bonus/src/menu/ | Menu system design management |
| bonus/src/parser/ | Preprocess the source data |
| bonus/src/renderer/ | Core rendering part |
| bonus/src/tools/ | All of tools functions |
| bonus/src/uv/ | UV coordinate calculation |
| bonus/src/vector/ | Vector calculation |
To compile this project you should run make in the terminal.
To run the program needs to follow this:
$ ./miniRT scenes/scene_name For example: ./miniRT scenes/example.rt
To compile this project you should run make bonus in the terminal.
To run the program needs to follow this:
$ ./miniRT scenes/bonus/scene_name For example: ./miniRT scenes/bonus/example.rt
- Some materials we learn and try to use:
Ray Tracing in One Weekend: https://raytracing.github.io/books/RayTracingInOneWeekend.html
The ray tracer challenge: http://raytracerchallenge.com/
Dynamic Bounding Volume Hierarchies: https://box2d.org/files/ErinCatto_DynamicBVH_Full.pdf - We use Minilibx library. It doesn't support resize windows. And may have some limitations on texture format also.
- We did not consider the issue of multi-platform trials. Currently it can only promise works on the Ubuntu system.
- Yeah we really proud that this project has been finished! Even there still could be better and better. Cheers!