Skip to content

hunterloftis/pathtracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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