Practice version of miniRT that implement Ray Tracing in One Weekend by Peter Shirley using Minilibx, simple C library that manage GUI in macOS.
- macOS 10.14+
- clang 11.0+
- Minilibx 20200219_beta (Already in project src!)
- Norm 2.0.2 - C code standard in 42
Minilibx is available on macOS and Linux, but there are only macOS ver. mlx in this project. So this project ONLY runs on macOS ๐ข
$ make
$ ./weekend 2
./weekend (chapter) (--save)
- chapter : Required. Chapter number that execute (2 ~ 13)
- --save : Optional. Save Image in bmp format. When this flag is off, it's running through Minilibx.
๐ --save option work well! Sample bmp files are in sample folder.
- 2. Output an Image
- 3. The vec3 Class (Same result of ch2)
- 4. Rays, a Simple Camera, and Background
- 5. Adding a Sphere
- 6. Surface Normals and Multiple Objects
- 7. Antialiasing
- 8. Diffuse Materials
- 9. Metal
- 10. Dielectrics
- 11. Positionable Camera
- 12. Defocus Blur
- 13. Where Next? (Without Dielectrics and Defocus Blur)
๐จ Last Example (Chapter 13) renders 125 spheres, so it will take few hours to render.
๐ If you want fast rendering, fix
PTHREAD_CNT
(Numbers of threads to render),ANTI_SAMPLES
(Samples of antializing) andREFLECT_DEPTH
(calculate times of ray reflecting) inminirt_const.h
to optimize rendering time.