# Overview This repository includes a number of example scenes and data for use with the [pbrt-v3](https://github.com/mmp/pbrt-v3) renderer, which corresponds to the system described in the third edition of _Physically Based Rendering_, by Matt Pharr, Wenzel Jakob, and Greg Humphreys. (See also the [pbrt website](http://pbrt.org).) We hope that this data will be useful to users of `pbrt`, developers making changes to the system, and researchers in rendering. To our knowledge, all of these scenes and data can be used fairly freely. Some data is licensed under a Creative Commons Attribution license; see details in Section [Scene Credits] of this document. # Data Sets In addition to example scenes, there is some useful data for use with the system. * [bsdfs/](bsdfs/): this directory includes a variety of bidirectional scattering distribution functions (BSDFs) for use with the `FourierMaterial`. See, for example, the [coffee-splash](coffee-splash) scene for use of such a BSDF in a scene. * New versions of BSDFs for use with `FourierMaterial` can be generated with [layerlab](https://github.com/wjakob/layerlab/). * [lenses/](lenses/): lens description files for a handful of real-world lens systems, for use with the `RealisticCamera`. See the scenes [villa/villa-photons.pbrt](villa/villa-photons.pbrt) and [sanmiguel/f6-17.pbrt](sanmiguel/f6-17.pbrt) for examples of their use. * [spds/](spds/): measured spectral power distributions for a variety of standard illuminants, light sources, metals, and the squares of the Macbeth color checker. # Scenes A variety of scenes are available, ranging from simple ones that show off an individual feature of the system, to more interesting ones that demonstrate complex lighting effects in scenes with detailed geometry and realistic reflection models. Scene files for many of the rendered figures in the book are included here; for example, [dragon/f11-13.pbrt](dragon/f11-13.pbrt) corresponds to Figure 11.13 in the third edition of the book. ## Directory Organization We've tried to organize all of the scene directories in a consistent manner; each scene directory is self-contained, containing all of the geometry, textures, and additional data needed to render the scene. With a few exceptions, each `*.pbrt` file in a scene directory represents a separate variant of the scene to be rendered (possibly with different light source configurations, different camera positions, etc.) Some scenes have `geometry.pbrt`, `lights-*.pbrt` and `materials.pbrt` files that collect common geometry and material definitions across these variants. Thus, you should be able to just run `pbrt scene-name.pbrt` for any of the remaining `*.pbrt` files to render the corresponding scene. Complex triangle meshes and other complex geometry is stored in the `geometry/` directories and texture maps are all in the respective `textures/` directories. (Similarly, any SPDs, realistic camera lenses, or BSDF files are stored in corresponding sub-directories.) The [images/](images/) directory (which has a structure that parallels that of the scene directories) has EXR and PNG files corresponding to the final output from rendering each corresponding scene. All PNGs were generated using the `imgtool` program from the `pbrt-v3` distribution; many had a scale factor applied with the `--scale` command-line option, and a number include a bit of bloom to improve visual realism (via the `--bloomlevel` and related command-line options.) ## Overview of Scenes ![](images/bathroom/bathroom.png height="200px") [bathroom](bathroom): Modern bathroom with soft indirect lighting and depth of field. ![](images/breakfast/breakfast-lamps.png height="200px") [breakfast](breakfast): Indoor scene with chairs around a table. One variant has light streaming in through blinds from the side, while another is only illuminated by the lights above the table. (For the second variant, light transport through the glass light fixtures is a good challenge for many light transport algorithms.) ![](images/buddha-fractal/buddha-fractal.png height="200px") [buddha-fractal](buddha-fractal): Stanford Buddha model made out of Stanford Buddha models. 25,250 instances, each with 29,890 triangles, giving a total geometric complexity of over 750 million triangles. ![](images/bunny-fur/f3-15.png height="200px") [bunny-fur](bunny-fur): Stanford Bunny with fur growing out of it, modeled using the new curve shape added to `pbrt` in the third edition of the book. Over 1.5 million curves are used. ![](images/caustic-glass/f16-9c.png height="200px") [caustic-glass](caustic-glass): Caustic pattern projected through a realistic model of a glass. ![](images/cloud/f15-4c.png height="200px") [cloud](cloud): One scene with a bright white cloud, showing the effect of multiple scattering in participating media, and another, with the same volume density but with much more absorption, showing the difference between highly-scattering and highly-absorptive media. ![](images/coffee-splash/splash.png height="200px") [coffee-splash](coffee-splash): A splash of coffee in a cup with a spoon, showing a complex simulated BRDF for the cup and saucer, and scattering in participating media inside the splash. ![](images/crown/crown.png height="200px") [crown](crown): Detailed model of the Austrian Imperial Crown. ![](images/dragon/f9-3.png height="200px") [dragon](dragon): A scanned dragon model rendered with many different materials, showing off the visual differences between them. ![](images/ecosys/ecosys.png height="200px") [ecosys](ecosys): Complex outdoor scene with many plants and trees. [figures](figures): A variety of fairly simple scenes used for figures in the book. ![](images/ganesha/ganesha.png height="200px") [ganesha](ganesha): Very detailed scan of a small statue, illuminated by area light sources. ![](images/head/head.png height="200px") [head](head): Human head model with a realistic BSSRDF, showing the effect of subsurface scattering. ![](images/killeroos/killeroo-gold.png height="200px") [killeroos](killeroos): The classic "killeroo" model, in a variety of settings. ![view-0](images/landscape/view-0.png height="200px") ![view-1](images/landscape/view-1.png height="200px") ![view-2](images/landscape/view-2.png height="200px") ![view-3](images/landscape/view-3.png height="200px") [landscape](landscape): Very complex realistic outdoor landscape scene, featuring 23,241 unique plant models. Thanks to object instancing, the scene has a total geometric complexity of 3.1 billion triangles, even though only 24 million triangles need to be stored in memory. ![](images/pbrt-book/book.png height="200px") [pbrt-book](pbrt-book): A realistic model of the second edition of the _Physically Based Rendering_ book. ![](images/sanmiguel/sanmiguel.png height="200px") [sanmiguel](sanmiguel): A complex model inspired by a hotel in San Miguel de Allende, Mexico. [simple](simple): A variety of relatively simple scenes. ![](images/sportscar/sportscar.png height="200px") [sportscar](sportscar): Sportscar model, in a variety of illumination settings, showing off the substantial differences in overall visual appearance that result. ![](images/sssdragon/dragon_10.png height="200px") [sssdragon](sssdragon): Dragon model rendered with subsurface scattering, showing the effect of changing the density of the scattering medium in the various scene description files. ![](images/structuresynth/arcsphere.png height="200px") [structuresynth](structuresynth): A few interesting procedural scenes scenes converted from [Structure Synth](http://structuresynth.sourceforge.net) into `pbrt`'s format. ![](images/tt/tt.png height="200px") [tt](tt): Audi TT car model. ![](images/veach-bidir/bidir.png height="200px") [veach-bidir](veach-bidir): A version of a classic scene with a variety of complex types of light transport developed by Eric Veach to show the value of bidirectional path tracing. ![](images/veach-mis/f14-13-mi.png height="200px") [veach-mis](veach-mis): Another scene based on one by Eric Veach, this one showing off the benefit of multiple importance sampling when rendering surfaces of varying glossiness illuminated by light sources of various sizes. ![](images/villa/villa-daylight.png height="200px") [villa](villa): Modern indoor environment. The `villa-daylight.pbrt` version is particularly tricky to render, as all of the indoor lighting comes via specular paths from the outside through the windows. ![](images/vw-van/vw-van.png height="200px") [vw-van](vw-van): Volkswagen Van, illuminated by a HDR environment map. ![](images/volume-caustic/caustic.png height="200px") [volume-caustic](volume-caustic): A glass sphere in participating media, showing off a volumetric caustic--light being focused in the scattering medium after passing through the sphere. ![Whiteroom daytime](images/white-room/whiteroom-daytime.png height="200px") ![Whiteroom night](images/white-room/whiteroom-night.png height="200px") [white-room](white-room): Interior scene, with two illumination configurations. The daytime variant is primarily illuminated by light coming through the windows from the outdoors, while the nighttime version is illuminated by the two lights in the scene. ![](images/yeahright/yeahright.png height="200px") [yeahright](yeahright): An unusual and intricate form on a glossy plate. [wip](wip): This directory has a few scenes that aren't quite ready; renderings don't yet look great, parameters need tuning, etc. We'll try to get to this eventually, or if you're able to get them in good shape, please submit an update (see the following). # Converting Scenes to pbrt's Format Given an amazing scene in another 3D file format, there are a few options for converting it to be used in pbrt. (We're always happy to have help with improvements in this area!) ## Cinema 4D The `exporters/cinema4d` directory in the pbrt-v3 distribution provides an exporter from Cinema 4D. This exporter was developed to export the amazing "landscape" scene that is on the book's front cover from Cinema 4D, so thus should be up to date with respect to pbrt's material models and rendering settings. We have seen good results with using this exporter for other Cinema 4D scenes. ## Wavefront OBJ The pbrt-v3 distribution includes a converter from the Wavefront OBJ format, `obj2pbrt`, that is built when the rest of the system is compiled. To run it, provide the path to an OBJ file and a filename for a new pbrt file: ```bash $ obj2pbrt scene.obj scene.pbrt ``` If there is an accompanying material description file (e.g. `scene.mtl`), the values in it will be roughly mapped to corresponding pbrt materials. You will likely need to manually edit and tune the materials in the generated pbrt file in order to achieve reasonably good-looking results. Note that OBJ files only describe scene geometry; they don't include camera specifications or descriptions of light sources. (Thus, the generated pbrt input file only includes shape and material specifications that you'll need to add inside the WorldBegin/WorldEnd block of a full pbrt input file.) Unless you have camera and light source information separately, you'll need to specify both on your own (see "General Tips" below for some ideas about how to do this.) ## Blender Many very nice scenes have been modeled in [Blender](https://www.blender.org/) and are freely available. (See, for example, the [BlendSwap](http://www.blendswap.com/) website for many scenes that can be used via a Creative Commons license.) Our experience has been that the best approach to export scenes from Blender is to use Blender's native OBJ export (available via the File/Export menu item) and then to use the obj2pbrt utility described above to convert to pbrt's format. Blender scene files may have texture maps for the scene included directly in their `.blend` file. Choose "File/External Data/Unpack into Files" in Blender to save those files independently on disk. (Note that if the textures aren't PNG or TGA format, you'll need to convert to one of those for pbrt to be able to use them.) We would have hoped that the Blender exporter for [LuxRender](http://www.luxrender.net) would have worked well for pbrt (LuxRender is originally based on pbrt and still has a similar input file format.) Unfortunately, our experience has been that exporting to OBJ and using obj2pbrt gives a better starting point for the scene materials. (Further, the LuxRender Blender exporter silently fails if there aren't any lights in the scene.) We suspect that using this exporter as a starting point for a new direct Blender to pbrt exporter might be a worthwhile approach. ## Old Exporters The pbrt-v2 distribution includes [exporters](https://github.com/mmp/pbrt-v2/tree/master/exporters) for 2010 era 3DS Max (which was used for the model used for the cover image for the second edition of the book), Blender, Mathematica, and [Structure Synth](http://structuresynth.sourceforge.net/). All of these are very much out of date, both due to changes over the past six years in in the systems they exported from as well as changes in pbrt. Some of these may be useful for developing updated exporters for the corresponding systems for pbrt-v3. ## General Tips A scene exported using one of the above exporters is certain to not immediately render beautifully as is. Here are some suggestions for how to take an initial export and turn it into something that looks great. First, you may find it useful to run ```bash $ pbrt --toply scene.pbrt > newscene.pbrt ``` This will convert triangle meshes into more compact binary PLY files, giving you a much smaller pbrt scene file to edit. Next, if the exporter doesn't include camera information, the first thing to do is to find a good view. The "environment" camera (which renders an image in all directions) can be useful for finding a good initial position for the camera. Keep rendering images and adjusting the camera position to taste. (For efficiency, use as few pixel samples as you can tolerate and learn to squint and interpret noisy renderings!) Then, you can use the origin you've chosen as the basis for specifying a `LookAt` transformation for a more conventional camera model. While placing the camera, it can be helpful to have a point light source at the camera's position. Adding the following light source to your scene file does this in a way that ensures that the light moves appropriately to wherever the camera has been placed. ``` AttributeBegin CoordSysTransform "camera" LightSource "point" "color I" [10 10 10] AttributeEnd ``` Once the camera is placed, we have found that it's next useful to set up approximate light sources. For outdoor scenes, a good HDR environment map is often all that is needed for lighting. For indoor scenes, you may want a combination of an environment map for the outside and point and/or area light sources for interior lights. You may find it useful to examine the scene in the modeling system that it came from to determine which geometry corresponds to area light sources and to try adding `AreaLightSource` properties to those. (Note that in pbrt, area light sources only emit lights on the side that the surface normal points; you may need a `ReverseOrientation` directive to make the light come out in the right direction. Given good lighting, the next step is to tune the materials. It can be helpful to pick a material and set it to an extreme value (such as a "matte" material that is pure red) and render the scene; this quickly shows which geometric models have that material associated with it. As you do this, watch for objects that are missing texture maps and re-add them. (The good news is that such objects generally do have correct texture coordinates with them. # Submitting Updates We'd love to increase the scope (and quality) of scenes available for use with `pbrt`. If you have a nice scene in `pbrt`'s format that you'd like to have included in this distribution, or if you have improvements to the current set of scenes, we'd love to have them! Unfortunately, it's not possible to host large binary distributions on github, so it's a little more involved than sending a pull request. There are a few options for submitting updates. * For changes small enough to be sent via email, you can use `git format-patch` to make a patch that we can apply and push to the repository. (Send the patch to authors@pbrt.org.) * For larger changes, consider the `git bundle` command to generate a binary representation of the changes. Post the resulting file online somewhere that we can access it, send us a pointer (again, authors@pbrt.org), and we'll merge it. * Finally, if you're not comfortable enough with git for those options, feel free to create a zip or tar file with a new scene and send us a pointer to it; we can take it from there. # Scene Credits * bathroom: Thanks to "nacimus", CC-BY license. Downloaded from http://www.blendswap.com/blends/view/73937. * breakfast: Thanks to "Wig42", CC-BY license. Downloaded from http://www.blendswap.com/blends/view/75431. * buddha-fractal: thanks for Guillermo M. Leal Llaguno for this fun variant of the Stanford Buddha model. (Buddha model courtesy [Stanford Computer Graphics Laboratory](http://graphics.stanford.edu/data/3Dscanrep/)). * bunny-fur: Bunny model courtesy [Stanford Computer Graphics Laboratory](http://graphics.stanford.edu/data/3Dscanrep/). Environment map via http://dativ.at/lightprobes/index.html, thanks to Bernhard Vogl. * caustic-glass: Thanks to Simon Wendsche (https://byob.carbonmade.com/) for the model. * cloud: Smoke dataset courtesy Duc Nguyen and Ron Fedkiw. Skylight environment map courtesy Nolan Goodnight. * coffee-splash: Scene thanks to "guismo"; CC-Attribution license. Downloaded from http://www.blendswap.com/blends/view/56136. Environment map via http://dativ.at/lightprobes/index.html, thanks to Bernhard Vogl. * crown: This amazing model was created by Martin Lubich (http://www.loramel.net/). * dragon: Dragon model courtesy Christian Schüller. Environment map via http://dativ.at/lightprobes/index.html, thanks to Bernhard Vogl. * ecosys: Scene from Deussen et al., [Realistic modeling and rendering of plant ecosystems](http://dl.acm.org/citation.cfm?id=280898). * ganesha: Model scanned by Wenzel Jakob. * head: Model thanks to Infinite Realities, Inc., CC-Attribution license. Environment map thanks to [USC-ICT light probe image gallery](http://gl.ict.usc.edu/Data/HighResProbes/). * killeroos: Thanks to [headus](http://www.headus.com/au)/Rezard for the model. * landscape: Many thanks to Jan-Walter Schliep, Burak Kahraman, and Timm Dapper from [Laubwerk](http://www.laubwerk.com) for this amazing scene. * pbrt-book: Thanks to Karl Li (yiningkarlli@) for this fun model. * sanmiguel: Thanks to Guillermo M. Leal Llaguno for this excellent scene. * sportscar: Excellent model and pbrt conversion courtesy of Yasutoshi Mori (@MirageYM); CC-BY license. Skylight environment maps courtesy Nolan Goodnight. * sssdragon: Dragon model courtesy [Stanford Computer Graphics Laboratory](http://graphics.stanford.edu/data/3Dscanrep/). Environment map via http://dativ.at/lightprobes/index.html, thanks to Bernhard Vogl. * structuresynth: Environment map thanks to [USC-ICT light probe image gallery](http://gl.ict.usc.edu/Data/HighResProbes/). * tt: Thanks for Marko Dabrovic and Mihovil Odak for the car model. Environment map thanks to [USC-ICT light probe image gallery](http://gl.ict.usc.edu/Data/HighResProbes/). * villa: Many thanks to Florent Boyer for this scene. Skylight environment map courtesy Nolan Goodnight. * vw-van: Model courtesy of [Greyscalegorilla](https://greyscalegorilla.com/gsg-free-model-pack-for-cinema-4d/), exported from Cinema4D using the [Cinema4D pbrt exporter](https://github.com/mmp/pbrt-v3/tree/master/exporters/cinema4d). * white-room: Scene thanks to Jay Hardy, CC-Attribution license. Downloaded from http://www.blendswap.com/blends/view/41683. * yeahright: "Interesting" shape generated by Keenan Crane (http://www.cs.cmu.edu/~kmcrane/Projects/ModelRepository/). Environment map thanks to [USC-ICT light probe image gallery](http://gl.ict.usc.edu/Data/HighResProbes/).