Hydrocarbon reservoirs can be mapped if sufficient resistivity contrasts exist between them and their confining layers, but practical problems remain in target discrimination in deep and shallow waters, especially in the presence of heterogeneous overburden. We have developed an efficient 3D staggered-grid finite-difference controlled-source electromagnetic (CSEM) modeling code that enables study of the physics underlying some practical problems. We undertook a comparative analysis of reservoir detection in - and -deep waters using the simulated electric and magnetic field responses of a simple 3D reservoir. We examined the effect of two types of near-surface heterogeneity (mimicking disconnected gas clouds and/or patchy geochemical alteration halos) on the 3D reservoir response. We found that small-scale, shallow heterogeneities cause distortions that are almost independent of the source frequency. These persist at all source-receiver offsets in the electric amplitude response in deep and shallow waters and phase response in shallow water. They decrease in magnitude with increasing offset in deepwater phase response. Large-scale near-surface heterogeneities distort the horizontal electric field response more significantly than the small-scale ones, but the near-surface response gets smaller in amplitude as the offset increases. The distortions in shallow water are much smaller in magnitude than those for the deepwater case, so that the reservoir signatures still are visible on the response profiles. This might be considered as a positive feature for shallow-water inline electric field exploration. The magnetic field responses for the orthogonal direction provide diagnostic target signatures that are similar to the inline electric field responses in deep water but that are different in shallow water. The magnetic responses are affected by the airwave in a different manner from the electric field, suggesting that combined 3D electric and magnetic field analysis might be vital for handling the airwave problem.