Friday, 21 September 2012

Baking Height Maps in Blender (since you'll ask...)

Ok. First off, there is no 'official' way to bake out height maps from Blender. It isn't a quick option in the Render properties like Normals, AO, etc. Instead there is a cheat or a hack. Bear with me...

A height map is traditionally a greyscale image from a particular projection (usually above) which represents relative distances. This can be achieved with a ramp texture:

1. Delete all current materials from the mesh and add a single new one. Set it to Shading > shadeless as per image 1.
2. Set up the camera to look directly at the model (or position your plane accordingly, if you are planning on baking the Render to a UVd surface). Set it to orthographic mode and crank the orthographic scale slider until your model fits squarely in the frame. Add a texture to the material already on your model. Choose Blend from the drop down and setup the two colors in Color > Ramp. Leave Mapping > Coordinates at generated (for once) but change the X Y Z dropdowns to all be the same angle (the angle you wish to project from). Per image 2.
3. Render, correcting the ramp colors accordingly if you find the closer areas to be darker than the distances... See image 3.







No comments:

Post a Comment