Factors that affect the level of sun protection provided by a fabric, in approximate order of importance, include weave, color, weight, stretch, and wetness.
There is some indication that washing fabrics in detergents containing fabric brighteners, which absorb UV radiation, might increase their protective capability.