Code Monkey home page Code Monkey logo

bidirectional_path_tracing's Introduction

Bidirectional Path Tracing

CMU 15-462/662 personal project in 2015Fall (http://15462.courses.cs.cmu.edu/fall2015/)

Ningna Wang(ningnaw)

Bidirectional Path Tracing

I’m expecting this algorithm can handle indirect lighting problems far more efficiently and robustly than ordinary path tracing.

1. Alogorithm:
  • Suppose we go from camera to create the ray path: p1->p2->...->pi, so this time we also create a ray path from light: q1->q2->...->qj. Therefore, the total ray path should be:

p = p1->p2->...->pi->qj->....q2->q1

  • Trace a shadow ray from pi to qj to see if they are visible
  • If so, that means above path carries energy from the light to camera. Then we can evaluate this path’s contribution accordingly.
  • If not, which means the corresponding pixel in camera should be in shadow
2. How to build:
  • mkdir build && cd build && cmake .. && make
  • ./pathtracer -m 5 -s 8 -t 10../dae/sky/CBspheres_lambertian.dae
3. Attention:
  • only support area light for now
  • -m: bounce time
  • -s: sample pixel
  • -t: threads
4. Results:
Example 1 (lambertian + 128 pixels):
  • Bidirectional Path Tracing:

$ ./pathtracer -m 5 -s 128 -t 100../dae/sky/CBspheres_lambertian.dae

alt tag


- Classis Path tracing:

$ ./pathtracer -m 5 -s 128 -t 100../dae/sky/CBspheres_lambertian.dae

alt tag


Example 2 (lambertian + 512 pixels):
  • Bidirectional Path Tracing:

$ ./pathtracer -m 5 -s 512 -t 100../dae/sky/CBspheres_lambertian.dae

alt tag


- Classis Path tracing:

$ ./pathtracer -m 5 -s 512 -t 100../dae/sky/CBspheres_lambertian.dae

alt tag


Example 3 (128 pixels):
  • Bidirectional Path Tracing:

$ ./pathtracer -m 5 -s 128 -t 100../dae/sky/CBspheres.dae

alt tag


- Classis Path tracing:

$ ./pathtracer -m 5 -s 128 -t 100../dae/sky/CBspheres.dae

alt tag




5. Analysis:

From above reuslt pictures, we can see that examples rendering using Bidirectional Path Tracing(BPT) showed very good result at 128 to 256 samples per pixel comparing to the reference results. However, the rendering time of BPT is slightly longer than classic path tracing.

bidirectional_path_tracing's People

Contributors

ningnawang avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

peterzs

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.