Engineers have created a chemical coating that causes cotton materials to clean themselves of stains and remove odors when exposed to sunlight.