Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tjensen42/42-minirt

This 42 project is an introduction to the beautiful world of Raytracing.
https://github.com/tjensen42/42-minirt

42cursus minirt raytracer raytracing

Last synced: about 6 hours ago
JSON representation

This 42 project is an introduction to the beautiful world of Raytracing.

Awesome Lists containing this project

README

        

# 42-miniRT

42-logo

This 42 project is an introduction to the beautiful world of Raytracing.
It is one of the group projects in the 42 core curriculum.

Done by: [hepple42](https://github.com/hepple42) & [tjensen42](https://github.com/tjensen42)

Working on this project, we have noticed more and more interesting optical effects in everyday life and were constantly thinking about possible implementation in our RayTracer. Once the basic principle was implemented, it was fun to add more and more objects and functionalities. We were especially excited about implementing relatively fundamental physical laws in code.

An excellent source on raytracing which helped us a lot is [Ray Tracing in One Weekend series of books](https://raytracing.github.io/) by Peter Shirley. It is a really detailed step-by-step guide for implementing a path-tracer in C++.


## How to use it

The only supported and tested operating systems are ```macOS``` and ```Ubuntu 20.04```.

For ```Ubuntu``` it is necessary to install the GLFW library first:
```
sudo apt-get update && \
sudo apt-get install libglfw3 && \
sudo apt-get install libglfw3-dev
```

Compile and run miniRT in 3 simple steps:
1. ```git clone --depth 1 https://github.com/tjensen42/42-miniRT miniRT```
2. ```cd miniRT && make```
3. ```./miniRT scenes/template.rt```


## Scenes

Example: [Template](scenes/template.rt)

| Identifier | Description | Identifier | Description
| :--- | :--- | :--- | :--- |
| ```R``` | Resolution | ```ls``` | Light sphere |
| ```S``` | Sampling specifications |```ld``` | Light disc |
| ```B``` | Background |```lr``` | Light rectangle |
| ```A``` | Ambient light |```tx``` | Texture |
| ```C``` | Camera |```pl``` | Plane |
| | | ```sp``` | Sphere |
| | | ```cy``` | Cylinder |
| | | ```tb``` | Tube |
| | | ```di``` | Disc |
| | | ```rt``` | Rectangle |
| | | ```cu``` | Cuboid |

## Samples
Screen Shot 2022-05-27 at 12 25 43 PM
777
135
6000
template
Screen Shot 2022-05-31 at 10 50 14 AM
Screen Shot 2022-06-07 at 2 56 40 PM
600
random-42-color
rgb-color





*This 42 project is written in C and in accordance to the 42 school norm.


> #### Sample restrictions:
> - All variables have to be declared and aligned at the top of each function
> - Each function can not have more then 25 lines
> - Projects should be created with allowed std functions otherwise it is cheating