
The fog takes places in the final step of the rasterization process (after texturing and color sum).
The rasterization gives a fragment.
Then there are some test (like alpha test and depth test) before the fragment goes into blending equations.
In OpenGL Specifications 1.3, see "Figure 3.1. Rasterization" at page 59, and see "Figure 4.1. Per-fragment operations" at page 157 for eye-candy figures

Blending discussion
What I do not know is how RipTorn is able to add signed values in the blending equations.
When you have a grey fragment, how can you configure the blending equations so that the destination fragement remains unchanged ?
Blending produces a fragment C = Func( Cs, Cd, S, D ) where :
C = result of blending
Func = a user-defined function
Cs = source fragment (just computed in the rasterization process)
Cd = destination fragment (already present in the framebuffer)
S = source multiplier (eg GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, etc)
D = destination multiplier
But the user-defined function is one of the following only (AFAIK) :
FUNC_ADD : C = Cs*S + Cd*D
FUNC_SUBTRACT : C = Cs*S - Cd*D
FUNC_REVERSE_SUBTRACT : C = Cd*D - Cs*S
MIN : C = min(Cs, Cd)
MAX : C = max(Cs, Cd)
If there existed the function :
FUNC_ADD_SIGNED : C = Cs*S + Cd*D - 0.5
then that would be easy. But according to the current available blending functions, I don''t know how to blend
