This is the photometric calibration of the SuperNova Legacy Survey (SNLS) three year dataset. The SNLS corresponds to the DEEP component of the larger Canada-France-Hawaii Telescope Legacy Survey (CFHTLS). The SNLS repeatedly monitors four one square degree fields (labeled D[1-4]) with the MegaCam wide-field imager, in the g, r, i and z bands. u-band observations of the same fields are also available, although not formally part of the SNLS dataset. The non-uniformities of the MegaCam imager photometric response have been mapped as a function of the position on the focal plane. The fluxes, measured on the survey images processed with the CFHT Elixir pipeline, have been corrected for these non-uniformities in order to obtain measurements that are uniform at the ~1% level. The MegaCam passband transmissions were found to be non-uniform, the filters being 3 to 6 nanometers bluer on the edges of the camera than on the center. This result agrees with the filter scans provided by the filter manufacturer (Sagem/REOSC). This has important consequences on the definition of the MegaCam magnitudes: the natural magnitude system depends on the focal plane location where the observations were made. In order not to break the connection between calibrated magnitudes and their physical flux counterparts, we chose to report the *natural magnitudes* of each object, measured in the MegaCam passbands, at the focal plane location where the object was observed. We call this system, "Local Natural Magnitudes". The non-uniformities of the MegaCam effective passbands are small and, for main sequence stellar objects, they may be accounted for using linear color corrections. The relation between the Local Natural Magnitudes of a given star, observed at two locations x_0 and x of the focal plane are: g|x = g|x_0 + dk_g_gr(x) * ( (g-r)|x_0 - (g-r)BD+17|x_0 ) ... z|x = z|x_0 + dk_z_iz(x) * ( (i-z)|x_0 - (i-z)BD+17|x_0 ) where the dk(x) are (position dependant) color terms. We provide dk(x) maps for each MegaCam band (see below). The SNLS 3 year calibration relies on the (Landolt, 1992AJ....104..340) standard star catalog. Landolt fields are observed during each photometric night along with the SNLS fields. Zero-points are derived from these observations. Stable and isolated stars are detected on the SNLS fields and selected as "tertiary standards". The calibrated magnitudes of each tertiary standard obtained under photometric conditions are combined to produce a calibration catalog for each SNLS field. To interpret the tertiary standard magnitudes as physical fluxes, we need a primary standard, i.e. a star with known MegaCam magnitudes and whose spectral energy distribution has been measured absolutely. The SNLS uses BD+17 4708 whose SED has been measured in Bohlin & Gilliland, 2004, Cat. <J/AJ/128/3053> using the HST STIS and NICMOS spectrographs. BD+17 4708 has not been directly observed by SNLS, however, its MegaCam magnitudes were inferred from its known Landolt magnitudes (this paper, table 7). The tertiary star Local Natural Magnitudes are defined so that the associated physical broadband flux f|x is given by: f|x = 10^{-0.4*(m|x-m_ref_)}^*{int}[S_ref(l)_*T(l;x)]dl where m|x is the tertiary star magnitudes at location x on the focal plane, m_ref_ is the MegaCam magnitude of BD+17 4708 (at the center of the focal plane, see table 7 of this paper), S_ref(l)_ is the SED of BD+17 4708 measured in 2004AJ....128.3053B, and T(l;x) is the effective passband of MegaCam at location x. Attached is all the necessary information to tie MegaCam observations to this system. We provide (a) the griz magnitudes of the SNLS tertiary standards for all four SNLS fields (b) the MegaCam open transmission and the ugriz MegaCam filter scans at various position along a diagonal (c) the final uncertainty budget in the form of 3 covariance matrices. The u-band observations of the SNLS DEEP fields are not formally part of the SNLS. Nevetheless we give u-band magnitudes for a subset of the SNLS tertiary stars.