Processes by which phototrophic organisms use sunlight as their primary energy source. Contrasts with chemotrophic processes which do not depend on light and function in deriving energy from exogenous chemical sources. Photoautotrophy (or photolithotrophy) is the ability to use sunlight as energy to fix inorganic nutrients to be used for other organic requirements. Photoautotrophs include all GREEN PLANTS; GREEN ALGAE; CYANOBACTERIA; and green and PURPLE SULFUR BACTERIA. Photoheterotrophs or photoorganotrophs require a supply of organic nutrients for their organic requirements but use sunlight as their primary energy source; examples include certain PURPLE NONSULFUR BACTERIA. Depending on environmental conditions some organisms can switch between different nutritional modes (AUTOTROPHY; HETEROTROPHY; chemotrophy; or phototrophy) to utilize different sources to meet their nutrients and energy requirements.