CPSC 324, Fall 2002
Lab 12, Part 2: Radiosity
THE FOCUS in this part of Lab 12 is on radiosity. You will be using Blender to take a brief look at this type of rendering. This might not occupy you for the entire lab period. You can use any extra time you have working on the program that is due on Friday, on your final project, or on your Web page.
Your Web page for Lab 12 should contain one ray-traced image and one radiosity image. You can use images that you make in the lab. I do not expect you to spend any significant time on this outside lab.
Radiosity in Blender
Blender can do radiosity renderings, although the radiosity feature is not completely integrated with the rest of Blender's features. And the interface is (surprise!) a little odd. Radiosity in Blender works only with mesh objects, and it does not deal with textures at all. The only thing that matters is the diffuse and emissive colors of meshes in the scene. Any object that has a non-zero emission acts as a light source. The radiosity calculation will spread this light around the rest of the scene. The calculation uses the "shooting" method we talked about in class: The patch with the most un-shot energy shoots its energy into the environment. This is repeated over and over until the total amount of un-shot energy in the scene is below some specified limit -- or until you stop the process by pressing ESC. A nice feature of Blender is that it shows you the process, so you get to see how the lighting changes as the process is iterated.
You will be working under Windows in the lab. Go to the cpsc324 folder on the PCCommon drive. Open the subfolder named radiosity. You will find several Blender files set up for radiosity rendering. These files came with the book The Blender Book, by Carsten Wartmann. You will also see a shortcut icon that you can use for starting Blender, either by double-clicking it or by dragging a .blend file onto the icon. (Note: There is a copy of the radiosity folder in the /home/cs324 directory on the Linux network.)
Open the file conference_room04.blend. You will see several views of a conference room. Here is how to do the radiosity calculation for this room, or for any other scene:
- Point the mouse at one of the 3D windows, and press the A key once or twice to select all the objects in the scene. Only selected mesh objects will be part of the radiosity calculation.
- Go to the radiosity buttons, indicated in the Buttons Window Header by a little radiation symbol. We will ignore most of these buttons, and will use all the default settings.
- Click the "Collect Meshes" button. This collects the data needed for the radiosity calculation. The 3D windows will change in appearance Most of the Blender interface shuts down until you finish the radiosity calculation by clicking the "Free Radio Data" button.
- Click the "Go" button and watch the window in the upper right. After a few seconds of preliminary calculation, the whole scene will go dark except for the objects that emit light. This is the initial setup for the radiosity calculation. The computer will then start shooting energy from patches, and you will see how the shot energy lights the scene. The patches are outlined in green. This starts off pretty quickly, so watch carefully.
- The cursor shows the number of patches that have shot. The process will stop automatically, or you can stop it whenever you want by hitting the ESC key.
- To save the results of the calculation, click the "Replace Meshes" button. This replaces all your objects with one giant mesh that contains the radiosity information. Then click "Free Radio Data" to return Blender to normal operation. (If you click "Free Radio Data" without clicking "Replace Meshes", the results of the calculation are discarded. If you click "Add New Meshes", the data is applied to a newly created mesh which exists right on top of the original meshes. Ordinarily, you would immediately move the new mesh to another layer. This allows you to save the unmodified meshes as well as the new mesh.)
- You can now render the scene by pressing F12. If you want to save the image, you should first go to the Display Buttons and make sure that the image type is JPEG.
Note that Blender expects that you will usually use the radiosity data as a basis for further modeling. For example, you might add lighting to the scene or apply textures. However, this involves some complications, so we won't go into that here.
Next you can try one of the files radiosity_box00.blend or radiosity_boxRGB_00.blend or both. These are simpler scenes, which are similar except that the RGB version has red, blue, and green colored lights. Do the radiosity computation on one or both of these files.
Your assignment to modify one of the sample files by adding and/or removing objects and lights. For a light, it's best to use objects with large faces, such as a cube or a plane. (The algorithm doesn't work well with small light-emitting faces because they don't contain a lot of energy individually. Another thing that I found out is that light is only emitted from the front faces of polygons. In particular, a mesh plane only emits light from one side. If that side is facing away from your objects, they won't be lit.)
You should run a radiosity computation on your modified scene, render an image, and add it to your web site.