It was tough to make them out on such a dimly lit stage, but those five lean silhouettes known as the Strokes came to Merriweather Post Pavilion on Sunday night to make us feel good.

Headlining the Sweetlife Festival’s first year at Merriweather, the rebounding New York quintet finished off the day-long rock festival with a 45-minute endorphin rush of tunes that peaked with “Hard to Explain,” a song that had almost everyone in the near-capacity crowd dancing in the dark.

And that was much better than dancing in the rain, which is how young fans out on the Merriweather lawn spent most of their day, bopping along to soggy sets from Girl Talk, Lupe Fiasco, Crystal Castles, Cold War Kids and others.

Despite all efforts to make this feel like a festival, the Strokes made it feel like a Strokes show, delivering songs new and old with a cool, mysterious confidence. It’s been more than a decade since the stylish fivesome was credited with saving rock-and-roll — a claim that felt dubious at the time. In hindsight, it wasn’t the hype or the frayed denim that made the group famous. It was the Strokes’ ability to extract all of the angst from rock without losing a speck of urgency or a percentage point of cool. Surrounded by post-grunge pouters and nu-metal mopers, they made rock music feel-good music again.

And they still are — which made them the ideal headliner for Sweetlife, a 10-act festival that was all about feeling good and eating healthy. But while vendors hawked organic burgers and quinoa salads, the day was overrun with musical junk food.

Gregg Gillis, the DJ known as Girl Talk, had the crowd bouncing to an hour of mindless mash-ups that felt lazy and dated. He opened his set with a three-track pile-up of Clipse, Black Sabbath and Ludacris — the aural equivalent of that KFC bowl where they mix the mashed potatoes, corn and chicken into one unholy concoction.

Gillis’s favorite trick was to match a tough rap verse with a wimpy pop song. M.O.P. shouted over a Miley Cyrus track, 50 Cent vaunted along with Vampire Weekend and thousands of teenagers ecstatically flailed away.

Really, kids? In 2011? With the entire history of recorded music at your fingertips, this is what you’re into? Is the information age so overwhelming that you need pop music that traffics purely in rapid-fire instant gratification? It makes me want to unfriend you.

Instant gratification is exactly what rapper Lupe Fiasco aimed to provide during an hour-long set defined not by his wordplay, but by the tiresome, rock-inspired crescendos that punctuate nearly all of his songs. As he lobbed open water bottles into the crowd, his metamorphosis from ascendant hip-hop prince to rap-rock mall rat felt sadly complete.

Brooklyn rapper Theophilus London also blurred the lines between rock and hip-hop, but with much better results. Clad in a silver hat worthy of Bootsy Collins, he ran his fingers through a set of wind chimes as he rhymed over distorted guitars and big, gushing synthesizers.

The first big singalong of the day came during “Hang Me Up to Dry” by California’s Cold War Kids — the song’s titular refrain serving as a rallying cry while drippy skies overhead accelerated into a steady drizzle.

Other acts made it harder to sing along. Chamber-pop sextet Ra Ra Riot’s ornate tunes stood out from the pack, but singer Wes Miles’s hiccupping vocals often disappeared into the air. Meanwhile, Alice Glass of Crystal Castles was inscrutable, offering monochromatic yelps over distorted, industrial-grade dance tracks. (To her credit, the cast on her left foot didn’t stop her from diving into the crowd — twice.)

The undercard wasn’t a total wash. Local band U.S. Royalty helped get the day off to a hopeful start with a four-song micro-set that found a satisfying sweet spot between Fleetwood Mac cool and U2-ish oomph. So far, the band has made its name in Washington’s nightclubs but sounded right at home on the big stage.

It was like watching a band finally being released into its natural habitat — a feel-good moment, for sure.