There is a good algorithm for this in Special Effects Game Programming. It is written for DirectX 8, but it is still a very good book to have in your collection.
Special Effects Game Programming with DirectX
http://www.amazon.com/gp/product/193...Fencoding=UTF8
As you can see it is older, but that does not mean it doesn't show you some very important principles concerning special effects. I don't rate a book based on it's source code but rather more on content and principles presented.
It is DirectX based, but I'm sure you can port the effect to GL.
I also wrote some code way back when to simulate looking into the sun or some other bright object. Essentially you draw a quad the size of the screen using the color of the light being simulated. The alpha value of the vertices of the quad is a direct function of the distance to the light source from the camera or object. As you get closer, alpha increases and therefore the result is a very bright screen.
You can use simply DOT3 lighting for this effect. Alter the alpha values based on the dot product.
Code:
void Camera::DoWhiteOut(D3DXVECTOR3 LightPos,D3DXCOLOR LightColor,float fcoef)
{
D3DXVECTOR3 toLight=Pos-LightPos;
D3DXVec3Normalize(&toLight,&toLight);
float dot=D3DXVec3Dot(&ToLight,&Look);
if (dot>0)
{
for (int i=0;i<4;i++)
{
WhiteOutVertex[i].Diffuse=D3DXCOLOR(LightColor.r,LightColor.g,LightColor.b,dot);
}
}
}