Ultraviolet (UV) vision is widespread in a variety of animals, playing important roles in behaviours such as foraging and reproduction. Despite accumulated information about UV vision and UV-dependent behaviours of animals, little is known about the effect of temporal changes and local variations in UV light on UV-dependent behaviour. Here we report the mating behaviour of male cabbage butterfly, Pieris rapae crucivora, in environments with varying content of UV light. We first confirmed that the relative UV content is higher in shaded places than in sunny places. We furthermore arranged experimental areas with varying UV contents in the field, where we compared three aspects of male mating behaviour: visual localization of females, female-searching flight and copulation success rate. In all aspects males performed more actively in UV-rich environments: males searched females for longer, approached females preferentially in the shade and copulated there more frequently. Apparently, female-searching males detect females more easily in a UV-rich environment. The present findings should be taken into consideration when UV-dependent behaviours, visual mate choice in particular, are studied.