Skip to content

hunterloftis/pathtracer

gh-pages
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

JavaScript Path Tracer

A very simple path tracer in the browser with zero dependencies.

Path tracing is a technique that simulates the behavior of light to render photorealistic images:

output

Scenes

Features

  • Unbiased monte carlo integration
  • Adaptive sampling
  • Russian roulette
  • Physically based materials
    • Fresnel reflection, transmission, absorption, diffusion
    • Color, index of refraction, gloss, transparency, separate fresnel channels, metals
  • Arbitrary light sources
  • Physically based camera
    • sensor, aperture, focus, depth of field
  • Antialiasing
  • Spherical environment maps

Code

The renderer is about 430 lines written for readability, not terseness. The core components of any monte carlo path tracer are its trace function and Bidirectional Scattering Distribution Function (bsdf).

Running locally

$ git clone https://github.com/hunterloftis/pathtracer.git
$ cd pathtracer
$ yarn install
$ yarn start
$ open localhost:8000

About

A simple, naive path tracer in JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published