The pineal gland ? located in the vertebrate brain endocrine gland ? has a number of common features of the retina of the eye. Both organs have developed as pouches diencephalon , act as photoreceptive and produce melatonin in a light-dependent manner . In contrast to the retina , pineal gland has undergone significant evolutionary changes and forming it pinealocytes differ in vertebrates both construction and function . Despite differences in the morphological and loss during phylogeny direct photoreceptive capability , pinealocytes retain the ability for expression of many proteins that are specific for phototransduction . While their function in the lower vertebrate pineal glands appears to be clearly related to the ability to direct light signal reception , it still remains unclear in mammals. Recent studies suggest that they may be directly involved in the phototransduction in early life of mammals . In adult mammals are probably other signal transduction systems .