Evolution of the eye
There are visual pigments in the brains of more complex organisms. They are thought to help synchronise spawning with lunar cycles. By detecting the subtle changes in night-time illumination, organisms can synchronise the release of sperm and eggs to maximise the  fertilisation of their eggs.