Option "display" "imageviewer" "xv" # Turn on the Monte Carlo Integrator Option "render" "integrator" "montecarlo" Format 100 100 1 PixelSamples 2 2 Display "test1.tiff" "file" "rgba" Projection "perspective" "fov" 45 Translate 0.0 0.0 14.0 WorldBegin Rotate 30 1 0 0 # Step 1: Sample the light according to its surface area Attribute "render" "sample" "light" # Step 2: Sample the microfacet distribution #Attribute "render" "sample" "surface" # Step 3 (Extra Credit): Sample both simultaneously #Attribute "render" "sample" "combination" # Create a spherical light source Attribute "light" "shadows" "on" "nsamples" 1 AttributeBegin AreaLightSource "diffuse" 1 "intensity" 100. "lightcolor" [ 0.5 1 0.5 ] Translate 4.0 2.0 -4.0 Sphere 1.0 -1 1 360 AttributeEnd Illuminate 1 1 # Create a ground plane AttributeBegin Surface "shinymetal" "Ks" 1 "Kr" 0.0 "roughness" .2 Color 1.0 1.0 1.0 Translate 0.0 0.0 7.0 Polygon "P" [-20 -20 0 20 -20 0 20 20 0 -20 20 0] Translate 0.0 0.0 -7.0 AttributeEnd WorldEnd