There’s nothing quite as uncomfortable as a clammy, sweat-soaked shirt. For decades exercise-wear manufacturers have attempted to make this sensation obsolete; to regulate wearers’ body temperatures, they have developed synthetic fibers with coatings that wick away perspiration and experimented with loose, breathable weaves. Now scientists have developed what they claim is the first textile that automatically changes its structure in response to outside conditions, releasing more heat as temperature and humidity rise.

Researchers at the University of Maryland, College Park, led by YuHuang Wang and Ouyang Min, constructed this self-regulating fabric from infrared-sensitive yarn that reacts to temperature and humidity. When the microenvironment between a person’s skin and the garment changes, the strands constrict to vent more heat—or expand to hold that warmth closer to the body. The fabric is described in a study published this month in Science.

Our bodies absorb and lose heat primarily via infrared radiation. Traditionally we pile on textiles in winter months to capture this energy, then switch to more breathable material in warmer, more humid conditions so we can release it. But in the modern world one might routinely transition from a rushed, sweaty commute to a frigid, air-conditioned office every day. The researchers working on the new fabric thought a single garment that adapts to these different situations would be more practical and comfortable.

Despite advances in perspiration-wicking materials, developing a dynamic fabric—which sheds infrared energy when one is hot and retains it when one is not—has remained a challenge. “Our breakthrough is creating a dynamic effect for getting heat away from the body,” says co-author Wang. “The fabric responds to your personal needs.”

The yarn’s responsiveness comes from its coating: The polymer fibers are covered with a thin layer of carbon nanotubes. When the wearer gets hot or sweaty, the carbon layer tightens, drawing the strands closer together and creating gaps in the fabric. This makes it more breathable, allowing heat to radiate so the wearer can cool down. If the microenvironment next to the skin becomes cold or dry, the fibers expand to capture heat.

The researchers report the adaptive textile altered heat radiation by over 35 percent, adjusting for relative humidity. “Now you can have a one-base-layer garment that can keep you comfortable in a wider range of temperatures and wider range of activities,” Wang says.

Consumer brands involved in outdoor recreation, fitness and endurance sports have long pursued textiles that regulate body temperature. Most of these materials do this in two ways: Increasing the breathability to let heat escape, and quickly pulling perspiration away from the body after intense activity.

Emily Walzer, managing editor at Textile Insight, a trade magazine covering materials used in the outdoor and sporting goods industry, says she has seen multiple approaches to manufacturing comfort-improving technical fabrics. Most have one thing in common: “Moisture management is a key ingredient in performance base layers and close-to-the-skin garments,” Walzer says. “Consumers expect moisture to move faster and more efficiently, and any new technology has to do that function sustainably.”

In pursuit of that ability textile manufacturers including Switzerland-based Schoeller Textil are also trying to develop garments with cooling effects built into the yarn, the knit construction and the finishing coating. According to the company’s North America president, Stephen Kerns, “People are more active than they have ever been. Having clothing that allows them to take off an outer garment and not be completely wet is a big advantage.“ Schoeller was not involved in creating the new adaptive fabric. But Wang says textile-manufacturing experts from other companies (including Milliken and Under Armour) did contribute, along with a team of scientists from a variety of disciplines including chemistry, physics and materials science.

With help from industry, Wang plans to continue developing the adaptive textile. He hopes to test clothing made from it this year and eventually scale up production. Bringing it to the nearest sporting-apparel store, however, could be difficult. “The challenge is in commercialization, cost and design capabilities of these new fibers,” Walzer says. Nevertheless, Wang says his yarn could eventually reach a commercial market: Companies can dye, knit or wash it with the machines and methods currently used to manufacture other performance fabrics, he says. “Our performance is on par or even better than the current standard,” Wang says. He added in an e-mail that the eventual consumer price will be similar to that of other enhanced fabrics. “Based on our cost analysis, we anticipate our production will be competitive at scale,” he wrote.

Any such adaptive textile will have to compete with a crowded field—many activewear brands already produce breathable, sweat-wicking clothing. Some have even developed materials that respond to outside temperatures, albeit with a slightly different mechanism. Schoeller, for example, has incorporated so-called phase-change materials (PCMs) that can store and later release heat into some of its products. “With our PCM, Schoeller offers cooling yarns with their dynamic reaction to environment and body-temperature changes,” Kerns says.

Wang maintains his fabric is the first to actually change form in response to the environment, which might give it an edge. Still, even with apparel that keeps your body at a comfortable temperature, you will probably want to change out of your workout clothes before you arrive at the office.