Giter VIP home page Giter VIP logo

tiny-path's Introduction

Tiny Path

A tiny, one-file, Monte Carlo path tracer written in a few hundred lines of Ruby. The source accompanied a short talk I gave as an introduction to Ray Tracing (presentation slides available here). The hope is that it provides a simple to understand example. The image below is the rendered output at 1024spp.

Features

  • Monte Carlo method
  • Global illumination
  • Diffuse, and specular BRDFs
  • Ray-sphere intersection
  • Soft shadows
  • Anti-aliasing
  • Modified Cornell box
  • PNG image format output
  • Progressive saving

Usage

$ ruby tiny-path.rb --help

Usage: tiny-path.rb [options]
    -w, --width=width                Image width
    -h, --height=height              Image height
    -s, --spp=spp                    Samples per pixel
    -o, --output=filename            Output filename
    -p, --[no-]progressive-save      Save file while rendering

To render the scene at 16 samples per pixel, run the following command,

$ ruby tiny-path.rb -s 16

It will save a file in the same directory titled output.png.

Author

Julian Villella

License

Tiny Path is available under the MIT license. See the LICENSE file for more info.

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.