What is it for?
- It prevents stray light from entering into the lens, be it sunlight, unwanted ambient light, whatever. This may produce lens flare and/or reduce contrast and saturation in your image.
- It protects the front of the lens from damage. It keeps surfaces or objects safely away from the expensive glass on the front of the lens.
What does it cost?
It is usually free with the lens. Sometimes it is an optional extra. It is very inexpensive if purchased from non-camera-brand sources, often under $10.
When to use it?
Always. If possible, leave it on the lens throughout your shooting day, even in your bag. Only remove it for ultra-close macro work, or if keeping your camera gear inconspicuous is a very high priority. Also check if it interferes with the built-in flash on your camera. Depending on its height the hood may cast a shadow onto your subject. You may want to remove it also when transporting or storing the lens for a length of time.
Its protection of the lens front means you can skip the expensive uv filter your camera vendor recommended and the lens cap, the latter an annoying object to keep track of during a shoot. The filter is not only expensive, but it adds 2 glass surfaces which can collect dust or get scratched, or capture unwanted reflected light on its own.
Why are there two basic shapes?
The ‘petal’ shape accommodates wide-angle lenses. The field of view would extend beyond the edge of the circular shaped hood. The circular shape works nicely on longer telephoto lenses where there is no danger of interfering with the edges of the image.
Make full use of your lens hoods and save a lot of money not purchasing the unnecessary uv or clear filter you thought you needed to protect your lens. A more elaborate presentation of these views can be seen in this video:
Good luck, and happy shooting.