Glass and other transparent materials are very easy to create if you use Raytracing. With Raytracing you get realistic reflections and refractions. Two effects are still missing, you would have to use Yafray for them (or fake them):
- Caustics (e.g. the brighter spots behind a glass)
- Dispersion (color dependent refraction, e.g. rainbow colors)
Model the Glass
At first you have to model the body of the glass (example). If you want hollow glass (like drinking glasses) you have to model the inside and the outside. Make sure the normals are pointing in the right directions, they have to point consistently outside, i.e. away from the glass surface. With CtrlN you can Recalculate Normals Outside if necessary.
Choose the right material settings
We are going to make basic, clear glass. The material settings are:
Give the material lots of Specularity, turn Ray Mirror and Ray Transp on. The IOR (Index of Refraction) controls how much the glass refracts light. A value of 1.55 is quite good for common glass.
The Ray Transp Depth sets the maximum number of transparent surfaces a single ray can travel through (+1). So two glasses in a row have 8 surfaces, the Depth has to be 7. For an explanation of the other values see Reflections and Transparencies.
Turn Raytracing on
Depending on your Blender version Raytracing is enabled by default in the Render panel in the Scene context (F10). If it's not, turn it on.
Use Ray Shadow lamps.
Build an environment
Give your glass something to reflect and refract. If you have a pitch black surrounding, your glass will be practically invisible. Load an image in your world texture! Turn on TraShadow for the material that receives the shadows.
As you can see in the first example (Some glass), the shadows are not very realistic, they are much to bright. These kind of shadows would be good though for very thin glass, like lightbulbs.
You will get better shadows with dupliverted spots and buffered shadows, a technique described in the section Buffer Shadows / Faked Area Light (Glass with buffered Shadows). An additional lamp in the foot of the glass is necessary to brighten the too dark shadows there (Lightsetup with dupliverted Spots).
It's more difficult to set it up, but well worth the effort.