-
Notifications
You must be signed in to change notification settings - Fork 2
Interior Example Scene
The Interior recipe uses a Blender model created by Nextwave Multimedia. The Collada parent scene contains more objects than other parent scenes.
This page describes some extra steps I had to take before rendering with RenderToolbox3. Many of these steps would apply to other complex scenes.
This page assumes you are already somewhat familiar with Blender and RenderToolbox3. See Getting Started for some Blender basics. See MaterialSphere Example Scene and ColorChecker Dragon Example Scene for more about RenderToolbox3.
The Interior recipe is located in the RenderToolbox3 repository at:
(path-to-RenderToolbox3)/ExampleScenes/Interior/
Here is what the scene looks like, as rendered with PBRT and Mitsuba:
Above, PBRT rendered the Interior scene with the path-tracing integrator.
Above, Mitsuba rendered the Interior scene with the path-tracing integrator.
The Interior recipe required some extra steps before I could render it with RenderToolbox3. Some steps addressed the unusually large number of objects in the scene. Some steps addressed the fact that the scene was not originally intended for use with RenderToolbox3.
The extra steps involved a web browser, Blender, and Matlab.
The Interior recipe started with a free Blender model from Nextwave Multimedia. Thanks to Nextwave for making lots of free Blender models available!
As of December 2012, the free Blender models are posted at the Nextwave website. The Interior scene used the model called 3D Architectural and Interior view. The download link at that site gave me a file called interior.zip
. Unzipping the file gave me some folders, including interior/source/interio.blend
("interio" might be a typo for "interior". It is also Basque for "inside".).
I opened interio.blend
in Blender, to see what the model looked like. It has some chairs, lights, and wall hangings inside a closed room. The Blender preview started out as an extreme closeup of a spherical hanging lamp. I moved the preview camera around using the mouse and numpad.
Blender's scene object outliner helped me with many of the steps below. This is a list of all the objects in the scene. I changed an arbitrary Blender view panel into an outliner by clicking the lower-leftmost icon in the panel and choosing "Outliner".
Note: I used Blender version 2.63. For more tips about using Blender, see Blender Cookie. In particular, see the Getting Started videos.
The camera in this parent scene uses some Blender features that interfere with RenderToolbox3. I had to disable these before exporting to Collada.
First, I turned off the "AutoTrack" feature, which constrains what the camera can look at.
- In the outliner, I selected the
Camera
object by clicking it. - In the object properties panel, I chose the "Object Constraints" tab. The icon for this tab looks like two links of chain.
- I found a constraint named "AutoTrack". I clicked the
X
to the right of the name to delete the constraint. - I save the Blender file.
At this point, the scene camera would look wherever I pointed it.
Next, I turned off camera animation, which caused the camera to move each time I opened the Blender file.
- In the outliner, I expanded the
Camera
object by clicking on the nearby+
sign. - I right clicked on the item called
Animation
and selected "Unlink Action". - I saved the Blender file.
Now the camera would stay where I put it, even across Blender sessions.
Finally, I positioned the camera for a good view.
- In the outliner, I selected the
Camera
object by clicking it. - In the object properties panel, I chose the "Object" tab. The icon for this tab looks like a cube.
- I typed transformation values to move the camera. These values looked pretty good:
- Location:
- X: -30
- Y: -30
- Z: 10
- Rotation:
- X: 85
- Y: 0
- Z: -30
- Location:
- I saved the Blender file.
At this point the camera was all set.
The Interior parent scene has a few spot lights placed inside the room. These do not fully illuminate the room. Even when rendered with the path-tracing integrator that allows light to reflect among objects in the scene, renderings that use just the spot lights look dark and dominated by grainy artifacts:
Above, Mitsuba rendered the Interior scene with only spot lights inside the room. Left, direct-lighting with no reflections. Right, path-tracing with reflections and image noise.
Blender solves this problem with ambient lights that light up the whole scene. But RenderTooblox3 does not use ambient lights because they are unrealistic.
Instead, I added large area lights to the parent scene, like picture windows. These are outlined in orange in the Blender screenshot below:
These "area lights" are really just rectangular meshes. I could not use Blender's native area light functionality, because these do not survive the Collada export process. Instead, I just created meshes and gave them memorable names. Later, in the RenderToolbox3 mappings file, I "blessed" these meshes with area light functionality.
The area light on the right sits directly behind the camera, so I called it CameraLight
. The other area light sits in front of an existing wall, so I called it WallLight
.
In Blender, an "object" is not the same things as a "mesh". I located the mesh associated with each area light using the outliner. I made sure that both the object and the mesh had memorable names.
I also added a point light near the ceiling, in the corner of the room farthest from the camera. I called this light SneakyPoint
because its light sneaks around the wall in that corner.
Now the Blender scene was ready for RenderToolbox3. I exported a Collada file with File -> Export -> COLLADA (.dae).
The parent scene contains many shapes and lights with uninformative names like Cube.057
and Lamp.009
. It would have been tedious and error-prone to write a mappings file by hand that specified reflectance and emission spectra for all of these objects!
Instead, I used the RenderToolbox3 function WriteDefaultMappingsFile()
. It wrote a mappings file that contained a default material and spectrum for each object.
% write a new mappings file that works with the given Collada file
mappingsFile = WriteDefaultMappingsFile(colladaFile);
This assigned a matte material and an arbitrary Color Checker spectrum to each object, as in the following excerpt:
Material_001-material:material:matte
Material_001-material:diffuseReflectance.spectrum = mccBabel-11.spd
Material_002-material:material:matte
Material_002-material:diffuseReflectance.spectrum = mccBabel-12.spd
Material_003-material:material:matte
Material_003-material:diffuseReflectance.spectrum = mccBabel-13.spd
It also specified the CIE D65 "daylight" spectrum for each light. For example:
Lamp_009-light:light:spot
Lamp_009-light:intensity.spectrum = D65.spd
SneakyPoint-light:light:point
SneakyPoint-light:intensity.spectrum = D65.spd
This default mappings file was a helpful place to start. I made several modifications to it, like adding variables to be filled in from the [conditions file](Conditions File Format).
I also "blessed" the area light meshes that I created in Blender with light-emitting functionality. This was pretty easy, with RenderToolbox3 generic syntax for area lights:
Generic {
CameraLight-mesh:light:area
CameraLight-mesh:intensity.spectrum = D65.spd
WallLight-mesh:light:area
WallLight-mesh:intensity.spectrum = D65.spd
}
Note that the mesh names started out in Blender as CameraLight
and WallLight
. During the Collada export process, they got appended with -mesh
. This is not a big deal, once you know to expect it!
The actual mappings used for the renderings on this page, with all my modifications, is InteriorMappings.txt
.
The executive script MakeInterior.m
produced the renderings on this this page. The script looks for an interio.dae
Collada parent scene file as described and modified above. It produces a family of renderer-native scene files and renderings with PBRT and Mitsuba, based on a conditions file that manipulates the image size, light transport integrator, and lighting.
The direct-lighting integrator was the quickest. It produced clean images but did not allow realistic reflections among objects. This resulted in lots of shadows, and shadows with sharp edges. The path-tracing integrator took a lot longer but produced images that look lighter and more natural. Generally, the path-tracing integrator forces a tradeoff between long rendering times and noisy image artifacts.
Here are direct-lighting and path-tracing renderings side-by-side, from PBRT and Mitsuba:
Above, PBRT rendered the well-lit Interior scene. Left, direct-lighting with no reflections. Right, path-tracing with reflections and some graininess.
Above, Mitsuba rendered the well-lit Interior scene. Left, direct-lighting with no reflections. Right, path-tracing with reflections and some graininess.
The path-tracing renderings are slightly grainy, but generally look brighter and more natural than the direct-lighting renderings.
The cost of the path-tracing was increased rendering time. For reference, I rendered these images at 320x240 pixels, with 512 lighting samples per pixel. My computer was an iMac with a 4-core 2.7GHz Intel Core i5 processor and 4GB of 1333 MHz DDR3 RAM:
- Mitsuba's direct-lighting took about 1 minute to render, path-tracing took about 2 minutes.
- PBRT's direct-lighting took about 2 minute to render, path-tracing took about 22 minutes.
The larger images at the top of this page (640x480 pixels) took much longer!