How do normal maps work?

Does anyone know a good tutorial or intro to normal maps?

To get a smooth appearance, does the normal map have to get matched to the geometry? Or is it possible to create a generic ‘smooth normal map’? Is it possible to generate the normal map in a shader? I have semirandom terrain and I want the grass to be smooth and the rock to be rough, so I guess I have to generate the normals for the grass normal map by interpolating the verteces?

I have a tutorial here, although it mostly focuses on 2D. There are some links for 3D at the end of the tutorial.

Typically you might sculpt detail using a program like ZBrush, or simply generate a normal map from something like CrazyBump. Then you apply the normal maps to your low poly terrain to create the high quality look.

Thanks, I’m going to work through the tutorials!