The lens effect is a very good example of a load-time generated distortion map, since you can change the behavior and various dimensions anytime to fool the audience that it's realtime
Pseudo-approach which I wrote off the top of my head:
Let's say you're on "(x, y) -> (r, t)" in the lens ('x' and 'y' are cart. coords, 'r' and 't' are polar). For a convex lens with the flat side down and the convex side being a spherical shell covering 90 degrees, the surface normal points with angle "an = r * pi/4" (direction pointing away from the center of the lens). The thickness of the lens, with sharp edges, is "h = cos(an) - 1/sqrt(2)". Refraction gives "n1*sin(a1) = n2*sin(a2)" which in this case can be written as "ar = an - asin(sin(an)/1.5)" where 'ar' is the angle against the vertical. Radial displacement due to trip the rays make through the lens gives "dr = h*tan(ar)". Refraction in the flat bottom can be skipped since the background is most probably touching the lens directly. Multiply 'dr' with (x, y) and you got the distortion for one point.
Since lens effects were declared as being cool and Ben had a rather "anticlimactic" way of solving it, I thought I'd just bring up the details for the interested
There are of course simpler ways (like setting radial displacement as "dr = scale*r"...), but "true" simulations can be fun.
EDIT: Is it just me, or do people stop posting whenever I try to start some weirdo discussions involving maths/physics in programming?