BumpMapping
A graphical technique that causes a flat surface appear to have depth by altering lighting on the surface according to in-scene lights and camera position. This is commonly used to increase the perceptual complexity of a model without increasing the amount of geometry in the model itself. It is similar to parallax mapping, and operates on a principle similar to normal mapping.
Ogre fully supports all of your normal/bump mapping needs. Normal mapping and bump mapping are almost identical, therefore I will be referring to the two techniques collectively as: Normal mapping.
What is Normal Mapping?
Normal mapping is a texturing technique that allows for the program to use the surface normal values of a high polygon object to simulate the same lighting on a lower polygon object. The results are striking when combined effectively and is an extremely effective technique to increase the realism of your objects at much less cost than using the actual high polygon mesh.
What is the difference between normal and bump maps?
This article sums up the differences pretty well.
How can I make normal maps?
Using freely available tools from ATI, NVIDIA, and a program called ORB (open render bump) you can take your two meshes (high and low polygon count) and generate a normal map.
There is a free normal map tool for GIMP.
Blender modeling tool has special resources for Normal maps.
You can also use Blender with the ATI normal mapper: ATI .nmf Interface
TSGames also provides a free to use way of simply generating normal maps from textures. Look it up here. Note: You can use the tool in english and german.
Free NVidia Normal map filter for Photoshop
How do I use normal maps in Ogre?
By creating a proper .material script silly. Check out the official docs for more information along with the Dot3Bump demo that comes in the official ogre download. Specifically the files in \media\materials\scripts\Examples-Advanced.material - the materials are Examples/BumpMapping/MultiLight and similarly named items. Note that they reference vertex and fragment programs defined in Cg to do the heavy lifting.
You also need to generate tangent vectors for your meshes if the normal map is in tangent space. Ogre can do this for you ahead of time if you use the '-t' parameter to the command line tools OgreXmlConverter or OgreMeshUpgrade. Otherwise, you can generate them in code like this:
unsigned short src, dest; if (!pMesh->suggestTangentVectorBuildParams(src, dest)) { pMesh->buildTangentVectors(src, dest); }
Limitations of Normal Maps
Normal maps may be the bee's knees but don't get carried away. Along with everything there are some downsides:
- They do incur a performance hit larger than an ordinary texture
- Without a good base model/unwrapping, normal maps can sometimes cause lighting distortions