Code Monkey home page Code Monkey logo

ray-tracing-in-one-weekend-mlx's Introduction

โ˜€ Ray Tracing in One Weekend

Implement in Minilibx, C library in 42


Practice version of miniRT that implement Ray Tracing in One Weekend by Peter Shirley using Minilibx, simple C library that manage GUI in macOS.


๐Ÿ“‚ Related Repository


๐Ÿ›  Development Environment

  • 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 ๐Ÿ˜ข


๐Ÿ’ป How to Run

$ make
$ ./weekend 2

Usage

./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.

Progress

  • 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) and REFLECT_DEPTH (calculate times of ray reflecting) in minirt_const.h to optimize rendering time.

ray-tracing-in-one-weekend-mlx's People

Contributors

cos18 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.