Giter Site home page Giter Site logo

rs-raytracer's Introduction

Rust implementation of "Ray Tracing in One Weekend"

Ray Tracing in One Weekend is a series of books by Peter Shirley showcasing implementation of a simple ray tracer. It's a good introduction and for the most part you can just copy the code. I've written many real-time graphic projects, but never a ground up offline ray tracer. I admit that I've already knew most of the math behind it, so the implementation was quick and painless.

Sample image Scene 7 after using optix denoiser. See below for raw image.

Scope

Book 1

  • render the sphere - DONE
  • surface normals - DONE
  • antialiasing - DONE
  • diffuse materials - DONE
  • metal materials - DONE
  • dielectrics materials - DONE
  • camera aperture - DONE

Book 2

  • motion blur - nope, I'm fundamentaly opposed to this feature
  • Bounding Volume Hierarchies - DONE
  • textures - DONE
  • image textures - DONE
  • lights - DONE
  • instancing/transforms - DONE, actually implemented as matrix transforms
  • volumes - DONE

Additional improvements

  • parallel execution - using rayon, task per pixel
  • transform matrices - book only introduces hardcoded single-axis rotations and simple translation

Sample scenes

More sample scenes are in src/scenes. Do not forget to use release build: cargo build --release!

Scene 1 - with camera aperture

Scene 1

Scene 2 - with materials (metal, glass, lambert diffuse)

Scene 2

Scene 3 - with BVH tests

Scene 3

Scene 4 - with textures

Scene 4

Scene 5 - with lights

Scene 5

Scene 6 - with simple transform

Scene 6

Scene 7 - with Cornell box

Scene 7

Scene 8 - with transforms playground

Scene 8

rs-raytracer's People

Contributors

scthe avatar

Watchers

James Cloos avatar  avatar  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.