  In this paper, we extend our convexity theory for $C^2$ cost functions in
optimal transportation to more general generating functions, which were
originally introduced by the second author to extend the framework of optimal
transportation to embrace near field geometric optics. In particular we provide
an alternative geometric treatment to the previous analytic approach using
differential inequalities, which also gives a different derivation of the
invariance of the fundamental regularity conditions under duality. We also
extend our local theory to cover the strict version of these conditions for
$C^2$ cost and generating functions.
