Ants are unusual among insects in that individuals of the same species within a single colony have different modes of locomotion and tasks. We know from walking ants that vision plays a significant role in guiding this behaviour, but we know surprisingly little about the potential contribution of visual sensory structures for a flying mode of locomotion. Here we investigate the structure of the compound eye and ocelli in pedestrian workers, alate females and alate males of an Australian ant, Camponotus consobrinus, and discuss the trade-offs involved in optical sensitivity and spatial resolution. Male ants have more but smaller ommatidia and the smallest interommatidial angles, which is most likely an adaptation to visually track individual flying females. Both walking and flying forms of ants have a similar proportion of specialized receptors sensitive to polarized skylight, but the absolute number of these receptors varies, being greatest in males. Ocelli are present only in the flying forms. Each ocellus consists of a bipartite retina with a horizon-facing dorsal retina, which contains retinula cells with long rhabdoms, and a sky-facing ventral retina with shorter rhabdoms. We discuss the implications of these and their potential for sensing the pattern of polarized skylight.