![]() |
PBRT Input File FormatThis document should help you get a basic understanding of the .pbrt file format. For a complete reference you should consult Appendix C in the PBRT book. Sample Input FileThere are several sample scenes included with the PBRT distribution, but this is a short simple one I've made with some comments. You can download the same file here: sharp.pbrt. After rendering this file you should end up with a
picture like this:
#sharp.pbrt -- a simple pbrt input file that displays a cone, sphere
# and refletive plane
#Richard P. Sharp - CIS782 Fall 2004
#first we set up the eye
LookAt 1 1 10 0 0 -1 0 1 0 #ex ey ez lx ly lz ux uy uz
#the camera
Camera "perspective" "float fov" [30]
#this is the filter used for antialiasing
PixelFilter "mitchell" "float xwidth" [2] "float ywidth" [2]
#name the file
Film "image" "string filename" ["sharp.exr"]
"integer xresolution" [400] "integer yresolution" [400]
#begin describing scene
WorldBegin
#light source
AttributeBegin
CoordSysTransform "camera"
LightSource "distant"
"point from" [0 0 0] "point to" [0 0 1]
"color L" [3 3 3]
AttributeEnd
#transform the world
AttributeBegin
Translate 0 -1 0
Rotate 35 0 1 0
#define an orangish sphere
AttributeBegin
Translate -1 .75 -1.5
Rotate -90 1 0 0
Material "matte" "color Kd" [0.7 0.4 0.6]
Shape "sphere" "float radius" [.75]
AttributeEnd
#define a blue cone
AttributeBegin
Translate 0 0 2.5
Rotate -90 1 0 0
#this describes the material properties
Material "bluepaint"
#this is the shape
Shape "cone" "float radius" [.75] "float height" [2]
AttributeEnd
#define a reflective ground plane
AttributeBegin
Scale 10 10 10
Material "shinymetal"
#this is a triangle mesh, the first set of points define four xyz
#coordinates, the second set defines the mesh by indexing into
#those points
Shape "trianglemesh" "point P" [ -1 0 -1 1 0 -1 1 0 1 -1 0 1 ]
"integer indices" [ 0 1 2 2 3 0 ]
AttributeEnd
AttributeEnd
WorldEnd
|