A mechanistic account of visual discomfort