19. Nov.2009, Atanas Boev Updated: 19.Oct. 2012, Olli Suominen Rendering image-plus-depth with Blender – Quick manual Getting blender You can get Blender from blender.org, more specifically from here: http://www.blender.org/download/get-blender/ There are two versions on the website, installer and a zip archive. If you don’t want to install (or can’t, e.g. on a university PC), just download the zip, extract and run blender.exe (Blender installer has had some issues with Windows Vista UAC, but the portable version is known to work.) In this manual, the examples are shown with the newest version at the time, Blender 2.64 (portable). Rendering scene Create your scene. You are allowed to use 3D models from the web, but the scene should be your own. You can have one-two 3D objects against a textured (non-uniform colour) background, or alternatively, 4-5 3D objects at different depths. The scene does not need to be artistic, but should me more complex that one lonely 3D cube in the middle. How to create 3D scene is beyond the scope of this manual, but you can find everything here: http://wiki.blender.org/index.php/Doc:Manual Extracting the depth map First, switch to node editor: Then, you should create a processing chain: 6. 5. 3. 4. 1. 2. 1. Switch to Composite nodes 2. Select Use Nodes 3. Add a Map Value block, and connect it to the z-socket of Render Layers. You need to select the proper values for the Map Value block. The block maps values in the range Offset to Size to values in the new range Min to Max. It is a linear mapping. You need to map the depth values of your scene to the range of [0, 255] required for the depth map. Good starting values are: Offset: 0, Size: 0.05, Min:0, Max: 255. Later, you might need to change the Size (and maybe Offset) value to get a good range of the depth map. Depth map with good range is one that has all values from 0 to 255 present and has nice, gradual shades of gray. 4. Add an Invert block and connect it to the output of the Map Value block 5. Add a Viewer block and connect it to the Color output of the block. This will show you the output of your processing chain. Every time you click the Render button (F12 on the keyboard), the rendering will be repeated, and the processing chain will be executed again. Now you should adjust the values in the “map value” block (3) to get good depth map. 6. When you are happy with the result, select the Viewer block (5), click Image -> Save As Image and save it as a bmp. If the Image-button is not visible, change the upper section of the screen into UV/Image Editor from the menu to the left of where the button should be. You might also need to switch from the menu to the right to Viewer Output. 7. To get the rendered image, you can either render it form the initial window (before you switch to Node Editor), or also could add another Viewer block and connect it to the Image socket in Render layers block and repeat step 6. 8. Now, concatenate both bmp files (image and depth map) into one big BMP. The image part should be 960x540px, and the depth map should be 960x540px. The big image should be 1920x540px and in BMP format. 9. Change the extension of your homework.bmp to homework.bmp.b3d. That is all.
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project