Skip to content

nbonneel/pathtracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pathtracer

Minimalist Quick'n Dirty Path Tracer. (almost) No keyboard needed, just drag'n drop files.

Supports:

  • Phong BRDF model ; some defaults materials from Ngan's fits, as well as support for measured BRDFs from Matusik. Basic subsurface scattering.
  • Environment maps
  • Normal maps, Alpha maps, textures for Albedo, Specular Ks, Shininess, Refraction, Refraction Index
  • OBJ (with materials) and VRML import, XYZ import for point clouds (can also estimate normals)
  • Display of edges, supports non-triangular faces
  • Topological information
  • Filtering, DoF, one spherical light source, Fresnel reflection on transparent objects.
  • Rendering for lenticular images (can buy sheets at vuethru.com or dplenticular.com) and camera arrays (launch computation with the Animation offline render button -- sorry for that ; it will directly write all your files on disk).
  • Limited and buggy support of fog.
  • Some support for integrating photos (background photo, "ghost" objects that receive shadows and indirect light but are not displayed)

Compilation:

  • Dependency: Only wxWidget 3.1.0 (to download), CImg (included) and Nanoflann (included). Optional: Embree. Deactivate by removing #define USE_EMBREE. If using Embree, compile Embree with EMBREE_RAY_MASK activated (deactivated by default). Embree roughly halves the intersection time.
  • Windows: use .sln solution for Visual Studio. Edit path to wxWidget.
  • Linux/MacOS: use CMake, should work too.

Usage:

  • Drag'n drop OBJ, VRML, XYZ (pointsets) files onto window. Also supports .Yarn files (generated by this paper ), Matusik's isotropic .binary BRDF files (BRDF dataset here), .Titopo BRDFs (from here), .seg segmentation files (from here, for example -- one segment ID per face) and .lab segmentation files (where did I get these from?!).
  • Mouse down (left, middle, right) for camera control, mouse wheel for moving forward
  • Click to select object ; see the cursor depth in the status bar (useful to change the focus distance)
  • Shift+Mouse to move/rotate currently selected object
  • Drag'n drop texture files or envmap files onto their slot on the right panel, or use the popup menu to change their values.
  • If materials are changed, they can be re-exported into a new .MTL file (menu File)
  • Menu Info gives topological info on the currently selected mesh (only works for meshes, not point clouds nor the default parametric geometries)
  • Scene can be saved in an .scn file

Images:

2.5 million triangles (src) 2.5 million triangles (src) 2.5 million triangles, entirely transparent (src)
1.8 million triangles (src) 1.6 million triangles (src) 3.1 million triangles, includes transparency (src)
133 k triangles (src) 260 k polygons (src) 1.8 k triangles + normal map (src)
23.7 million triangles (src) 1.8 million triangles (src) 2.5 k polygons + normal map, alpha map and edges display (src)
240 k triangles (src) 4.5 millions points Point Cloud Lenticular images
Lion on a ghost plane + Background photo