Up till now, Broadway’s most memorable one-upmanship song was probably Irving Berlin’s ”Anything You Can Do (I Can Do Better),” from Annie Get Your Gun. But that was before Shrek the Musical arrived on the Great White Way to do for Disney-style fairy-tale stage shows what Blazing Saddles did for movie Westerns: It gives them a hearty satirical raspberry, most memorably by way of an extended fart-joke scene.

Of course, we got some of that rude humor in the original trio of computer-animated DreamWorks movies (with Shrek the Fourth targeted for 2010). But there’s nothing so bracingly, brazenly belly-laugh saucy in the films as ”I Got You Beat,” the act-two number between grumpy ogre Shrek (a resplendently green-faced Brian D’Arcy James, always touchingly human beneath his mercifully light prosthetics) and the rescued-from-a-tower Princess Fiona (the perfectly cast, perfectly perky Sutton Foster). Trading tales of childhood woe in a sung smackdown, James’ Shrek takes a turn too energetically. He lets rip a prerecorded toot heard loud as thunder through the Broadway Theatre’s hefty amplification system. It stops the orchestra as well as the show, at least until Foster’s Fiona answers in kind. Within a few moments, things escalate as the lyrics become a literal gas. (You’ve been served, South Park.)

The great joy of this surprisingly nimble adaptation is that it rarely stoops to mere enactment, as happens in vast stretches of soon-to-close Broadway veterans Spamalot and Young Frankenstein. Shrek the Musical takes off from the first Shrek movie — essentially the story of Shrek and Fiona’s spiky courtship — in ways that make the show its own special breed of talking animal. For instance, we see a 7-year-old Shrek cast out into the world by his parents. Bingo, we have a likable character: He’s a wounded churl who never got over mom and dad’s cheery shove-off.

So does it work to turn a movie fueled by pop tunes into a show where characters sing their feelings out loud? Mostly yes. The conceit and the pacing work fine, though the songs themselves are more ho-hum than ”Heigh Ho” — the catchy ditty from Snow White that the show pokes fun of at its peril, since it only points up its own dearth of great tunes. But if the melodies by Jeanine Tesori (Thoroughly Modern Millie and Caroline, or Change) never reach first-hearing hummability, they’re a serviceably bright framework for lyrics by David Lindsay-Abaire (Rabbit Hole).

After the roller-bladed, overly abstract horrors of Disney’s Little Mermaid, it’s a tonic to see the simple and shrewd ways costume designer Tim Hatley has helped physicalize the characters. As sassy Donkey, Shrek’s annoying best pal, Daniel Breaker gets tremendous mileage out of two animatronically controlled ears — excellent for double takes — and two limp, dangly fore-hoofs. Avenue Q alumnus John Tartaglia becomes a puppet himself as squeaky voiced Pinocchio, and his loose-limbed body language is a marvel of wooden pantomime.

Fine as the lead performers are, the crowning presence is Christopher Sieber as diminutive egomaniac Lord Farquaad. An inveterate scene-stealer who never actually seems to be upstaging anyone, Sieber stomps around on his knees in a getup that ingeniously hides his actual legs in black enclosures and instead displays two silly little fake prop legs. An arch hoot in Spamalot, where he originated the Galahad role, Sieber makes Farquaad’s bursts of vanity, insecurity, and hostility endlessly funny. He’s a Möbius strip of fatuousness, and he gets audience members giggling throughout.

There are passing inventions that don’t fly, like a confusing giant dragon puppet given voice by three siren-like chorines who stand in front of it. But most of the time, Shrek the Musical achieves something rare in a big-budget movie-retread show: It makes the stars and the stagecraft the main events. And that’s why the box office may well be the same color as the protagonist for a long, long time. B+