This tutorial tries to show how you can render heightmaps (greyscale images where dark shows the 'lowest' and white the 'highest' points) in Blender.
Set up the geometry
- Add a plane (Space >> Add >> Mesh >> Plane) in Top view (7 NumPad) and transform it into your desired height-field. For easier handling later on I suggest to use a size that is exactly 2x2 Blender units (the default size of the plane) or a bit greater, so we don't need to correct the output image ;)
- Set the plane smooth by selecting Set Smooth in the Link and Materials panel in the Editing context (F9)
- Delete the lamp and the current camera by selecting them RMB and hit Del or X. We don't need them as they are.
Note for the "material" way
If you are importing a mesh and/or have rotated the mesh in ObjectMode you need to apply this transformation in ObjectMode by pressing CtrlA->Apply scale and rotation. This is needed because the black->white gradient we'll create below (or use from the blend file) is applied to the local axes of the mesh and is therefore rotated as well in ObjectMode.
Set up the material
- Go to Shading context F5 >> Material buttons
- Material panel >> Add New
- Toogle the Shadeless button in the Material panel.
- Texture buttons F6 (or Shading context F5 >> Texture buttons)
- Texture panel >> Add New
- Texture Type >> Blend
- Colors panel >> activate the Colorband button
- Change the alpha value of the black color to 1 (drag the A-slider to the right)
- Change to the second color-point (default color = cyan) by clicking on the right marker in the 'colorband' or by clicking on the right arrow beside the cur:0 text (this text shows you what point ogf the colorband is currently selected}}
- Change the color fron cyan to white. You can do this by dragging the R, G and B sliders tot he left or by clicking in the color-field and selecting the white color with the mouse.
- Go back to the Material buttons press F5 until they show again (or press F6+F5 ... or you can select the icons of course)
- Select the Map Input panel and change all the mappings in the lower left to Z / Z / Z
Render settings + render
- Make sure you are still in Top view (7 NumPad).
- Add a new camera by pressing Space >> Add >> Camera
- Switch to Editing context by pressing F9
- Enable the Orthographic button in the Camera panel.
- Change the Scale value of the camera to 2 (equals 2x2 blender units)
- Move the camera upwards the z-axis by pressing G + Z and dragging it upwards. Since it is an orthographic camera it doesn't matter much how far you move it up.
- Switch to Scene context (F10)
- Change the SizeX and SizeY values to 512 (or any other square size you need as an output-format) in hte Format panel.
- Hit F12 to render the heightmap and hit F3 to save it when finished.
=== Download example .blend file === Tutorials-Heightfield.blend === Descarga ejemplo. Blend === Tutoriales-Heightfield.blend
Links & Related Content
Related forum threads
- Modeling -> getting height maps from imported mesh
- Modeling -> Is it possible to export a height map from blender?
- Manual/PartIV/Bump and Normal Maps
- Manual/PartIV/Map Input
- Manual/PartIV/Map To
- Manual/PartIV/Displacement Maps
Using composition nodes