Niche overlap and environmental variability