This could change the active wear industry. The new fabric will smell better the more you sweat. (Photo: LightField Studios/Shutterstock)

We've all experienced being in a gaggle of people and smelling the stench of sweat.

Then you panic, hoping the dreadful odor isn't coming from you.

Luckily, some scientists are trying to solve this pervasive problem.

A team of engineers from the University of Minho in Portugal have discovered a way to change cotton fabric so that it emits a citronella smell when it comes in contact with sweat. Their work is published in ASC Applied Materials & Interfaces.

The team used a protein found in pigs' noses that binds to scent molecules and added carbohydrate-binding molecules that latch on to cotton.

They also found a second way to achieve the same result using fat-like liposomes to bind the scent to the fabric.

The difference between the two methods is that the first emits the citronella scent in a quick burst while the liposomes release the scent in a slower, more controlled manner.

And while citronella might not smell like high-end cologne or perfume, it does have the added benefit of being an insect repellent.

Become an air freshener. The technology could help those who sweat even when they're not at the gym. (Photo: Antonio Guillem/Shutterstock)

The concept was built on existing smart fabrics that change color or conduct an electric signal in response to stimuli like light or temperature.

The new fabric will need to be tested on a larger scale, but it's a promising use of fragrance and technology as a way to mask one of the world's more unflattering whiffs.

Want to smell better the more you sweat? Scientists have a promising solution
Scientists have developed a material that smells better the more you sweat in it.