The earliest predecessors of the eye were photoreceptor proteins that sense light, found even in unicellular organisms, called "eyespots". Eyespots can sense only ambient brightness: they can distinguish light from dark, sufficient for photoperiodism and daily synchronization of circadian rhythms. They are insufficient for vision, as they cannot distinguish shapes or determine the direction light is coming from. Eyespots are found in nearly all major animal groups, and are common among unicellular organisms, including euglena. The euglena's eyespot, called a "stigma", is located at its anterior end. It is a small splotch of red pigment which shades a collection of light sensitive crystals. Together with the leading flagellum, the eyespot allows the organism to move in response to light, often toward the light to assist in photosynthesis, and to predict day and night, the primary function of circadian rhythms. Visual pigments are located in the brains of more complex organisms, and are thought to have a role in synchronising spawning with lunar cycles. By detecting the subtle changes in night-time illumination, organisms could synchronise the release of sperm and eggs to maximise the probability of fertilisation.